qemu/hw/i386
Bernhard Beschow c2e6d7d8e7 hw/i386/x86: Fix PIC interrupt handling if APIC is globally disabled
QEMU populates the apic_state attribute of x86 CPUs if supported by real
hardware or if SMP is active. When handling interrupts, it just checks whether
apic_state is populated to route the interrupt to the PIC or to the APIC.
However, chapter 10.4.3 of [1] requires that:

  When IA32_APIC_BASE[11] is 0, the processor is functionally equivalent to an
  IA-32 processor without an on-chip APIC.

This means that when apic_state is populated, QEMU needs to check for the
MSR_IA32_APICBASE_ENABLE flag in addition. Implement this which fixes some
real-world BIOSes.

[1] Intel 64 and IA-32 Architectures Software Developer's Manual, Vol. 3A:
    System Programming Guide, Part 1

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-Id: <20240106132546.21248-3-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2024-02-14 06:09:32 -05:00
..
kvm apic, i386/tcg: add x2apic transitions 2024-02-14 06:09:32 -05:00
xen apic, i386/tcg: add x2apic transitions 2024-02-14 06:09:32 -05:00
acpi-build.c amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
acpi-build.h
acpi-common.c hw/i386/acpi-build: Use pc_madt_cpu_entry() directly 2023-10-04 18:15:05 -04:00
acpi-common.h hw/i386/acpi-build: Use pc_madt_cpu_entry() directly 2023-10-04 18:15:05 -04:00
acpi-microvm.c hw/i386/acpi-microvm.c: Use common function to add virtio in DSDT 2024-01-10 18:47:46 +10:00
acpi-microvm.h
amd_iommu-stub.c amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
amd_iommu.c amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
amd_iommu.h amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
e820_memory_layout.c
e820_memory_layout.h
fw_cfg.c hw/i386/fw_cfg: Include missing 'cpu.h' header 2023-09-07 13:32:37 +02:00
fw_cfg.h
intel_iommu_internal.h intel-iommu: Report interrupt remapping faults, fix return value 2023-10-22 05:18:17 -04:00
intel_iommu.c intel_iommu: allow Extended Interrupt Mode when using userspace APIC 2024-02-14 06:09:32 -05:00
Kconfig hw/i386: Activate IOMMUFD for q35 machines 2023-12-19 19:03:38 +01:00
kvmvapic.c hw/i386: Constify VMState 2023-12-29 11:17:30 +11:00
meson.build amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
microvm-dt.c
microvm-dt.h
microvm.c hw/acpi: Realize ACPI_GED sysbus device before accessing it 2023-10-19 23:13:28 +02:00
multiboot.c
multiboot.h
pc_piix.c hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs 2024-02-02 16:23:47 +00:00
pc_q35.c hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs 2024-02-02 16:23:47 +00:00
pc_sysfw_ovmf-stubs.c
pc_sysfw_ovmf.c
pc_sysfw.c
pc.c hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs 2024-02-02 16:23:47 +00:00
port92.c hw/i386: Constify VMState 2023-12-29 11:17:30 +11:00
sgx-epc.c
sgx-stub.c target/i386: the sgx_epc_get_section stub is reachable 2023-12-31 09:11:27 +01:00
sgx.c *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
trace-events vmmouse: replace DPRINTF with tracing 2023-09-12 10:37:01 +04:00
trace.h
vmmouse.c hw/i386: Constify VMState 2023-12-29 11:17:30 +11:00
vmport.c
x86-iommu-stub.c
x86-iommu.c hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message() 2023-08-03 16:16:17 -04:00
x86.c hw/i386/x86: Fix PIC interrupt handling if APIC is globally disabled 2024-02-14 06:09:32 -05:00