From a7fb23081cb03f85de0bd80944089b82af737e3d Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Thu, 7 Nov 2019 09:48:41 -0800 Subject: arch/x86: Correctly determine number of enabled cores Instead of using MAX of (cores_enabled, MAX_CPUS), use MIN which is correct. TEST=tested with dmidecode Change-Id: Id0935f48e73c037bb7c0e1cf36f94d98a40a499c Signed-off-by: Andrey Petrov Reviewed-on: https://review.coreboot.org/c/coreboot/+/36662 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks Reviewed-by: Philipp Deppenwiese Reviewed-by: Nico Huber Reviewed-by: Arthur Heymans --- src/arch/x86/smbios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch') diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 261888fc7f..725d808d56 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -659,7 +659,7 @@ static int smbios_write_type4(unsigned long *current, int handle) t->processor_type = 3; /* System Processor */ t->core_count = (res.ebx >> 16) & 0xff; /* Assume we enable all the cores always, capped only by MAX_CPUS */ - t->core_enabled = MAX(t->core_count, CONFIG_MAX_CPUS); + t->core_enabled = MIN(t->core_count, CONFIG_MAX_CPUS); t->l1_cache_handle = 0xffff; t->l2_cache_handle = 0xffff; t->l3_cache_handle = 0xffff; -- cgit v1.2.3