Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4719
-gerrit
commit 5bba95edd42f289c5275b208ea97d21e990c4b0c
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Thu Feb 20 05:10:09 2014 +1100
CAR_GLOBAL: enforce compiler to check if _start != _end
There are some fun rules C compilers can use to optimize their code.
One of them is the assumption that two symbols point to two different
addresses.
In this case this wasn't true, resulting in unintended code execution
(and later, a crash) with a clang build.
[NOTFORMERGE]-yet: Test me!
Change-Id: I1496b22e1d1869ed0610e321b6ec6a83252e9d8b
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/arch/x86/init/romstage.ld | 2 +-
src/cpu/x86/car.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/arch/x86/init/romstage.ld b/src/arch/x86/init/romstage.ld
index f44185f..6ab2247 100644
--- a/src/arch/x86/init/romstage.ld
+++ b/src/arch/x86/init/romstage.ld
@@ -37,7 +37,7 @@ SECTIONS
. = ALIGN(16);
_car_migrate_start = .;
*(.car.migrate);
- _car_migrate_end = .;
+ LONG(0);
. = ALIGN(16);
_erom = .;
}
diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c
index 481153d..a7e3842 100644
--- a/src/cpu/x86/car.c
+++ b/src/cpu/x86/car.c
@@ -26,7 +26,6 @@
typedef void (* const car_migration_func_t)(void);
extern car_migration_func_t _car_migrate_start;
-extern car_migration_func_t _car_migrate_end;
extern char _car_data_start[];
extern char _car_data_end[];
@@ -98,7 +97,7 @@ void car_migrate_variables(void)
/* Call all the migration functions. */
migrate_func = &_car_migrate_start;
- while (migrate_func != &_car_migrate_end) {
+ while (*migrate_func != NULL) {
(*migrate_func)();
migrate_func++;
}
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4719
-gerrit
commit fdac806240c2aa5da7820147bc3928920ff32e07
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Thu Feb 20 01:51:43 2014 +1100
CAR_GLOBAL: enforce compiler to check if _start != _end
There are some fun rules C compilers can use to optimize their code.
One of them is the assumption that two symbols point to two different
addresses.
In this case this wasn't true, resulting in unintended code execution
(and later, a crash) with a clang build.
Change-Id: I1496b22e1d1869ed0610e321b6ec6a83252e9d8b
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/arch/x86/init/romstage.ld | 1 +
src/cpu/x86/car.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/init/romstage.ld b/src/arch/x86/init/romstage.ld
index f44185f..5458cfc 100644
--- a/src/arch/x86/init/romstage.ld
+++ b/src/arch/x86/init/romstage.ld
@@ -37,6 +37,7 @@ SECTIONS
. = ALIGN(16);
_car_migrate_start = .;
*(.car.migrate);
+ LONG(0);
_car_migrate_end = .;
. = ALIGN(16);
_erom = .;
diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c
index 481153d..8f6a855 100644
--- a/src/cpu/x86/car.c
+++ b/src/cpu/x86/car.c
@@ -98,7 +98,7 @@ void car_migrate_variables(void)
/* Call all the migration functions. */
migrate_func = &_car_migrate_start;
- while (migrate_func != &_car_migrate_end) {
+ while (*migrate_func != NULL) {
(*migrate_func)();
migrate_func++;
}
the following patch was just integrated into master:
commit 01fddb11d492d00dfc8b1f42e6969838ad6db04d
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Mon Feb 10 11:34:27 2014 -0800
lynxpoint: Finalize chipset before playload if not CONFIG_CHROMEOS
The Chrome OS environment sends an SMI to finalize the chipset/board
at the end of the "depthcharge" payload, but there is no facility to
send this command if not using the full ChromeOS firmware stack.
This commit adds a callback before booting the payload that will
issue this SMI which will lock down the chipset and route USB devices
to the XHCI controller.
Change-Id: I2db9c44d61ebf8fa28a8a2b260a63d4aa4d75842
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
See http://review.coreboot.org/5181 for details.
-gerrit