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] where is writable page table implemented?

To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>
Subject: Re: [Xen-devel] where is writable page table implemented?
From: weiming <zephyr.zhao@xxxxxxxxx>
Date: Sun, 30 Mar 2008 19:43:27 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sun, 30 Mar 2008 16:44:43 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=/adLYxSvXUQYeo74CwQqtSpKiY961C0ECB6NvsQ0dpE=; b=s5URTinrm9Wfe3wEg8HwTiBmEGCLkCv5XWSKkktBfzr61TYXP4V0dzUKtkWPnennG+gZYcuRC/vYt0tOl8NXgE1EoX+6+tS+tMJaIS+WkE1pGsZ5IFrhMnybTeNAbrslZ7+TAsrQCVvDj2hTJ9hi/jleB4nqqorwL/hEVK5sBV0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=bkqCg2HNxy97yEzZ7H7ukRnOVnMTmgMqxpZV5NLgx5T8q5Xa0rEOA75p5qmKMZce3fHJKYz2Ki6VWrutzwSfmfz309SUZuInv9OwomeqJh9ZTbrvmEm1FGq+4wXW/yDJhItdMHwvz8KIHzZX59GWxXh2Oy/kFrmvRyRBKXnVJ88=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080325104351.GA30991@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <add59a3f0803240918m1f882115h7c2ba64e2ca2139a@xxxxxxxxxxxxxx> <20080324162510.GD30315@xxxxxxxxxxxxxxxxxxxxx> <add59a3f0803241126i603eb40qfa1b57f917103e74@xxxxxxxxxxxxxx> <20080325104351.GA30991@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Tim,

Very appreciate for your explanation.

Another question that puzzles me is:

with writable page table, why guest os still calls update_va_mapping to update the pte? Is it because writable page table only traps updates to L4 level page table? So in order to update pud, pmd, we have to use update_va_mapping? and what's purpose of the hypercall Pin/unpin page table page?

Very appreciate!
Weiming





On Tue, Mar 25, 2008 at 6:43 AM, Tim Deegan <Tim.Deegan@xxxxxxxxxx> wrote:
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 <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

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