Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/52606 )
Change subject: soc/amd/cezanne/cpu: make sure that MAX_CPUS isn't overridden ......................................................................
soc/amd/cezanne/cpu: make sure that MAX_CPUS isn't overridden
Trying to limit the number of available cores by setting the MAX_CPUS Kconfig option to a lower value than the SoC's default might result in cores being enabled in the FSP-S, but not fully initialized in coreboot which wiill cause some malfunction. Add a static assert to make sure that this option isn't changed from the default. To limit the maximum number of cores, use the downcore_mode and disable_smt devicetree settings instead.
BUG=b:184162768 TEST=Build fails if MAX_CPUS isn't the expected default.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Idd6aa1d99128b17218a8e910c33415218a58578f --- M src/soc/amd/cezanne/cpu.c 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/52606/1
diff --git a/src/soc/amd/cezanne/cpu.c b/src/soc/amd/cezanne/cpu.c index 148dcd8..f1ac0a4 100644 --- a/src/soc/amd/cezanne/cpu.c +++ b/src/soc/amd/cezanne/cpu.c @@ -3,6 +3,7 @@ #include <amdblocks/cpu.h> #include <amdblocks/reset.h> #include <amdblocks/smm.h> +#include <assert.h> #include <console/console.h> #include <cpu/amd/microcode.h> #include <cpu/cpu.h> @@ -25,6 +26,10 @@ */ static void pre_mp_init(void) { + _Static_assert(CONFIG_MAX_CPUS == 16, + "Overriding MAX_CPUS might cause malfunction due to half-initialized cores. " + "To reduce the number of available cores, use the downcore_mode and " + "disable_smt devicetree settings instead."); x86_setup_mtrrs_with_detect_no_above_4gb(); x86_mtrr_check(); }