diff --git a/repos/base-hw/src/bootstrap/spec/x86_64/platform.cc b/repos/base-hw/src/bootstrap/spec/x86_64/platform.cc index 902290665..fbc2553b5 100644 --- a/repos/base-hw/src/bootstrap/spec/x86_64/platform.cc +++ b/repos/base-hw/src/bootstrap/spec/x86_64/platform.cc @@ -175,7 +175,10 @@ Bootstrap::Platform::Board::Board() Hw::for_each_apic_struct(*table,[&](Hw::Apic_madt const *e){ if (e->type == Hw::Apic_madt::LAPIC) { Hw::Apic_madt::Lapic lapic(e); - cpus ++; + + /* check if APIC is enabled in hardware */ + if (lapic.valid()) + cpus ++; } }); }); @@ -190,7 +193,10 @@ Bootstrap::Platform::Board::Board() Hw::for_each_apic_struct(*table,[&](Hw::Apic_madt const *e){ if (e->type == Hw::Apic_madt::LAPIC) { Hw::Apic_madt::Lapic lapic(e); - cpus ++; + + /* check if APIC is enabled in hardware */ + if (lapic.valid()) + cpus ++; } }); }); diff --git a/repos/base-hw/src/include/hw/spec/x86_64/acpi.h b/repos/base-hw/src/include/hw/spec/x86_64/acpi.h index 5682aafa6..e1b78e732 100644 --- a/repos/base-hw/src/include/hw/spec/x86_64/acpi.h +++ b/repos/base-hw/src/include/hw/spec/x86_64/acpi.h @@ -65,9 +65,11 @@ struct Hw::Apic_madt struct Lapic : Genode::Mmio { - struct Flags : Register <0x04, 32> { enum { ENABLED = 1 }; }; + struct Flags : Register <0x04, 32> { enum { VALID = 1 }; }; Lapic(Apic_madt const * a) : Mmio(reinterpret_cast(a)) { } + + bool valid() { return read() & Flags::VALID; }; }; } __attribute__((packed));