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][VT] Patch to allow VMX domainsto be destroyedor

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH][VT] Patch to allow VMX domainsto be destroyedor shut down cleanly
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Mon, 19 Sep 2005 18:52:50 +0800
Cc: Khoa Huynh <khoa@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 19 Sep 2005 10:50:46 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW8+lB5rPl8qrKeRNyFRmmR/y2LCQAA85zg
Thread-topic: [Xen-devel] [PATCH][VT] Patch to allow VMX domainsto be destroyedor shut down cleanly
Keir Fraser wrote:
> On 19 Sep 2005, at 06:54, Jiang, Yunhong wrote:
> 
>> More exactly should be:
>>      if (!vmx_paging_enabled(d)) {
>>                      get_page for new mfn
>>                      put_page for old mfn
>>      }
> 
> What would old_mfn be in this case?
> 
> If we do any cr3 ref-counting on cr0 writes I would expect it to be:
>   * put_page() on clearing of CR0_PG
>   * get_page() on setting of CR0_PG
> 
> Given that writing cr3 currently does a get_page/put_page regardless
> of the setting of CR0_PG, is there any need to be doing get_page()
> within vmx_set_cr0()?

I'm not sure if the get_page() on vmx_set_cr0 has purpose of sanity check , 
otherwise it can be removed. In fact, I think the put_page has the effect to 
remove it.

> 
> I think it's more correct to do get/put in vmx_set_cr0 (at that point
> we can know what format the pagetables should be, for example
> (32/32p/64). But I think it's a bigger cleanup patch.

Do you mean put all get/put on vmx_set_cr0 ? even for paging enabled case?

And there is one more issue .If the guest is destroyed before the kernel 
enabling paging, how about the page pointed by cr3? It may cause one referece 
count left. The reason is, currently when destroy domain, only 
domain->guest_table is released. However, if the paging is not enabled, then 
the get_page on vmx_set_cr0 has no corresponding put_page, which may cause 
problem. Hope comments on this point.

> 
> Whatever you go for: please send a complete tested patch. :-)

Sure!

> 
>   -- Keir


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