KVM: nVMX: Allow nested guests to run with dirty debug registers
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Feb 2014 09:36:37 +0000 (10:36 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 11 Mar 2014 09:46:03 +0000 (10:46 +0100)
When preparing the VMCS02, the CPU-based execution controls is computed
by vmx_exec_control.  Turn off DR access exits there, too, if the
KVM_DEBUGREG_WONT_EXIT bit is set in switch_db_regs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c

index a9940ec9e2155f98b8cee8b355014b5293e3c9bc..f4e5aeda5edf4091a154ec1f1db9605da00e3414 100644 (file)
@@ -4242,6 +4242,10 @@ static u32 vmx_pin_based_exec_ctrl(struct vcpu_vmx *vmx)
 static u32 vmx_exec_control(struct vcpu_vmx *vmx)
 {
        u32 exec_control = vmcs_config.cpu_based_exec_ctrl;
+
+       if (vmx->vcpu.arch.switch_db_regs & KVM_DEBUGREG_WONT_EXIT)
+               exec_control &= ~CPU_BASED_MOV_DR_EXITING;
+
        if (!vm_need_tpr_shadow(vmx->vcpu.kvm)) {
                exec_control &= ~CPU_BASED_TPR_SHADOW;
 #ifdef CONFIG_X86_64