summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorNadav Amit2014-06-18 16:19:23 +0200
committerPaolo Bonzini2014-06-19 12:52:14 +0200
commit5777392e83c96e3a0799dd2985598e0fc76cf4aa (patch)
treeb9b9d7ee6afe5d0e1864750b292abd2bb11fea53 /arch/x86/kvm/vmx.c
parentKVM: nVMX: Fix returned value of MSR_IA32_VMX_VMCS_ENUM (diff)
downloadkernel-qcow2-linux-5777392e83c96e3a0799dd2985598e0fc76cf4aa.tar.gz
kernel-qcow2-linux-5777392e83c96e3a0799dd2985598e0fc76cf4aa.tar.xz
kernel-qcow2-linux-5777392e83c96e3a0799dd2985598e0fc76cf4aa.zip
KVM: x86: check DR6/7 high-bits are clear only on long-mode
When the guest sets DR6 and DR7, KVM asserts the high 32-bits are clear, and otherwise injects a #GP exception. This exception should only be injected only if running in long-mode. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a717c13b9466..b362a1a38e51 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5184,7 +5184,7 @@ static int handle_dr(struct kvm_vcpu *vcpu)
return 1;
kvm_register_write(vcpu, reg, val);
} else
- if (kvm_set_dr(vcpu, dr, kvm_register_read(vcpu, reg)))
+ if (kvm_set_dr(vcpu, dr, kvm_register_readl(vcpu, reg)))
return 1;
skip_emulated_instruction(vcpu);