Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8508
-gerrit
commit 131929828c6ee5c1b26de3ca3a81972a30b4387b Author: Patrick Georgi patrick@georgi-clan.de Date: Sun Feb 22 16:27:56 2015 +0100
AMD Fam10h: sanity check some CPU data
If a certain register returns crap values, we determine core_power using an uninitialized variable. That doesn't sound healthy.
Change-Id: I1e890b78bfcc3bf0255a3d4f6561a783134b1719 Signed-off-by: Patrick Georgi patrick@georgi-clan.de Found-by: Coverity Scan --- src/cpu/amd/model_10xxx/powernow_acpi.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/cpu/amd/model_10xxx/powernow_acpi.c b/src/cpu/amd/model_10xxx/powernow_acpi.c index feb8f01..09726a0 100644 --- a/src/cpu/amd/model_10xxx/powernow_acpi.c +++ b/src/cpu/amd/model_10xxx/powernow_acpi.c @@ -223,6 +223,11 @@ static void pstates_algorithm(u32 pcontrol_blk, u8 plen, u8 onlyBSP) case 0x3: expanded_cpuidv = 1000; break; + default: + printk(BIOS_ERR, "%s:%s:%d: Invalid cpuidv, " + "not generating pstate tables.\n", + __FILE__, __func__, __LINE__); + return; } core_power = (core_voltage * cpuidd) / (expanded_cpuidv * 10);