Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39720 )
Change subject: nb/intel/sandybridge: Store CPUID in ctrl struct ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
This uncovers a rather nasty bug.
https://review.coreboot.org/c/coreboot/+/39720/1/src/northbridge/intel/sandy... File src/northbridge/intel/sandybridge/raminit.c:
https://review.coreboot.org/c/coreboot/+/39720/1/src/northbridge/intel/sandy... PS1, Line 299: err = try_init_dram_ddr3(&ctrl, fast_boot, s3resume, me_uma_size); If the CPU was replaced, but the DIMMs were not, this would be called with the wrong information. This happens both with and without this patch.
Solution? At the beginning of the function, or even as a parameter:
const u32 cpuid = cpu_get_cpuid();
Where SPDs are checked (block above), also check if the CPUID is the same. If there's a mismatch, disable fast boot.
Where ctrl.cpu is set, just use the cpuid variable.