summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-09-03 15:24:27 +0300
committerAvi Kivity <avi@redhat.com>2012-09-06 18:07:01 +0300
commit9d1b39a967871b7c69025dba7b7bdaee42871021 (patch)
treef3c163ddc441849b0dd350db2b7e1c1e32e75e45 /arch/x86/kvm
parent716d51abff06f48425cef15d78ca6f36093f6dbf (diff)
downloadop-kernel-dev-9d1b39a967871b7c69025dba7b7bdaee42871021.zip
op-kernel-dev-9d1b39a967871b7c69025dba7b7bdaee42871021.tar.gz
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')
-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 663e958..5fe06a8 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)
if (msr_data == 0x0)
return emulate_gp(ctxt, 0);
break;
+ default:
+ break;
}
ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF);
@@ -4400,7 +4402,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
}
/* Instruction can only be executed in protected mode */
- if ((ctxt->d & Prot) && !(ctxt->mode & X86EMUL_MODE_PROT)) {
+ if ((ctxt->d & Prot) && ctxt->mode < X86EMUL_MODE_PROT16) {
rc = emulate_ud(ctxt);
goto done;
}
OpenPOWER on IntegriCloud