From: "Jan Beulich" Subject: Re: [PATCH 05/10] nested vmx: fix DR access VM exit Date: Tue, 04 Dec 2012 10:02:03 +0000 Message-ID: <50BDD82B02000078000ADA35@nat28.tlf.novell.com> References: <1354600410-3390-1-git-send-email-dongxiao.xu@intel.com> <1354600410-3390-6-git-send-email-dongxiao.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1354600410-3390-6-git-send-email-dongxiao.xu@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dongxiao Xu Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 04.12.12 at 06:53, Dongxiao Xu wrote: > For DR register, we use lazy restore mechanism when access it. Therefore > when receiving such VM exit, L0 should be responsible to switch to the > right DR values, then inject to L1 hypervisor. > > Signed-off-by: Dongxiao Xu > --- > xen/arch/x86/hvm/vmx/vvmx.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c > index cf3797c..0ac78af 100644 > --- a/xen/arch/x86/hvm/vmx/vvmx.c > +++ b/xen/arch/x86/hvm/vmx/vvmx.c > @@ -1654,7 +1654,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs, > case EXIT_REASON_DR_ACCESS: > ctrl = __n2_exec_control(v); > if ( ctrl & CPU_BASED_MOV_DR_EXITING ) > - nvcpu->nv_vmexit_pending = 1; > + if ( v->arch.hvm_vcpu.flag_dr_dirty ) > + nvcpu->nv_vmexit_pending = 1; Personally I'd prefer if you combined the two if-s. Jan > break; > case EXIT_REASON_INVLPG: > ctrl = __n2_exec_control(v); > -- > 1.7.1 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel