WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH 07 of 20] Emulation of guest vmptrld

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH 07 of 20] Emulation of guest vmptrld
From: "Dong, Eddie" <eddie.dong@xxxxxxxxx>
Date: Fri, 3 Jun 2011 14:07:40 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Dong, Eddie" <eddie.dong@xxxxxxxxx>
Delivery-date: Thu, 02 Jun 2011 23:08:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110602144553.GJ5098@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1307005033@xxxxxxxxxxxxxxxxxxxx> <4dad232d7fc3bd62979a.1307005040@xxxxxxxxxxxxxxxxxxxx> <20110602144553.GJ5098@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwhM85dSOn9eyC0T4mtHliBGtJMxwAf1Wvw
Thread-topic: [Xen-devel] [PATCH 07 of 20] Emulation of guest vmptrld
> > +    if ( vmcs_reg == IO_BITMAP_A )
> > +    {
> > +        if (nvmx->iobitmap[0]) {
> > +            unmap_domain_page_global(nvmx->iobitmap[0]);
> > +        }
> > +        gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
> IO_BITMAP_A);
> > +        mfn = mfn_x(gfn_to_mfn(p2m_get_hostp2m(v->domain),
> > +                              gpa >> PAGE_SHIFT, &p2mt));
> > +        nvmx->iobitmap[0] = map_domain_page_global(mfn);
> 
> Why are these maps _global?  It might be OK to use 2 more global
> mappings per VCPU but the reason should probably go in a comment beside
> the call.

Do you mean to use hvm_map_guest_frame_ro? Fine to me.
> 
> Also, I don't see where these mappings get torn down on domain
> destruction.
> 
Yes. Fixed in nvmx_vcpu_destroy.

> (While I'm looking at this code, this function is quite ugly.  Why have
> a single function if you're going to duplicate its contents anyway?)

??? We don't know fi guest changed the bitmap, so we have to check each time.

> 
> +
> > +    if ( nvcpu->nv_vvmcxaddr == VMCX_EADDR )
> > +    {
> > +        mfn = mfn_x(gfn_to_mfn(p2m_get_hostp2m(v->domain),
> > +                               gpa >> PAGE_SHIFT, &p2mt));
> > +        nvcpu->nv_vvmcx = map_domain_page_global(mfn);
> 
> Again, why _global?

Will fix with hvm_map_guest_frame.

Thx, Eddie



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel