Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197685
b: refs/heads/master
c: 2e901c4
h: refs/heads/master
i:
  197683: 376492f
v: v3
  • Loading branch information
Gleb Natapov authored and Avi Kivity committed May 17, 2010
1 parent f766e55 commit 01c8f62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e470be5a10801cb1c5c145f2cd9e0f5ebaf4f2e
refs/heads/master: 2e901c4cf4b550ad37840870246e835889cf7322
17 changes: 11 additions & 6 deletions trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,8 +1600,11 @@ emulate_syscall(struct x86_emulate_ctxt *ctxt)
u64 msr_data;

/* syscall is not available in real mode */
if (ctxt->mode == X86EMUL_MODE_REAL || ctxt->mode == X86EMUL_MODE_VM86)
return X86EMUL_UNHANDLEABLE;
if (ctxt->mode == X86EMUL_MODE_REAL ||
ctxt->mode == X86EMUL_MODE_VM86) {
kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
return X86EMUL_PROPAGATE_FAULT;
}

setup_syscalls_segments(ctxt, &cs, &ss);

Expand Down Expand Up @@ -1651,14 +1654,16 @@ emulate_sysenter(struct x86_emulate_ctxt *ctxt)
/* inject #GP if in real mode */
if (ctxt->mode == X86EMUL_MODE_REAL) {
kvm_inject_gp(ctxt->vcpu, 0);
return X86EMUL_UNHANDLEABLE;
return X86EMUL_PROPAGATE_FAULT;
}

/* XXX sysenter/sysexit have not been tested in 64bit mode.
* Therefore, we inject an #UD.
*/
if (ctxt->mode == X86EMUL_MODE_PROT64)
return X86EMUL_UNHANDLEABLE;
if (ctxt->mode == X86EMUL_MODE_PROT64) {
kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
return X86EMUL_PROPAGATE_FAULT;
}

setup_syscalls_segments(ctxt, &cs, &ss);

Expand Down Expand Up @@ -1713,7 +1718,7 @@ emulate_sysexit(struct x86_emulate_ctxt *ctxt)
if (ctxt->mode == X86EMUL_MODE_REAL ||
ctxt->mode == X86EMUL_MODE_VM86) {
kvm_inject_gp(ctxt->vcpu, 0);
return X86EMUL_UNHANDLEABLE;
return X86EMUL_PROPAGATE_FAULT;
}

setup_syscalls_segments(ctxt, &cs, &ss);
Expand Down

0 comments on commit 01c8f62

Please sign in to comment.