summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-01 11:25:22 (GMT)
committerAvi Kivity <avi@redhat.com>2010-10-24 08:50:35 (GMT)
commit1a0c7d44e4553ffb4902ec15549a9b855cd05a59 (patch)
tree949024ec428f1f66365a4e4ba7f62d9448ba3501 /arch/x86
parentcecc9e39161898eb767a6b797e27a1660b3eb27e (diff)
downloadlinux-fsl-qoriq-1a0c7d44e4553ffb4902ec15549a9b855cd05a59.tar.xz
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')
-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 20752dc..562e034 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2210,8 +2210,8 @@ static struct opcode twobyte_table[256] = {
/* 0x10 - 0x1F */
N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N,
/* 0x20 - 0x2F */
- D(ModRM | ImplicitOps | Priv | Op3264), D(ModRM | Priv | Op3264),
- D(ModRM | ImplicitOps | Priv | Op3264), D(ModRM | Priv | Op3264),
+ D(ModRM | DstMem | Priv | Op3264), D(ModRM | Priv | Op3264),
+ D(ModRM | SrcMem | Priv | Op3264), D(ModRM | Priv | Op3264),
N, N, N, N,
N, N, N, N, N, N, N, N,
/* 0x30 - 0x3F */
@@ -3240,8 +3240,7 @@ twobyte_insn:
emulate_ud(ctxt);
goto done;
}
- c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu);
- c->dst.type = OP_NONE; /* no writeback */
+ c->dst.val = ops->get_cr(c->modrm_reg, ctxt->vcpu);
break;
case 0x21: /* mov from dr to reg */
if ((ops->get_cr(4, ctxt->vcpu) & X86_CR4_DE) &&
@@ -3253,7 +3252,7 @@ twobyte_insn:
c->dst.type = OP_NONE; /* no writeback */
break;
case 0x22: /* mov reg, cr */
- if (ops->set_cr(c->modrm_reg, c->modrm_val, ctxt->vcpu)) {
+ if (ops->set_cr(c->modrm_reg, c->src.val, ctxt->vcpu)) {
emulate_gp(ctxt, 0);
goto done;
}