Skip to content

Commit

Permalink
x86: x86_64 can only support max 4 CPUs
Browse files Browse the repository at this point in the history
With all the stacks and TSS (etc), the x86_64 arch code can only
support maximum of 4 CPUs at the moment. So add a build assert
if more CPUs are specified via CONFIG_MP_MAX_NUM_CPUS, also
overwrite the range value for CONFIG_MP_MAX_NUM_CPUS.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
  • Loading branch information
dcpleung authored and nashif committed Jun 17, 2023
1 parent 5bd42b9 commit ad826f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/core/Kconfig.intel64
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,7 @@ config X86_USERSPACE
supporting user-level threads that are protected from each other and
from crashing the kernel.

config MP_MAX_NUM_CPUS
range 1 4

endif # X86_64
2 changes: 2 additions & 0 deletions arch/x86/core/intel64/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <zephyr/drivers/interrupt_controller/loapic.h>
#include <zephyr/arch/x86/acpi.h>

BUILD_ASSERT(CONFIG_MP_MAX_NUM_CPUS <= 4, "Only supports max 4 CPUs");

/*
* Map of CPU logical IDs to CPU local APIC IDs. By default,
* we assume this simple identity mapping, as found in QEMU.
Expand Down

0 comments on commit ad826f3

Please sign in to comment.