All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <guangrong.xiao@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: VMX: use vmcs_clear/set_bits for debug register exits
Date: Fri, 26 Feb 2016 20:04:16 +0800	[thread overview]
Message-ID: <56D03F40.40200@linux.intel.com> (raw)
In-Reply-To: <1456487744-11905-1-git-send-email-pbonzini@redhat.com>



On 02/26/2016 07:55 PM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   arch/x86/kvm/vmx.c | 14 +++-----------
>   1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index aa16d5874fe6..46154dac71e6 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -5619,11 +5619,8 @@ static int handle_dr(struct kvm_vcpu *vcpu)
>   	}
>
>   	if (vcpu->guest_debug == 0) {
> -		u32 cpu_based_vm_exec_control;
> -
> -		cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> -		cpu_based_vm_exec_control &= ~CPU_BASED_MOV_DR_EXITING;
> -		vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
> +		vmcs_clear_bits(CPU_BASED_VM_EXEC_CONTROL,
> +				CPU_BASED_MOV_DR_EXITING);
>
>   		/*
>   		 * No more DR vmexits; force a reload of the debug registers
> @@ -5660,8 +5657,6 @@ static void vmx_set_dr6(struct kvm_vcpu *vcpu, unsigned long val)
>
>   static void vmx_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
>   {
> -	u32 cpu_based_vm_exec_control;
> -
>   	get_debugreg(vcpu->arch.db[0], 0);
>   	get_debugreg(vcpu->arch.db[1], 1);
>   	get_debugreg(vcpu->arch.db[2], 2);
> @@ -5670,10 +5665,7 @@ static void vmx_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
>   	vcpu->arch.dr7 = vmcs_readl(GUEST_DR7);
>
>   	vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
> -
> -	cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> -	cpu_based_vm_exec_control |= CPU_BASED_MOV_DR_EXITING;
> -	vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
> +	vmcs_set_bits(CPU_BASED_VM_EXEC_CONTROL, CPU_BASED_MOV_DR_EXITING);
>   }
>
>   static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val)
>

Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>

      reply	other threads:[~2016-02-26 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 11:55 [PATCH] KVM: VMX: use vmcs_clear/set_bits for debug register exits Paolo Bonzini
2016-02-26 12:04 ` Xiao Guangrong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D03F40.40200@linux.intel.com \
    --to=guangrong.xiao@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.