aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/kvm_host.h7
-rw-r--r--arch/x86/kvm/mmu.c2
-rw-r--r--arch/x86/kvm/x86.c4
3 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index a69ea11f3bab..35e03b13edcb 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1237,10 +1237,9 @@ enum emulation_result {
1237#define EMULTYPE_NO_DECODE (1 << 0) 1237#define EMULTYPE_NO_DECODE (1 << 0)
1238#define EMULTYPE_TRAP_UD (1 << 1) 1238#define EMULTYPE_TRAP_UD (1 << 1)
1239#define EMULTYPE_SKIP (1 << 2) 1239#define EMULTYPE_SKIP (1 << 2)
1240#define EMULTYPE_RETRY (1 << 3) 1240#define EMULTYPE_ALLOW_RETRY (1 << 3)
1241#define EMULTYPE_ALLOW_REEXECUTE (1 << 4) 1241#define EMULTYPE_NO_UD_ON_FAIL (1 << 4)
1242#define EMULTYPE_NO_UD_ON_FAIL (1 << 5) 1242#define EMULTYPE_VMWARE (1 << 5)
1243#define EMULTYPE_VMWARE (1 << 6)
1244int x86_emulate_instruction(struct kvm_vcpu *vcpu, unsigned long cr2, 1243int x86_emulate_instruction(struct kvm_vcpu *vcpu, unsigned long cr2,
1245 int emulation_type, void *insn, int insn_len); 1244 int emulation_type, void *insn, int insn_len);
1246 1245
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 4508c34eef20..0246a1ea7f55 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -5217,7 +5217,7 @@ static int make_mmu_pages_available(struct kvm_vcpu *vcpu)
5217int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u64 error_code, 5217int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u64 error_code,
5218 void *insn, int insn_len) 5218 void *insn, int insn_len)
5219{ 5219{
5220 int r, emulation_type = EMULTYPE_RETRY | EMULTYPE_ALLOW_REEXECUTE; 5220 int r, emulation_type = EMULTYPE_ALLOW_RETRY;
5221 enum emulation_result er; 5221 enum emulation_result er;
5222 bool direct = vcpu->arch.mmu.direct_map; 5222 bool direct = vcpu->arch.mmu.direct_map;
5223 5223
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d6f85ea23101..924ce28723c4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5870,7 +5870,7 @@ static bool reexecute_instruction(struct kvm_vcpu *vcpu, gva_t cr2,
5870 gpa_t gpa = cr2; 5870 gpa_t gpa = cr2;
5871 kvm_pfn_t pfn; 5871 kvm_pfn_t pfn;
5872 5872
5873 if (!(emulation_type & EMULTYPE_ALLOW_REEXECUTE)) 5873 if (!(emulation_type & EMULTYPE_ALLOW_RETRY))
5874 return false; 5874 return false;
5875 5875
5876 if (!vcpu->arch.mmu.direct_map) { 5876 if (!vcpu->arch.mmu.direct_map) {
@@ -5958,7 +5958,7 @@ static bool retry_instruction(struct x86_emulate_ctxt *ctxt,
5958 */ 5958 */
5959 vcpu->arch.last_retry_eip = vcpu->arch.last_retry_addr = 0; 5959 vcpu->arch.last_retry_eip = vcpu->arch.last_retry_addr = 0;
5960 5960
5961 if (!(emulation_type & EMULTYPE_RETRY)) 5961 if (!(emulation_type & EMULTYPE_ALLOW_RETRY))
5962 return false; 5962 return false;
5963 5963
5964 if (x86_page_table_writing_insn(ctxt)) 5964 if (x86_page_table_writing_insn(ctxt))