aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2014-01-04 12:47:16 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2014-01-17 04:22:10 -0500
commit73aaf249ee2287b4686ff079dcbdbbb658156e64 (patch)
tree6b32cc40f12e7a91827b77e5648e7bcff1e4efd6 /arch/x86/kvm/vmx.c
parent9926c9fdbdd54bb229fe6fdbd15ca3af2b8425ae (diff)
KVM: SVM: Fix reading of DR6
In contrast to VMX, SVM dose not automatically transfer DR6 into the VCPU's arch.dr6. So if we face a DR6 read, we must consult a new vendor hook to obtain the current value. And as SVM now picks the DR6 state from its VMCB, we also need a set callback in order to write updates of DR6 back. Fixes a regression of 020df0794f. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 7661eb171936..79b360e4fed1 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5149,6 +5149,15 @@ static int handle_dr(struct kvm_vcpu *vcpu)
5149 return 1; 5149 return 1;
5150} 5150}
5151 5151
5152static u64 vmx_get_dr6(struct kvm_vcpu *vcpu)
5153{
5154 return vcpu->arch.dr6;
5155}
5156
5157static void vmx_set_dr6(struct kvm_vcpu *vcpu, unsigned long val)
5158{
5159}
5160
5152static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val) 5161static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val)
5153{ 5162{
5154 vmcs_writel(GUEST_DR7, val); 5163 vmcs_writel(GUEST_DR7, val);
@@ -8556,6 +8565,8 @@ static struct kvm_x86_ops vmx_x86_ops = {
8556 .set_idt = vmx_set_idt, 8565 .set_idt = vmx_set_idt,
8557 .get_gdt = vmx_get_gdt, 8566 .get_gdt = vmx_get_gdt,
8558 .set_gdt = vmx_set_gdt, 8567 .set_gdt = vmx_set_gdt,
8568 .get_dr6 = vmx_get_dr6,
8569 .set_dr6 = vmx_set_dr6,
8559 .set_dr7 = vmx_set_dr7, 8570 .set_dr7 = vmx_set_dr7,
8560 .cache_reg = vmx_cache_reg, 8571 .cache_reg = vmx_cache_reg,
8561 .get_rflags = vmx_get_rflags, 8572 .get_rflags = vmx_get_rflags,