linux-stable/arch/x86
Sean Christopherson 89414cc52a KVM: x86: Always sync PIR to IRR prior to scanning I/O APIC routes
commit f3ced000a2 upstream.

Sync pending posted interrupts to the IRR prior to re-scanning I/O APIC
routes, irrespective of whether the I/O APIC is emulated by userspace or
by KVM.  If a level-triggered interrupt routed through the I/O APIC is
pending or in-service for a vCPU, KVM needs to intercept EOIs on said
vCPU even if the vCPU isn't the destination for the new routing, e.g. if
servicing an interrupt using the old routing races with I/O APIC
reconfiguration.

Commit fceb3a36c2 ("KVM: x86: ioapic: Fix level-triggered EOI and
userspace I/OAPIC reconfigure race") fixed the common cases, but
kvm_apic_pending_eoi() only checks if an interrupt is in the local
APIC's IRR or ISR, i.e. misses the uncommon case where an interrupt is
pending in the PIR.

Failure to intercept EOI can manifest as guest hangs with Windows 11 if
the guest uses the RTC as its timekeeping source, e.g. if the VMM doesn't
expose a more modern form of time to the guest.

Cc: stable@vger.kernel.org
Cc: Adamos Ttofari <attofari@amazon.de>
Cc: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240611014845.82795-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-27 13:52:27 +02:00
..
boot x86/boot: Don't add the EFI stub to targets, again 2024-06-21 14:40:27 +02:00
coco x86/cc: Add cc_platform_set/_clear() helpers 2024-04-04 10:40:27 +02:00
configs x86/config: Fix warning for 'make ARCH=x86_64 tinyconfig' 2024-03-21 10:09:41 +01:00
crypto crypto: x86/sha512-avx2 - add missing vzeroupper 2024-05-30 09:44:05 +02:00
entry x86/mm: Remove broken vsyscall emulation code from the page fault code 2024-05-01 09:41:43 +02:00
events * Clean up SVM's enter/exit assembly code so that it can be compiled 2024-04-20 11:10:51 -07:00
hyperv hyperv-fixes for v6.9-rc4 2024-04-11 16:23:56 -07:00
ia32
include x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking 2024-06-21 14:40:23 +02:00
kernel x86/resctrl: Don't try to free nonexistent RMIDs 2024-06-27 13:52:25 +02:00
kvm KVM: x86: Always sync PIR to IRR prior to scanning I/O APIC routes 2024-06-27 13:52:27 +02:00
lib x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking 2024-06-21 14:40:23 +02:00
math-emu
mm x86/mm/numa: Use NUMA_NO_NODE when calling memblock_set_node() 2024-06-21 14:40:29 +02:00
net bpf, x86: Fix PROBE_MEM runtime load check 2024-04-26 09:45:18 -07:00
pci x86/pci: Skip early E820 check for ECAM region 2024-06-12 11:39:58 +02:00
platform xen: branch for v6.9-rc1 2024-03-19 08:48:09 -07:00
power - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
purgatory x86/purgatory: Switch to the position-independent small code model 2024-05-30 09:44:23 +02:00
ras
realmode x86/trampoline: Bypass compat mode in trampoline_start64() if not needed 2024-02-23 08:40:29 -08:00
tools x86/boot: Ignore relocations in .notes sections in walk_relocs() too 2024-05-30 09:44:11 +02:00
um um: Fix the -Wmissing-prototypes warning for get_thread_reg 2024-06-12 11:39:32 +02:00
video
virt x86/sev: Add callback to apply RMP table fixups for kexec 2024-04-29 11:21:09 +02:00
xen xen/x86: add extra pages to unpopulated-alloc if available 2024-06-12 11:39:37 +02:00
.gitignore
Kbuild x86/build: Use obj-y to descend into arch/x86/virt/ 2024-03-30 10:41:49 +01:00
Kconfig x86/fred: Fix typo in Kconfig description 2024-05-30 09:44:12 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y 2024-06-12 11:39:38 +02:00
Makefile x86/build: Use obj-y to descend into arch/x86/virt/ 2024-03-30 10:41:49 +01:00
Makefile.postlink
Makefile.um
Makefile_32.cpu