[coreboot-gerrit] Patch set updated for coreboot: die() when attempting to use bounce bufferon non-i386.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sat Feb 20 07:34:59 CET 2016


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13750

-gerrit

commit 75d7e1c3496973d882903f67619ccee41d838037
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Feb 19 16:44:22 2016 +0100

    die() when attempting to use bounce bufferon non-i386.
    
    Only i386 has code to support bounce buffer. For others coreboot
    would silently discard part of binary which doesn't work and is a hell to debug.
    
    Instead just die.
    
    Change-Id: I37ae24ea5d13aae95f9856a896700a0408747233
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/arch/arm/boot.c           | 5 +++++
 src/arch/arm64/boot.c         | 5 +++++
 src/arch/mips/boot.c          | 5 +++++
 src/arch/power8/boot.c        | 5 +++++
 src/arch/riscv/boot.c         | 5 +++++
 src/arch/x86/boot.c           | 5 +++++
 src/include/program_loading.h | 3 +++
 src/lib/selfboot.c            | 3 +++
 8 files changed, 36 insertions(+)

diff --git a/src/arch/arm/boot.c b/src/arch/arm/boot.c
index 1767fe0..e208fc9 100644
--- a/src/arch/arm/boot.c
+++ b/src/arch/arm/boot.c
@@ -25,3 +25,8 @@ void arch_prog_run(struct prog *prog)
 	doit = prog_entry(prog);
 	doit(prog_entry_arg(prog));
 }
+
+int arch_supports_bounce_buffer(void)
+{
+	return 0;
+}
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c
index fa83c3f..d498cd9 100644
--- a/src/arch/arm64/boot.c
+++ b/src/arch/arm64/boot.c
@@ -72,6 +72,11 @@ void arch_prog_run(struct prog *prog)
 	doit(prog_entry_arg(prog));
 }
 
+int arch_supports_bounce_buffer(void)
+{
+	return 0;
+}
+
 /* Generic stage entry point. Can be overridden by board/SoC if needed. */
 __attribute__((weak)) void stage_entry(void)
 {
diff --git a/src/arch/mips/boot.c b/src/arch/mips/boot.c
index 5ab36ec..608af7b 100644
--- a/src/arch/mips/boot.c
+++ b/src/arch/mips/boot.c
@@ -23,3 +23,8 @@ void arch_prog_run(struct prog *prog)
 
 	doit(cb_tables);
 }
+
+int arch_supports_bounce_buffer(void)
+{
+	return 0;
+}
diff --git a/src/arch/power8/boot.c b/src/arch/power8/boot.c
index 4da60b4..fa1586f 100644
--- a/src/arch/power8/boot.c
+++ b/src/arch/power8/boot.c
@@ -21,3 +21,8 @@ void arch_prog_run(struct prog *prog)
 
 	doit(prog_entry_arg(prog));
 }
+
+int arch_supports_bounce_buffer(void)
+{
+	return 0;
+}
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c
index 552b3f4..96526bf 100644
--- a/src/arch/riscv/boot.c
+++ b/src/arch/riscv/boot.c
@@ -30,3 +30,8 @@ void arch_prog_run(struct prog *prog)
 		doit(prog_entry_arg(prog));
 	}
 }
+
+int arch_supports_bounce_buffer(void)
+{
+	return 0;
+}
diff --git a/src/arch/x86/boot.c b/src/arch/x86/boot.c
index b23e322..57b1530 100644
--- a/src/arch/x86/boot.c
+++ b/src/arch/x86/boot.c
@@ -192,6 +192,11 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
 		);
 }
 
+int arch_supports_bounce_buffer(void)
+{
+	return 0;
+}
+
 static void try_payload(struct prog *prog)
 {
 	if (prog_type(prog) == PROG_PAYLOAD) {
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index f71dcb7..8ac73dd 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -41,6 +41,9 @@ enum prog_type {
  * set on the last segment loaded. */
 void arch_segment_loaded(uintptr_t start, size_t size, int flags);
 
+/* Return true if arch supports bounce buffer.  */
+int arch_supports_bounce_buffer(void);
+
 /* Representation of a program. */
 struct prog {
 	/* The region_device is the source of program content to load. After
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index 6d86159..f3a1e52 100644
--- a/src/lib/selfboot.c
+++ b/src/lib/selfboot.c
@@ -114,6 +114,9 @@ static int relocate_segment(unsigned long buffer, struct segment *seg)
 	if (!overlaps_coreboot(seg))
 		return 0;
 
+	if (!arch_supports_bounce_buffer())
+		die ("bounce buffer not supported");
+
 	start = seg->s_dstaddr;
 	middle = start + seg->s_filesz;
 	end = start + seg->s_memsz;



More information about the coreboot-gerrit mailing list