Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215654
b: refs/heads/master
c: 4fc40f0
h: refs/heads/master
v: v3
  • Loading branch information
Gleb Natapov authored and Avi Kivity committed Oct 24, 2010
1 parent d932c8c commit 57aef51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9928ff608b1b6ba10fafde85f57970a83a181331
refs/heads/master: 4fc40f076f4fa289dd546990b597351c9cdad985
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/kvm_emulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ struct x86_emulate_ctxt {
int interruptibility;

bool restart; /* restart string instruction after writeback */
bool perm_ok; /* do not check permissions if true */

int exception; /* exception that happens during emulation or -1 */
u32 error_code; /* error code for exception */
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,9 +1621,15 @@ static bool emulator_io_permited(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops,
u16 port, u16 len)
{
if (ctxt->perm_ok)
return true;

if (emulator_bad_iopl(ctxt, ops))
if (!emulator_io_port_access_allowed(ctxt, ops, port, len))
return false;

ctxt->perm_ok = true;

return true;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -3997,6 +3997,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
memcpy(c->regs, vcpu->arch.regs, sizeof c->regs);
vcpu->arch.emulate_ctxt.interruptibility = 0;
vcpu->arch.emulate_ctxt.exception = -1;
vcpu->arch.emulate_ctxt.perm_ok = false;

r = x86_decode_insn(&vcpu->arch.emulate_ctxt);
trace_kvm_emulate_insn_start(vcpu);
Expand Down

0 comments on commit 57aef51

Please sign in to comment.