Lean Sheng Tan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/80546?usp=email )
Change subject: soc/intel/xeon_sp/uncore: Don't print uninitialized memory ......................................................................
soc/intel/xeon_sp/uncore: Don't print uninitialized memory
The struct map_entry has two zero'd entries due to the ifdef being used. Do not read those entries and do not print those entries.
Fixes a NULL string being printed along as the vendor and device ID of the PCI device.
Change-Id: Id87ced76af552c0d064538f8140d1b78724fb833 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/80546 Reviewed-by: Shuo Liu shuo.liu@intel.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/xeon_sp/uncore.c 1 file changed, 8 insertions(+), 0 deletions(-)
Approvals: Arthur Heymans: Looks good to me, approved Shuo Liu: Looks good to me, but someone else must approve build bot (Jenkins): Verified
diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index ddc6e82..de2d175 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -72,6 +72,11 @@ uint64_t value; uint64_t mask;
+ if (!entry->reg) { + *result = 0; + return; + } + /* All registers are on a 1MiB granularity. */ mask = ((1ULL << entry->mask_bits) - 1); mask = ~mask; @@ -103,6 +108,9 @@ { int i; for (i = 0; i < NUM_MAP_ENTRIES; i++) { + if (!memory_map[i].description) + continue; + printk(BIOS_DEBUG, "MC MAP: %s: 0x%llx\n", memory_map[i].description, values[i]); }