aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-01 07:25:22 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:35 -0400
commit1a0c7d44e4553ffb4902ec15549a9b855cd05a59 (patch)
tree949024ec428f1f66365a4e4ba7f62d9448ba3501 /arch/x86/kvm
parentcecc9e39161898eb767a6b797e27a1660b3eb27e (diff)
KVM: x86 emulator: use struct operand for mov reg,cr and mov cr,reg for reg op
This is an ordinary modrm source or destination; use the standard structure representing it. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 20752dc84f10..562e0343e2a3 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2210,8 +2210,8 @@ static struct opcode twobyte_table[256] = {
2210 /* 0x10 - 0x1F */ 2210 /* 0x10 - 0x1F */
2211 N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N, 2211 N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N,
2212 /* 0x20 - 0x2F */ 2212 /* 0x20 - 0x2F */
2213 D(ModRM | ImplicitOps | Priv | Op3264), D(ModRM | Priv | Op3264), 2213 D(ModRM | DstMem | Priv | Op3264), D(ModRM | Priv | Op3264),
2214 D(ModRM | ImplicitOps | Priv | Op3264), D(ModRM | Priv | Op3264), 2214 D(ModRM | SrcMem | Priv | Op3264), D(ModRM | Priv | Op3264),
2215 N, N, N, N, 2215 N, N, N, N,
2216 N, N, N, N, N, N, N, N, 2216 N, N, N, N, N, N, N, N,
2217 /* 0x30 - 0x3F */ 2217 /* 0x30 - 0x3F */
@@ -3240,8 +3240,7 @@ twobyte_insn:
3240 emulate_ud(ctxt); 3240 emulate_ud(ctxt);
3241 goto done; 3241 goto done;
3242 } 3242 }
3243 c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu); 3243 c->dst.val = ops->get_cr(c->modrm_reg, ctxt->vcpu);
3244 c->dst.type = OP_NONE; /* no writeback */
3245 break; 3244 break;
3246 case 0x21: /* mov from dr to reg */ 3245 case 0x21: /* mov from dr to reg */
3247 if ((ops->get_cr(4, ctxt->vcpu) & X86_CR4_DE) && 3246 if ((ops->get_cr(4, ctxt->vcpu) & X86_CR4_DE) &&
@@ -3253,7 +3252,7 @@ twobyte_insn:
3253 c->dst.type = OP_NONE; /* no writeback */ 3252 c->dst.type = OP_NONE; /* no writeback */
3254 break; 3253 break;
3255 case 0x22: /* mov reg, cr */ 3254 case 0x22: /* mov reg, cr */
3256 if (ops->set_cr(c->modrm_reg, c->modrm_val, ctxt->vcpu)) { 3255 if (ops->set_cr(c->modrm_reg, c->src.val, ctxt->vcpu)) {
3257 emulate_gp(ctxt, 0); 3256 emulate_gp(ctxt, 0);
3258 goto done; 3257 goto done;
3259 } 3258 }