diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-08-11 18:36:43 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-10-12 14:01:55 +0200 |
commit | d0006530576f1c7a49b2010eac7afdcb5a3613ae (patch) | |
tree | 58eb32edc47951d19b07bc854890beeba7bb3b36 /arch/x86/kvm/mmu.c | |
parent | 1cf53587c03025885af359da3bd0be091aa34b53 (diff) | |
download | lwn-d0006530576f1c7a49b2010eac7afdcb5a3613ae.tar.gz lwn-d0006530576f1c7a49b2010eac7afdcb5a3613ae.zip |
KVM: SVM: limit kvm_handle_page_fault to #PF handling
It has always annoyed me a bit how SVM_EXIT_NPF is handled by
pf_interception. This is also the only reason behind the
under-documented need_unprotect argument to kvm_handle_page_fault.
Let NPF go straight to kvm_mmu_page_fault, just like VMX
does in handle_ept_violation and handle_ept_misconfig.
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d7a7eafc5ade..e4fb82c0a5d0 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3820,8 +3820,7 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn, } int kvm_handle_page_fault(struct kvm_vcpu *vcpu, u64 error_code, - u64 fault_address, char *insn, int insn_len, - bool need_unprotect) + u64 fault_address, char *insn, int insn_len) { int r = 1; @@ -3829,7 +3828,7 @@ int kvm_handle_page_fault(struct kvm_vcpu *vcpu, u64 error_code, default: trace_kvm_page_fault(fault_address, error_code); - if (need_unprotect && kvm_event_needs_reinjection(vcpu)) + if (kvm_event_needs_reinjection(vcpu)) kvm_mmu_unprotect_page_virt(vcpu, fault_address); r = kvm_mmu_page_fault(vcpu, fault_address, error_code, insn, insn_len); |