From: Keir Fraser Subject: Re: [PATCH][VT] Patch to allow VMX domainsto be destroyedor shut down cleanly Date: Mon, 19 Sep 2005 10:17:12 +0100 Message-ID: <05d05d51b6b6bc6ea8430dbd8e51bfb7@cl.cam.ac.uk> References: Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Jiang, Yunhong" Cc: Khoa Huynh , xen-devel@lists.xensource.com, xen-devel-bounces@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 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. Whatever you go for: please send a complete tested patch. :-) -- Keir