KVM: x86: Merge EMULTYPE_RETRY and EMULTYPE_ALLOW_REEXECUTE

retry_instruction() and reexecute_instruction() are a package deal,
i.e. there is no scenario where one is allowed and the other is not.
Merge their controlling emulation type flags to enforce this in code.
Name the combined flag EMULTYPE_ALLOW_RETRY to make it abundantly
clear that we are allowing re{try,execute} to occur, as opposed to
explicitly requesting retry of a previously failed instruction.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:
Sean Christopherson
2018-08-23 13:56:49 -07:00
committed by Radim Krčmář
parent 8065dbd1ee
commit 384bf2218e
3 changed files with 6 additions and 7 deletions

View File

@@ -5217,7 +5217,7 @@ static int make_mmu_pages_available(struct kvm_vcpu *vcpu)
int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u64 error_code,
void *insn, int insn_len)
{
int r, emulation_type = EMULTYPE_RETRY | EMULTYPE_ALLOW_REEXECUTE;
int r, emulation_type = EMULTYPE_ALLOW_RETRY;
enum emulation_result er;
bool direct = vcpu->arch.mmu.direct_map;