From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH] x86/HVM: honor p2m_ram_ro in hvm_map_guest_frame_rw() Date: Fri, 31 Jul 2015 12:06:20 -0400 Message-ID: <55BB9CFC.5010002@oracle.com> References: <55B224660200007800095083@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZLCq2-0004Bm-Jc for xen-devel@lists.xenproject.org; Fri, 31 Jul 2015 16:07:14 +0000 In-Reply-To: <55B224660200007800095083@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Kevin Tian , Wei Liu , suravee.suthikulpanit@amd.com, Andrew Cooper , Eddie Dong , Aravind Gopalakrishnan , Jun Nakajima , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 07/24/2015 05:41 AM, Jan Beulich wrote: > > --- a/xen/arch/x86/hvm/vmx/vvmx.c > +++ b/xen/arch/x86/hvm/vmx/vvmx.c > @@ -1619,10 +1619,23 @@ int nvmx_handle_vmptrld(struct cpu_user_ > > if ( nvcpu->nv_vvmcxaddr == VMCX_EADDR ) > { > - nvcpu->nv_vvmcx = hvm_map_guest_frame_rw(gpa >> PAGE_SHIFT, 1); > - if ( nvcpu->nv_vvmcx ) > - nvcpu->nv_vvmcxaddr = gpa; > - if ( !nvcpu->nv_vvmcx || > + bool_t writable; > + void *vvmcx = hvm_map_guest_frame_rw(paddr_to_pfn(gpa), 1, &writable); > + ... > @@ -1693,14 +1703,22 @@ int nvmx_handle_vmclear(struct cpu_user_ > else > { > /* Even if this VMCS isn't the current one, we must clear it. */ > - vvmcs = hvm_map_guest_frame_rw(gpa >> PAGE_SHIFT, 0); > + bool_t writable; > + > + vvmcs = hvm_map_guest_frame_rw(gpa >> PAGE_SHIFT, 0, &writable); Since you replaced 'gpa >> PAGE_SHIFT' with 'paddr_to_pfn(gpa' above, perhaps it should be replaced here too. Other than that, Reviewed-by: Boris Ostrovsky