Skip to content

Commit

Permalink
KVM: x86/mmu: Invert RET_PF_* check when falling through to emulation
Browse files Browse the repository at this point in the history
Explicitly check for RET_PF_EMULATE instead of implicitly doing the same
by checking for !RET_PF_RETRY (RET_PF_INVALID is handled earlier).  This
will adding new RET_PF_ types in future patches without breaking the
emulation path.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923220425.18402-3-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Sean Christopherson authored and Paolo Bonzini committed Sep 28, 2020
1 parent 7b367bc commit 83a2ba4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/mmu/mmu.c
Original file line number Diff line number Diff line change
@@ -5466,10 +5466,10 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 error_code,
return -EIO;
}

if (r == RET_PF_RETRY)
return 1;
if (r < 0)
return r;
if (r != RET_PF_EMULATE)
return 1;

/*
* Before emulating the instruction, check if the error code

0 comments on commit 83a2ba4

Please sign in to comment.