linux-stable/arch/x86/kvm/vmx
Sean Christopherson 18712c1370 KVM: nVMX: Use vmx_need_pf_intercept() when deciding if L0 wants a #PF
Use vmx_need_pf_intercept() when determining if L0 wants to handle a #PF
in L2 or if the VM-Exit should be forwarded to L1.  The current logic fails
to account for the case where #PF is intercepted to handle
guest.MAXPHYADDR < host.MAXPHYADDR and ends up reflecting all #PFs into
L1.  At best, L1 will complain and inject the #PF back into L2.  At
worst, L1 will eat the unexpected fault and cause L2 to hang on infinite
page faults.

Note, while the bug was technically introduced by the commit that added
support for the MAXPHYADDR madness, the shame is all on commit
a0c134347b ("KVM: VMX: introduce vmx_need_pf_intercept").

Fixes: 1dbf5d68af ("KVM: VMX: Add guest physical address check in EPT violation and misconfig")
Cc: stable@vger.kernel.org
Cc: Peter Shier <pshier@google.com>
Cc: Oliver Upton <oupton@google.com>
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210812045615.3167686-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-08-13 03:20:58 -04:00
..
capabilities.h KVM: x86: Use common 'enable_apicv' variable for both APICv and AVIC 2021-06-17 13:09:33 -04:00
evmcs.c KVM: nVMX: Use '-1' in 'hv_evmcs_vmptr' to indicate that eVMCS is not in use 2021-06-17 13:09:48 -04:00
evmcs.h KVM: nVMX: Introduce 'EVMPTR_MAP_PENDING' post-migration state 2021-06-17 13:09:49 -04:00
nested.c KVM: nVMX: Use vmx_need_pf_intercept() when deciding if L0 wants a #PF 2021-08-13 03:20:58 -04:00
nested.h KVM: nVMX: Introduce 'EVMPTR_MAP_PENDING' post-migration state 2021-06-17 13:09:49 -04:00
pmu_intel.c KVM: vmx/pmu: Fix dummy check if lbr_desc->event is created 2021-02-23 12:07:35 -05:00
posted_intr.c KVM: VMX: update vcpu posted-interrupt descriptor when assigning device 2021-05-27 07:58:23 -04:00
posted_intr.h KVM: VMX: update vcpu posted-interrupt descriptor when assigning device 2021-05-27 07:58:23 -04:00
sgx.c KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -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: Handle split-lock #AC exceptions that happen in L2 2021-06-24 04:31:16 -04:00
vmcs12.c KVM: nVMX: Add a TSC multiplier field in VMCS12 2021-06-17 13:09:28 -04:00
vmcs12.h KVM: nVMX: Dynamically compute max VMCS index for vmcs12 2021-06-21 12:58:55 -04:00
vmcs_shadow_fields.h KVM: Fix some out-dated function names in comment 2020-01-21 13:57:27 +01:00
vmenter.S KVM/nVMX: Use __vmx_vcpu_run in nested_vmx_check_vmentry_hw 2021-02-04 05:27:32 -05:00
vmx.c KVM: x86: rename apic_access_page_done to apic_access_memslot_enabled 2021-06-24 18:00:49 -04:00
vmx.h KVM: VMX: Use current VMCS to query WAITPKG support for MSR emulation 2021-08-10 13:32:09 -04:00
vmx_ops.h KVM: vmx: add mismatched size assertions in vmcs_check32() 2021-04-20 04:18:51 -04:00