summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorPaolo Bonzini2016-11-28 14:39:58 +0100
committerPaolo Bonzini2017-08-10 16:44:04 +0200
commiteebed2438923f8df465c27f8fa41303771fdb2e8 (patch)
treea767edc12e331314c03493ef5172248334350f71 /arch/x86/kvm/mmu.c
parentKVM: SVM: Limit PFERR_NESTED_GUEST_PAGE error_code check to L1 guest (diff)
downloadkernel-qcow2-linux-eebed2438923f8df465c27f8fa41303771fdb2e8.tar.gz
kernel-qcow2-linux-eebed2438923f8df465c27f8fa41303771fdb2e8.tar.xz
kernel-qcow2-linux-eebed2438923f8df465c27f8fa41303771fdb2e8.zip
kvm: nVMX: Add support for fast unprotection of nested guest page tables
This is the same as commit 147277540bbc ("kvm: svm: Add support for additional SVM NPF error codes", 2016-11-23), but for Intel processors. In this case, the exit qualification field's bit 8 says whether the EPT violation occurred while translating the guest's final physical address or rather while translating the guest page tables. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 454d81dc8913..7ee21c087c83 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4836,12 +4836,9 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u64 error_code,
* This can occur when using nested virtualization with nested
* paging in both guests. If true, we simply unprotect the page
* and resume the guest.
- *
- * Note: AMD only (since it supports the PFERR_GUEST_PAGE_MASK used
- * in PFERR_NEXT_GUEST_PAGE)
*/
if (vcpu->arch.mmu.direct_map &&
- error_code == PFERR_NESTED_GUEST_PAGE) {
+ (error_code & PFERR_NESTED_GUEST_PAGE) == PFERR_NESTED_GUEST_PAGE) {
kvm_mmu_unprotect_page(vcpu->kvm, gpa_to_gfn(cr2));
return 1;
}