summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorGleb Natapov2010-04-28 18:15:27 +0200
committerAvi Kivity2010-08-01 09:35:30 +0200
commit35aa5375d407ecadcc3adb5cb31d27044bf7f29f (patch)
tree62fb6202f9da42f6f987c754838e8c568e11b6e8 /arch/x86/kvm/emulate.c
parentKVM: x86 emulator: handle "far address" source operand (diff)
downloadkernel-qcow2-linux-35aa5375d407ecadcc3adb5cb31d27044bf7f29f.tar.gz
kernel-qcow2-linux-35aa5375d407ecadcc3adb5cb31d27044bf7f29f.tar.xz
kernel-qcow2-linux-35aa5375d407ecadcc3adb5cb31d27044bf7f29f.zip
KVM: x86 emulator: add (set|get)_dr callbacks to x86_emulate_ops
Add (set|get)_dr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 687ea0906b79..8a4aa73ff1e4 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3132,7 +3132,7 @@ twobyte_insn:
kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
goto done;
}
- emulator_get_dr(ctxt, c->modrm_reg, &c->regs[c->modrm_rm]);
+ ops->get_dr(c->modrm_reg, &c->regs[c->modrm_rm], ctxt->vcpu);
c->dst.type = OP_NONE; /* no writeback */
break;
case 0x22: /* mov reg, cr */
@@ -3145,7 +3145,10 @@ twobyte_insn:
kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
goto done;
}
- emulator_set_dr(ctxt, c->modrm_reg, c->regs[c->modrm_rm]);
+
+ ops->set_dr(c->modrm_reg,c->regs[c->modrm_rm] &
+ ((ctxt->mode == X86EMUL_MODE_PROT64) ? ~0ULL : ~0U),
+ ctxt->vcpu);
c->dst.type = OP_NONE; /* no writeback */
break;
case 0x30: