xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Steven <wangwangkang@gmail.com>
To: "Huang2, Wei" <Wei.Huang2@amd.com>, xen-devel@lists.xensource.com
Subject: Re: Understanding AMD NPT in xen
Date: Thu, 12 Apr 2012 22:29:02 -0400	[thread overview]
Message-ID: <CAMTrTqVd1kax4bCQCSmM2sWcQWv=y9SofkJFSa2dD_Qb-Su43g@mail.gmail.com> (raw)
In-Reply-To: <4400B41FB768044EA720935D0808176C090BCDDC@sausexdag02.amd.com>

This clarifies everything. Thanks.

- Hui

On Thu, Apr 12, 2012 at 5:50 PM, Huang2, Wei <Wei.Huang2@amd.com> wrote:
> Reformat:
>
> 1. To find out gPML4E
> * Traverse nested page table using gCR3 to locate guest level-4 page (PML4 table)
> * Use PML4 offset (bit 47:39) to get the value of gPML4E
>
> 2. To find out gPDPE
> * Traverse nested page table using gPML4E to locate guest level-3 page (PDP table)
> * Use PDP offset (bit 38:30) to get the value of gPDPE
>
> 3. To find out gPDE
> * Traverse nested page table using gPDPE to locate guest level-2 page (PD table)
> * Use PD offset (bit 29:21) to get the value of gPDE
>
> 4. To find out gPTE
> * Traverse nested page table using gPDE to locate guest level-1 page (PT table)
> * Use PT offset (bit 20:12) to get the value of gPTE
>
> 5. To find out gData
> * Traverse nested page table using gPTE to locate guest data page
> * Use physical page offset (bit 11:0) to get the data value
>
>
> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of Huang2, Wei
> Sent: Thursday, April 12, 2012 4:35 PM
> To: Steven; Wang2, Wei; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] Understanding AMD NPT in xen
>
> White page info is more accurate. The slides was a bit vague. Here are the steps, assuming that CPU doesn't have TLB:
>
> 1. To find out gPML4E
> * Traverse nested page table using gCR3 to locate guest level-4 page (PML4 table)
> * Use PML4 offset (bit 47:39) to get the value of gPML4E
> 2. To find out gPDPE
> * Traverse nested page table using gPML4E to locate guest level-3 page (PDP table)
> * Use PDP offset (bit 38:30) to get the value of gPDPE
> 3. To find out gPDE
> * Traverse nested page table using gPDPE to locate guest level-2 page (PD table)
> * Use PD offset (bit 29:21) to get the value of gPDE
> 4. To find out gPTE
> * Traverse nested page table using gPDE to locate guest level-1 page (PT table)
> * Use PT offset (bit 20:12) to get the value of gPTE
> 5. To find out gData
> * Traverse nested page table using gPTE to locate guest data page
> * Use physical page offset (bit 11:0) to get the data value
>
> TLB will accelerate this walking significantly.
>
> -Wei
>
> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of Steven
> Sent: Thursday, April 12, 2012 12:06 PM
> To: Wang2, Wei; xen-devel@lists.xensource.com
> Subject: [Xen-devel] Understanding AMD NPT in xen
>
> Hi, Wei,
> I have read you slides in xen summit 2007 about NPT in AMD, "AMD
> Barcelona and Nested Paging Support in Xen".
> However, I have some question regarding the nested page walk in your slide 8.
>
> In your slide 8, the first step is to get gPA from get_PML4(gCR3,gVA).
> I assume that it use the [47:39] bit of gVA.
> However, in another AMD white paper, "AMD-VTM Nested Paging".
> http://developer.amd.com/assets/NPT-WP-1%201-final-TM.pdf
> In its figure 4, I saw that the first step is to translate gCR3 using
> nested page walk and then combine with the gVA[47:39] to read the
> table entry.
>
> These two documents look having different order of reading the guest
> page table. In the slides, it first get_PML4. But in the white paper,
> it first does nested page walk.
> I am wondering which one is true. Thanks.
>
> - ha
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>

      parent reply	other threads:[~2012-04-13  2:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 17:06 Understanding AMD NPT in xen Steven
2012-04-12 21:35 ` Huang2, Wei
     [not found]   ` <4400B41FB768044EA720935D0808176C090BCDDC@sausexdag02.amd.com>
2012-04-13  2:29     ` Steven [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMTrTqVd1kax4bCQCSmM2sWcQWv=y9SofkJFSa2dD_Qb-Su43g@mail.gmail.com' \
    --to=wangwangkang@gmail.com \
    --cc=Wei.Huang2@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).