aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-09-03 08:24:27 -0400
committerAvi Kivity <avi@redhat.com>2012-09-06 11:07:01 -0400
commit9d1b39a967871b7c69025dba7b7bdaee42871021 (patch)
treef3c163ddc441849b0dd350db2b7e1c1e32e75e45 /arch/x86/kvm/emulate.c
parent716d51abff06f48425cef15d78ca6f36093f6dbf (diff)
KVM: emulator: make x86 emulation modes enum instead of defines
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 663e95881bdb..5fe06a8fbebc 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2268,6 +2268,8 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt)
2268 if (msr_data == 0x0) 2268 if (msr_data == 0x0)
2269 return emulate_gp(ctxt, 0); 2269 return emulate_gp(ctxt, 0);
2270 break; 2270 break;
2271 default:
2272 break;
2271 } 2273 }
2272 2274
2273 ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF); 2275 ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF);
@@ -4400,7 +4402,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
4400 } 4402 }
4401 4403
4402 /* Instruction can only be executed in protected mode */ 4404 /* Instruction can only be executed in protected mode */
4403 if ((ctxt->d & Prot) && !(ctxt->mode & X86EMUL_MODE_PROT)) { 4405 if ((ctxt->d & Prot) && ctxt->mode < X86EMUL_MODE_PROT16) {
4404 rc = emulate_ud(ctxt); 4406 rc = emulate_ud(ctxt);
4405 goto done; 4407 goto done;
4406 } 4408 }