Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36662 )
Change subject: arch/x86: Correctly determine number of enabled cores ......................................................................
Patch Set 1:
Patch Set 1: Code-Review-1
Reading the SMBIOS spec, this field seems explicitly designed to *not* reflect actual core count but rather whatever is configured by the firmware. So actually CONFIG_MAX_CPUS would be a better choice.
OTOH, maybe the CPUID result will reflect this anyway?
The current code looks correct. CONFIG_MAX_CPUS is only used to determine the size of structures used during CPU init, so it is effectively the maximum amount of cores configured. However things often go wrong if the amount of cores exceeds CONFIG_MAX_CPUS.