From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: where is writable page table implemented? Date: Tue, 25 Mar 2008 10:43:51 +0000 Message-ID: <20080325104351.GA30991@york.uk.xensource.com> References: <20080324162510.GD30315@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Return-path: Content-Disposition: inline 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: weiming Cc: xen-devel List-Id: xen-devel@lists.xenproject.org At 14:26 -0400 on 24 Mar (1206368762), weiming wrote: > 1) how does the guest OS tell xen which page is a pagetable page? With an MMUEXT_OP hypercall, if I recall correctly. > What if the guest doesn't do so? Then it's not allowed to use it as a pagetable. > I assume xen should check if a pagetable had > already been registered or not. But in do_mmuext_op(), there is no such > check before setting the cr3. In new_guest_cr3(), the call to get_page_and_type_from_pagenr() will try to take a typed reference count on the page, which marks it as a pagetable. The check for paging_mode_refcounts(d) is to say that if the guest is running under full shadow pagetables/HAP, then we skip the usual protection mechanisms and leave it to the paging-assistance code. > 2) in ptwr_do_page_fault(), it should disconnect the page from page > directory and then mark the page as writable. Where are they done? In > x86_emulate()? That's not done any more. Instead, x86_emulate() emulates the instruction and verifies the result is OK. Tim. -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]