linux/arch/x86/kvm/vmx
Paolo Bonzini 771a579c6e Merge branch 'kvm-svm-harden' into HEAD
This fixes three issues in nested SVM:

1) in the shutdown_interception() vmexit handler we call kvm_vcpu_reset().
However, if running nested and L1 doesn't intercept shutdown, the function
resets vcpu->arch.hflags without properly leaving the nested state.
This leaves the vCPU in inconsistent state and later triggers a kernel
panic in SVM code.  The same bug can likely be triggered by sending INIT
via local apic to a vCPU which runs a nested guest.

On VMX we are lucky that the issue can't happen because VMX always
intercepts triple faults, thus triple fault in L2 will always be
redirected to L1.  Plus, handle_triple_fault() doesn't reset the vCPU.
INIT IPI can't happen on VMX either because INIT events are masked while
in VMX mode.

Secondarily, KVM doesn't honour SHUTDOWN intercept bit of L1 on SVM.
A normal hypervisor should always intercept SHUTDOWN, a unit test on
the other hand might want to not do so.

Finally, the guest can trigger a kernel non rate limited printk on SVM
from the guest, which is fixed as well.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-11-17 11:51:09 -05:00
..
capabilities.h KVM: x86: Track supported PERF_CAPABILITIES in kvm_caps 2022-11-09 12:31:11 -05:00
evmcs.c KVM: VMX: Get rid of eVMCS specific VMX controls sanitization 2022-09-26 12:02:48 -04:00
evmcs.h KVM: VMX: Get rid of eVMCS specific VMX controls sanitization 2022-09-26 12:02:48 -04:00
nested.c Merge branch 'kvm-svm-harden' into HEAD 2022-11-17 11:51:09 -05:00
nested.h KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs 2022-09-26 12:03:00 -04:00
pmu_intel.c KVM: x86/pmu: Defer counter emulated overflow via pmc->prev_counter 2022-11-09 12:31:36 -05:00
posted_intr.c KVM: nVMX: clean up posted interrupt descriptor try_cmpxchg 2022-06-24 11:45:45 -04:00
posted_intr.h KVM: VMX: enable IPI virtualization 2022-06-08 04:47:37 -04:00
run_flags.h KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS 2022-06-27 10:34:00 +02:00
sgx.c KVM: VMX: Inject #PF on ENCLS as "emulated" #PF 2022-09-26 12:03:07 -04:00
sgx.h KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
vmcs12.c KVM: nVMX: Rename vmcs_to_field_offset{,_table} 2022-01-28 07:38:26 -05:00
vmcs12.h bug: introduce ASSERT_STRUCT_OFFSET 2022-11-09 12:31:16 -05:00
vmcs_shadow_fields.h KVM: Fix some out-dated function names in comment 2020-01-21 13:57:27 +01:00
vmcs.h KVM: VMX: Detect Tertiary VM-Execution control when setup VMCS config 2022-06-08 04:47:18 -04:00
vmenter.S KVM: x86: use a separate asm-offsets.c file 2022-11-09 12:10:17 -05:00
vmx_ops.h KVM: VMX: Do not declare vmread_error() asmlinkage 2022-09-26 12:02:35 -04:00
vmx.c KVM: x86: smm: use smram structs in the common code 2022-11-09 12:31:23 -05:00
vmx.h KVM: VMX: Add missing CPU based VM execution controls to vmcs_config 2022-09-26 12:02:56 -04:00