diff --git a/src/system/boot/platform/bios_ia32/smp.cpp b/src/system/boot/platform/bios_ia32/smp.cpp index 779680e130..2714d5b3d6 100644 --- a/src/system/boot/platform/bios_ia32/smp.cpp +++ b/src/system/boot/platform/bios_ia32/smp.cpp @@ -165,6 +165,12 @@ smp_do_mp_config(mp_floating_struct *floatingStruct) continue; } + // skip if the apic id is too large + if (processor->apic_id >= MAX_BOOT_CPUS) { + TRACE(("smp: apic id too large (%d)\n", processor->apic_id)); + continue; + } + gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id; gKernelArgs.arch_args.cpu_os_id[processor->apic_id] @@ -274,6 +280,12 @@ smp_do_acpi_config(void) break; } + // skip if the apic id is too large + if (localApic->apic_id >= MAX_BOOT_CPUS) { + TRACE(("smp: apic id too large (%d)\n", localApic->apic_id)); + break; + } + gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = localApic->apic_id; gKernelArgs.arch_args.cpu_os_id[localApic->apic_id]