linux-stable/arch
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
..
alpha
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-04-16 10:45:57 -07:00
arm arm: dts: imx53-qsb-hdmi: Disable panel instead of deleting node 2024-06-27 13:52:25 +02:00
arm64 KVM: arm64: Disassociate vcpus from redistributor region on teardown 2024-06-27 13:52:27 +02:00
csky kprobe/ftrace: bail out if ftrace was killed 2024-06-27 13:52:17 +02:00
hexagon
loongarch LoongArch: Fix multiple hardware watchpoint issues 2024-06-27 13:52:27 +02:00
m68k m68k: Move ARCH_HAS_CPU_CACHE_ALIASING 2024-05-30 09:44:34 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-12 11:39:14 +02:00
mips mips: bmips: BCM6358: make sure CBR is correctly set 2024-06-27 13:52:19 +02:00
nios2
openrisc openrisc: traps: Don't send signals to kernel mode threads 2024-05-30 09:44:21 +02:00
parisc kprobe/ftrace: bail out if ftrace was killed 2024-06-27 13:52:17 +02:00
powerpc powerpc/crypto: Add generated P8 asm to .gitignore 2024-06-27 13:52:23 +02:00
riscv kprobe/ftrace: bail out if ftrace was killed 2024-06-27 13:52:17 +02:00
s390 kprobe/ftrace: bail out if ftrace was killed 2024-06-27 13:52:17 +02:00
sh Revert "sh: Handle calling csum_partial with misaligned data" 2024-05-30 09:44:29 +02:00
sparc sparc: move struct termio to asm/termios.h 2024-06-16 13:51:10 +02:00
um um: Fix the declaration of kasan_map_memory 2024-06-12 11:39:32 +02:00
x86 KVM: x86: Always sync PIR to IRR prior to scanning I/O APIC routes 2024-06-27 13:52:27 +02:00
xtensa Xtensa fixes for v6.9: 2024-05-02 10:41:28 -07:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-04-25 15:47:35 +02:00