xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Yao <yffbrave@163.com>
To: Tim Deegan <tim.deegan@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re:Re: Re: How to create shadow page table of my own?
Date: Mon, 28 Feb 2011 19:55:52 +0800 (CST)	[thread overview]
Message-ID: <1fc2ee7c.15462.12e6c1fe201.Coremail.yffbrave@163.com> (raw)
In-Reply-To: <20110221142056.GD32074@whitby.uk.xensource.com>


[-- Attachment #1.1: Type: text/plain, Size: 2293 bytes --]

At 2011-02-21,"Tim Deegan" <Tim.Deegan@citrix.com> wrote:

>At 13:57 +0000 on 21 Feb (1298296632), ?????? wrote:
>> I deliberately make those two sections align for the page in order to
>> make SPT creation simple, see that? The sim_k_text & data all start at
>> a new page. The text section occupied 13 pages & data occupied 1 page
>> although the size of data is only 0x7c.
>
>Yes I saw that.  
>
>> I know in the hvm, the virtual address is translated to the physical
>> address first, then translated to the machine address. For my
>> constructed address space, I want to create SPT to convert virtual
>> address to machine address directly & eliminate the need for any guest
>> level page table for this address space, is it possible?
>
>Sure it's possible.  You can put anything you like into the shadow
>pagetables.  But you need first to think about _exactly_ what behaviour
>you want.  If two VCPUs have the same CR3 value will you ever need them
>to have different shadow pagetables?  That's not possible with the
>current Xen shadow pagetables because they share one set of shadows
>among all a domain's VCPUs.
>
>What should happen if Xen emulates an instruction that accesses the
>secure area?  The emulator doesn't use the shadow pagetables so you
>will have to find and fix the other paths that map VAs to MAs.
>
>Have you got access to a machine that supports AMD NPT or Intel EPT?  If
>so it might be easier to have a per-VCPU EPT/NPT table that you add and
>remove mappings as you go in and out of "secure" mode.
>
>> For now what I consider is pass the starting address & size to the xen.
>> 
>> You said I need to duplicate a lot of state, where I need to modify?
>
>xen/arch/x86/mm/shadow/*.c .  It's pretty complex code but there are
>some comments in there.  But as I said it would probably be easier to
>use the EPT/NPT code if you can.
>
>Cheer,
>
>Tim.

I've did some reaserch, found EPT was not appropriate, cauz EPT implements the translation from GPA to HPA, but what I want is the translation from GVA to HPA which exactly what the shadow page table did. By using spt I can eliminate the need for page table of my own address space in the guest, but ept still need it. So maybe I have to keep researching shadow page table:(A lot of work needs to be done, WoW !!

[-- Attachment #1.2: Type: text/html, Size: 4191 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

      parent reply	other threads:[~2011-02-28 11:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21  6:53 How to create shadow page table of my own? 姚福峰
2011-02-21 10:31 ` Tim Deegan
2011-02-21 13:57 ` 姚福峰
2011-02-21 14:20   ` Tim Deegan
2011-02-22  1:16   ` 姚福峰
2011-02-28 11:55   ` Yao [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=1fc2ee7c.15462.12e6c1fe201.Coremail.yffbrave@163.com \
    --to=yffbrave@163.com \
    --cc=tim.deegan@citrix.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).