[arch][x86][smp] few misc tweaks

- Skip cpus in the MADT table that are not enabled
- Bump count to 16 cpus
- Move the spurious interrupt vector to 0xff since it needs to end in
  0xf on <=P6.
This commit is contained in:
Travis Geiselbrecht
2025-04-06 22:22:20 -07:00
parent a8bc048648
commit 699ec6344e
3 changed files with 7 additions and 2 deletions

View File

@@ -84,9 +84,10 @@ enum lapic_regs {
enum lapic_interrupts {
LAPIC_INT_TIMER = 0xf8,
LAPIC_INT_SPURIOUS,
LAPIC_INT_GENERIC,
LAPIC_INT_RESCHEDULE,
LAPIC_INT_SPURIOUS = 0xff, // Bits 0-3 must be 1 for P6 and below compatibility
};
enum lapic_timer_mode {

View File

@@ -52,7 +52,7 @@ GLOBAL_DEFINES += \
ARCH_HAS_MMU=1
ifeq ($(WITH_SMP),1)
SMP_MAX_CPUS ?= 8
SMP_MAX_CPUS ?= 16
GLOBAL_DEFINES += \
WITH_SMP=1 \
SMP_MAX_CPUS=$(SMP_MAX_CPUS)

View File

@@ -108,6 +108,10 @@ static void local_apic_callback(const void *_entry, size_t entry_len, void *cook
const struct acpi_madt_local_apic_entry *entry = _entry;
struct detected_cpus *cpus = cookie;
if ((entry->flags & ACPI_MADT_FLAG_ENABLED) == 0) {
return;
}
// TODO: read the current APIC id and skip it, instead of assuming 0 is the boot cpu
// read BSP from X86_IA32_APIC_BASE_MSR bit 8?
if (entry->apic_id == 0) {