x86_64: acpi: report presence of 8259 PICs

KVM's irqchip emulation provides the traditional PC-style pair of 8259
PICs, so report this by setting the appropriate flag in the MADT (APIC)
table.

BUG=b:207551552
TEST=Boot crosvm with setup_mptable() call removed

Change-Id: Ib5adf7ac717156deb3cd19d74873c9745ae826ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3313840
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
This commit is contained in:
Daniel Verkamp 2021-12-02 13:39:07 -08:00 committed by Commit Bot
parent 5ceeda7964
commit 0708961098

View file

@ -103,6 +103,9 @@ const MADT_LEN: u32 = 44;
const MADT_REVISION: u8 = 5; const MADT_REVISION: u8 = 5;
// MADT fields offset // MADT fields offset
const MADT_FIELD_LAPIC_ADDR: usize = 36; const MADT_FIELD_LAPIC_ADDR: usize = 36;
const MADT_FIELD_FLAGS: usize = 40;
// MADT flags
const MADT_FLAG_PCAT_COMPAT: u32 = 1 << 0;
// MADT structure offsets // MADT structure offsets
const MADT_STRUCTURE_TYPE: usize = 0; const MADT_STRUCTURE_TYPE: usize = 0;
const MADT_STRUCTURE_LEN: usize = 1; const MADT_STRUCTURE_LEN: usize = 1;
@ -379,6 +382,9 @@ pub fn create_acpi_tables(
MADT_FIELD_LAPIC_ADDR, MADT_FIELD_LAPIC_ADDR,
super::mptable::APIC_DEFAULT_PHYS_BASE as u32, super::mptable::APIC_DEFAULT_PHYS_BASE as u32,
); );
// Our IrqChip implementations (the KVM in-kernel irqchip and the split irqchip) expose a pair
// of PC-compatible 8259 PICs.
madt.write(MADT_FIELD_FLAGS, MADT_FLAG_PCAT_COMPAT);
match host_cpus { match host_cpus {
Some(VcpuAffinity::PerVcpu(cpus)) => { Some(VcpuAffinity::PerVcpu(cpus)) => {