aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-01 05:41:59 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:33 -0400
commit3d9e77dff81c8be21ec0e7950ae06d1bddff8066 (patch)
treedd628e76545376fd794b39eed658b48edc26ab59 /arch/x86/kvm/emulate.c
parent4515453964e78ce556a98c56aeb675ed8d48b8de (diff)
KVM: x86 emulator: use SrcAcc to simplify xchg decoding
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index c7176df9ced5..b7da0e3e0cc0 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2147,7 +2147,7 @@ static struct opcode opcode_table[256] = {
2147 D(DstMem | SrcNone | ModRM | Mov), D(ModRM | DstReg), 2147 D(DstMem | SrcNone | ModRM | Mov), D(ModRM | DstReg),
2148 D(ImplicitOps | SrcMem16 | ModRM), G(0, group1A), 2148 D(ImplicitOps | SrcMem16 | ModRM), G(0, group1A),
2149 /* 0x90 - 0x97 */ 2149 /* 0x90 - 0x97 */
2150 X8(D(DstReg)), 2150 X8(D(SrcAcc | DstReg)),
2151 /* 0x98 - 0x9F */ 2151 /* 0x98 - 0x9F */
2152 N, N, D(SrcImmFAddr | No64), N, 2152 N, N, D(SrcImmFAddr | No64), N,
2153 D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N, 2153 D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N,
@@ -2932,16 +2932,9 @@ special_insn:
2932 if (rc != X86EMUL_CONTINUE) 2932 if (rc != X86EMUL_CONTINUE)
2933 goto done; 2933 goto done;
2934 break; 2934 break;
2935 case 0x90: /* nop / xchg r8,rax */ 2935 case 0x90 ... 0x97: /* nop / xchg reg, rax */
2936 if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX]) { 2936 if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX])
2937 c->dst.type = OP_NONE; /* nop */ 2937 goto done;
2938 break;
2939 }
2940 case 0x91 ... 0x97: /* xchg reg,rax */
2941 c->src.type = OP_REG;
2942 c->src.bytes = c->op_bytes;
2943 c->src.addr.reg = &c->regs[VCPU_REGS_RAX];
2944 c->src.val = *(c->src.addr.reg);
2945 goto xchg; 2938 goto xchg;
2946 case 0x9c: /* pushf */ 2939 case 0x9c: /* pushf */
2947 c->src.val = (unsigned long) ctxt->eflags; 2940 c->src.val = (unsigned long) ctxt->eflags;