diff options
| author | Sean Christopherson <[email protected]> | 2020-09-23 15:04:23 -0700 |
|---|---|---|
| committer | Paolo Bonzini <[email protected]> | 2020-09-28 07:57:36 -0400 |
| commit | 83a2ba4cb2b596e5e89faa4e29b1d1f3b245b95e (patch) | |
| tree | 3820270e129098cd209844a5fc5b08a1b2f7548d | |
| parent | 7b367bc9a6415dc6f31135d50ab37e8ee18d6974 (diff) | |
KVM: x86/mmu: Invert RET_PF_* check when falling through to emulation
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 <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| -rw-r--r-- | arch/x86/kvm/mmu/mmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 68c0a1a374cf..0831e88fb227 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -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 |