Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8032
-gerrit
commit 165652ec9b03b100acc73a31a045e3b50b1352ac Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Wed Dec 31 18:34:59 2014 +0200
CBMEM console: Fix CAR migration step
With the change it becomes irrelevant if memcpy() car.global_data or cbmemc_reinit() is done first.
Change-Id: Ie479eef346c959e97dcc55861ccb0db1321fb7b2 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/cpu/x86/car.c | 3 ++- src/lib/cbmem_console.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c index c9cc6d6..ba1a49d 100644 --- a/src/cpu/x86/car.c +++ b/src/cpu/x86/car.c @@ -54,7 +54,8 @@ void *car_get_var_ptr(void *var) if (!car_migrated) return var;
- if (var < _car_start || var >= _car_end) { + /* NOTE: preram_console_buffer at _car_end also counts as CAR region. */ + if (var < _car_start || var > _car_end) { printk(BIOS_ERR, "Requesting CAR variable outside of CAR region: %p\n", var); diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 997bb7d..630d9c9 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -65,7 +65,13 @@ static u8 static_console[STATIC_CONSOLE_SIZE];
static inline struct cbmem_console *current_console(void) { - return car_get_var(cbmem_console_p); + struct cbmem_console *cbm_cons_p = car_get_var(cbmem_console_p); +#ifdef __PRE_RAM__ + /* Must not call car_get_var_ptr() after buffer is in CBMEM. */ + if (cbm_cons_p != &preram_cbmem_console) + return cbm_cons_p; +#endif + return car_get_var_ptr(cbm_cons_p); }
static inline void current_console_set(struct cbmem_console *new_console_p)