OpenCloudOS-Kernel/arch
Sean Christopherson 647cbf2ac6 KVM: nVMX: Request immediate exit iff pending nested event needs injection
commit 32f55e475ce2c4b8b124d335fcfaf1152ba977a1 upstream.

When requesting an immediate exit from L2 in order to inject a pending
event, do so only if the pending event actually requires manual injection,
i.e. if and only if KVM actually needs to regain control in order to
deliver the event.

Avoiding the "immediate exit" isn't simply an optimization, it's necessary
to make forward progress, as the "already expired" VMX preemption timer
trick that KVM uses to force a VM-Exit has higher priority than events
that aren't directly injected.

At present time, this is a glorified nop as all events processed by
vmx_has_nested_events() require injection, but that will not hold true in
the future, e.g. if there's a pending virtual interrupt in vmcs02.RVI.
I.e. if KVM is trying to deliver a virtual interrupt to L2, the expired
VMX preemption timer will trigger VM-Exit before the virtual interrupt is
delivered, and KVM will effectively hang the vCPU in an endless loop of
forced immediate VM-Exits (because the pending virtual interrupt never
goes away).

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240607172609.3205077-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-03 08:54:20 +02:00
..
alpha vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:32:33 +02:00
arm ARM: spitz: fix GPIO assignment for backlight 2024-08-03 08:53:34 +02:00
arm64 arm64: dts: qcom: sm6350: Add missing qcom,non-secure-domain property 2024-08-03 08:53:34 +02:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:34:02 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:34:02 +02:00
ia64 vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
loongarch LoongArch: Check TIF_LOAD_WATCH to enable user space watchpoint 2024-08-03 08:54:11 +02:00
m68k m68k: amiga: Turn off Warp1260 interrupts during boot 2024-08-03 08:54:17 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-12 11:12:23 +02:00
mips MIPS: Octeron: remove source file executable bit 2024-08-03 08:54:02 +02:00
nios2 mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
openrisc openrisc: traps: Don't send signals to kernel mode threads 2024-06-12 11:11:42 +02:00
parisc Revert "bpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()" 2024-07-09 11:44:29 +02:00
powerpc powerpc/8xx: fix size given to set_huge_pte_at() 2024-08-03 08:54:10 +02:00
riscv riscv: stacktrace: fix usage of ftrace_graph_ret_addr() 2024-07-25 09:50:55 +02:00
s390 s390/uv: Don't call folio_wait_writeback() without a folio reference 2024-08-03 08:53:48 +02:00
sh sh: rework sync_file_range ABI 2024-07-05 09:34:02 +02:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-03 08:53:55 +02:00
um ubd: untagle discard vs write zeroes not support handling 2024-08-03 08:53:20 +02:00
x86 KVM: nVMX: Request immediate exit iff pending nested event needs injection 2024-08-03 08:54:20 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:02:32 +02:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:49:15 +02:00