linux-stable/arch/x86
Sean Christopherson 99ace864e5 KVM: nVMX: Clear IDT vectoring on nested VM-Exit for double/triple fault
[ Upstream commit 9bd1f0efa8 ]

Clear the IDT vectoring field in vmcs12 on next VM-Exit due to a double
or triple fault.  Per the SDM, a VM-Exit isn't considered to occur during
event delivery if the exit is due to an intercepted double fault or a
triple fault.  Opportunistically move the default clearing (no event
"pending") into the helper so that it's more obvious that KVM does indeed
handle this case.

Note, the double fault case is worded rather wierdly in the SDM:

  The original event results in a double-fault exception that causes the
  VM exit directly.

Temporarily ignoring injected events, double faults can _only_ occur if
an exception occurs while attempting to deliver a different exception,
i.e. there's _always_ an original event.  And for injected double fault,
while there's no original event, injected events are never subject to
interception.

Presumably the SDM is calling out that a the vectoring info will be valid
if a different exit occurs after a double fault, e.g. if a #PF occurs and
is intercepted while vectoring #DF, then the vectoring info will show the
double fault.  In other words, the clause can simply be read as:

  The VM exit is caused by a double-fault exception.

Fixes: 4704d0befb ("KVM: nVMX: Exiting from L2 to L1")
Cc: Chenyi Qiang <chenyi.qiang@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220407002315.78092-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:23:05 +02:00
..
boot x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
configs x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs 2022-01-27 11:04:56 +01:00
crypto lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI 2022-05-30 09:28:59 +02:00
entry x86/sev: Annotate stack change in the #VC handler 2022-06-09 10:23:00 +02:00
events perf/amd/ibs: Use interrupt regs ip for stack unwinding 2022-06-09 10:22:55 +02:00
hyperv x86/hyperv: Properly deal with empty cpumasks in hyperv_flush_tlb_multi() 2022-03-08 19:12:36 +01:00
ia32 binfmt: remove in-tree usage of MAP_DENYWRITE 2021-09-03 18:42:01 +02:00
include x86/pm: Fix false positive kmemleak report in msr_build_context() 2022-06-09 10:22:51 +02:00
kernel x86/mm: Cleanup the control_va_addr_alignment() __setup handler 2022-06-09 10:22:54 +02:00
kvm KVM: nVMX: Clear IDT vectoring on nested VM-Exit for double/triple fault 2022-06-09 10:23:05 +02:00
lib x86/delay: Fix the wrong asm constraint in delay_loop() 2022-06-09 10:22:45 +02:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
mm x86: Fix return value of __setup handlers 2022-06-09 10:22:53 +02:00
net bpf: Fix extable address check. 2021-12-22 09:32:50 +01:00
pci x86/PCI: Fix ALi M1487 (IBC) PIRQ router link value interpretation 2022-06-09 10:22:46 +02:00
platform x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
power x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
purgatory kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 11:04:35 +01:00
tools - Remove cc-option checks which are old and already supported by the 2021-08-30 13:27:16 -07:00
um um: Cleanup syscall_handler_t definition/cast, fix warning 2022-05-25 09:57:24 +02:00
video
xen x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
.gitignore
Kbuild
Kconfig x86/microcode: Add explicit CPU vendor dependency 2022-06-09 10:22:39 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile x86: Add straight-line-speculation mitigation 2022-05-15 20:18:51 +02:00
Makefile.um
Makefile_32.cpu x86/build: Do not add -falign flags unconditionally for clang 2021-09-19 10:35:53 +09:00