aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-04-28 12:15:27 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:35:30 -0400
commit35aa5375d407ecadcc3adb5cb31d27044bf7f29f (patch)
tree62fb6202f9da42f6f987c754838e8c568e11b6e8 /arch/x86/kvm/x86.c
parent414e6277fd148f6470261cef50a7fed0d88a2825 (diff)
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/x86.c')
-rw-r--r--arch/x86/kvm/x86.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 801afc6461ed..059d63de169b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3620,16 +3620,14 @@ int emulate_clts(struct kvm_vcpu *vcpu)
3620 return X86EMUL_CONTINUE; 3620 return X86EMUL_CONTINUE;
3621} 3621}
3622 3622
3623int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long *dest) 3623int emulator_get_dr(int dr, unsigned long *dest, struct kvm_vcpu *vcpu)
3624{ 3624{
3625 return kvm_get_dr(ctxt->vcpu, dr, dest); 3625 return kvm_get_dr(vcpu, dr, dest);
3626} 3626}
3627 3627
3628int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long value) 3628int emulator_set_dr(int dr, unsigned long value, struct kvm_vcpu *vcpu)
3629{ 3629{
3630 unsigned long mask = (ctxt->mode == X86EMUL_MODE_PROT64) ? ~0ULL : ~0U; 3630 return kvm_set_dr(vcpu, dr, value);
3631
3632 return kvm_set_dr(ctxt->vcpu, dr, value & mask);
3633} 3631}
3634 3632
3635void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context) 3633void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context)
@@ -3811,6 +3809,8 @@ static struct x86_emulate_ops emulate_ops = {
3811 .set_cr = emulator_set_cr, 3809 .set_cr = emulator_set_cr,
3812 .cpl = emulator_get_cpl, 3810 .cpl = emulator_get_cpl,
3813 .set_rflags = emulator_set_rflags, 3811 .set_rflags = emulator_set_rflags,
3812 .get_dr = emulator_get_dr,
3813 .set_dr = emulator_set_dr,
3814}; 3814};
3815 3815
3816static void cache_all_regs(struct kvm_vcpu *vcpu) 3816static void cache_all_regs(struct kvm_vcpu *vcpu)