linux-stable/arch/x86/kvm/vmx
Sean Christopherson b67e7c61c1 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:26:00 +02:00
..
capabilities.h KVM: VMX: Remove vmcs_config.order 2022-01-26 12:14:58 -05:00
evmcs.c KVM: nVMX: Implement evmcs_field_offset() suitable for handle_vmread() 2022-01-28 07:38:26 -05:00
evmcs.h KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use 2022-01-28 07:38:26 -05:00
nested.c KVM: nVMX: Clear IDT vectoring on nested VM-Exit for double/triple fault 2022-06-09 10:26:00 +02:00
nested.h KVM: nVMX: Introduce 'EVMPTR_MAP_PENDING' post-migration state 2021-06-17 13:09:49 -04:00
pmu_intel.c KVM: x86/pmu: Update AMD PMC sample period to fix guest NMI-watchdog 2022-04-27 14:41:15 +02:00
posted_intr.c KVM: VMX: Don't do full kick when handling posted interrupt wakeup 2022-01-19 12:14:47 -05:00
posted_intr.h KVM: VMX: Handle PI descriptor updates during vcpu_put/load 2022-01-19 12:14:37 -05:00
sgx.c KVM: x86: SGX must obey the KVM_INTERNAL_ERROR_EMULATION protocol 2021-10-25 06:48:25 -04:00
sgx.h KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
vmcs.h KVM: nVMX: Clear IDT vectoring on nested VM-Exit for double/triple fault 2022-06-09 10:26:00 +02:00
vmcs12.c KVM: nVMX: Rename vmcs_to_field_offset{,_table} 2022-01-28 07:38:26 -05:00
vmcs12.h KVM: nVMX: Rename vmcs_to_field_offset{,_table} 2022-01-28 07:38:26 -05:00
vmcs_shadow_fields.h KVM: Fix some out-dated function names in comment 2020-01-21 13:57:27 +01:00
vmenter.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
vmx.c KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest 2022-06-06 08:47:53 +02:00
vmx.h KVM: nVMX: Defer APICv updates while L2 is active until L1 is active 2022-04-27 14:41:15 +02:00
vmx_ops.h RISCV: 2022-01-16 16:15:14 +02:00