mirror-linux/arch/x86/entry
Peter Zijlstra 5fcc48d521 x86/kvm/vmx: Fix VMX vs hrtimer_rearm_deferred()
Vishal reported that KVM unit test 'x2apic' started failing after commit
0e98eb1481 ("entry: Prepare for deferred hrtimer rearming").

The reason is that KVM/VMX is injecting interrupts while it has interrupts
disabled, for a context that will enable interrupts, this means that
regs->flags.X86_EFLAGS_IF == 0 and irqentry_exit() will not do the right
thing.

Notably, irqentry_exit() must not call hrtimer_rearm_deferred() when the return
context does not have IF set, because this will cause problems vs NMIs.

Therefore, fix up the state after the injection.

Fixes: 0e98eb1481 ("entry: Prepare for deferred hrtimer rearming")
Reported-by: "Verma, Vishal L" <vishal.l.verma@intel.com>
Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: "Verma, Vishal L" <vishal.l.verma@intel.com>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: Zhao Liu <zhao1.liu@intel.com>
Tested-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://patch.msgid.link/20260423155936.957351833@infradead.org
Closes: https://lore.kernel.org/r/70cd3e97fbb796e2eb2ff8cd4b7614ada05a5f24.camel%40intel.com
2026-05-19 20:25:51 +02:00
..
syscalls rseq: Implement sys_rseq_slice_yield() 2026-01-22 11:11:17 +01:00
vdso x86/vdso: Fix incorrect size in munmap() on map_vdso() failure 2026-05-19 16:36:34 +02:00
vsyscall x86/vsyscall: Disable LASS if vsyscall mode is set to EMULATE 2026-03-19 15:11:13 -07:00
Makefile x86/kvm/vmx: Move IRQ/NMI dispatch from KVM into x86 core 2026-05-19 20:25:51 +02:00
calling.h x86/fred: Play nice with invoking asm_fred_entry_from_kvm() on non-FRED hardware 2025-08-18 14:23:08 +02:00
common.c x86/kvm/vmx: Fix VMX vs hrtimer_rearm_deferred() 2026-05-19 20:25:51 +02:00
entry.S x86/kvm/vmx: Move IRQ/NMI dispatch from KVM into x86 core 2026-05-19 20:25:51 +02:00
entry_32.S x86/percpu: Move top_of_stack to percpu hot section 2025-03-04 20:30:33 +01:00
entry_64.S x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
entry_64_compat.S x86/percpu: Move top_of_stack to percpu hot section 2025-03-04 20:30:33 +01:00
entry_64_fred.S x86/kvm/vmx: Move IRQ/NMI dispatch from KVM into x86 core 2026-05-19 20:25:51 +02:00
entry_fred.c x86/fred: Fix early boot failures on SEV-ES/SNP guests 2026-03-23 14:18:18 +01:00
syscall_32.c randomize_kstack: Unify random source across arches 2026-03-24 21:12:03 -07:00
syscall_64.c randomize_kstack: Unify random source across arches 2026-03-24 21:12:03 -07:00
thunk.S x86/entry: Merge thunk_64.S and thunk_32.S into thunk.S 2024-04-09 09:57:56 +02:00