[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] where is writable page table implemented?


  • To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.