[coreboot-gerrit] Patch set updated for coreboot: 107f144 cpu/x86/car: Remove printk in car_get_var_ptr()

Timothy Pearson (tpearson@raptorengineeringinc.com) gerrit at coreboot.org
Sat Feb 28 22:08:39 CET 2015


Timothy Pearson (tpearson at raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8493

-gerrit

commit 107f1449946fba89f9b831c273ab01f4beafdde9
Author: Timothy Pearson <tpearson at raptorengineeringinc.com>
Date:   Thu Feb 19 17:51:02 2015 -0600

    cpu/x86/car: Remove printk in car_get_var_ptr()
    
    Use of printk in car_get_var_ptr() will cause infinite recursion.
    This caused an immediate crash on AMD K10 platforms after setting
    car_get_var_ptr, causing a failure to boot.
    
    TEST: With other patches under review booted KFSN4-DRE successfully
    and gained access to romstage console logs and timestamps.
    
    Change-Id: I883df807932b7b78d176882f6f4b121a8b7e2e52
    Signed-off-by: Timothy Pearson <tpearson at raptorengineeringinc.com>
---
 src/cpu/x86/car.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c
index 9f1a26e..1458560 100644
--- a/src/cpu/x86/car.c
+++ b/src/cpu/x86/car.c
@@ -1,6 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
+ * Copyright (C) 2015 Timothy Pearson <tpearson at raptorengineeringinc.com>, Raptor Engineering
  * Copyright (C) 2013 Google, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -22,6 +23,7 @@
 #include <console/console.h>
 #include <cbmem.h>
 #include <arch/early_variables.h>
+#include <include/smp/node.h>
 
 #if IS_ENABLED(CONFIG_PLATFORM_USES_FSP)
 #include <drivers/intel/fsp/fsp_util.h>
@@ -50,6 +52,9 @@ static int car_migrated CAR_GLOBAL;
  */
 void *car_get_var_ptr(void *var)
 {
+	if (!boot_cpu())
+		return var;
+
 	char *migrated_base = NULL;
 	int offset;
 	void * _car_start = &_car_data_start;
@@ -60,12 +65,8 @@ void *car_get_var_ptr(void *var)
 	if (!car_migrated)
 		return var;
 
-	if (var < _car_start || var >= _car_end) {
-		printk(BIOS_ERR,
-		       "Requesting CAR variable outside of CAR region: %p\n",
-		       var);
+	if (var < _car_start || var >= _car_end)
 		return var;
-	}
 
 #if IS_ENABLED(CONFIG_PLATFORM_USES_FSP)
 	migrated_base=(char *)find_saved_temp_mem(



More information about the coreboot-gerrit mailing list