From: "Wu Bingzheng" Subject: Questions about shadow page table. Date: Tue, 26 May 2009 16:46:58 +0800 (CST) Message-ID: <27156115.386171243327618700.JavaMail.coremail@bj163app31.163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1961081575==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --===============1961081575== Content-Type: multipart/alternative; boundary="----=_Part_104774_223071.1243327618698" ------=_Part_104774_223071.1243327618698 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Hi, I have some questions about Shadow page table in Xen. 1. Xen used shadow-1, shadow-2, and shadow-3 from beginning to now. (http://blog.xen.org/index.php/2008/08/27/xen-33-feature-shadow-3/) In Xen 3.3, it re-use out-of-sync, which is used in Shadow-1. Shadow-1. Its method of propagating changes from guest pagetables to the shadow pagetables was as follows: 1. Remove write access to any guest pagetable. 2. When a guest attempts to write to the guest pagetable, mark it out-of-sync, add the page to the out-of-sync list and give write permission. 3. On the next page fault or cr3 write, take each page from the out-of-sync list and: - resync the page: look for changes to the guest pagetable, propagate those entries into the shadow pagetable - remove write permission, and clear the out-of-sync bit. My question is that, dose step 2 trap into Xen hypervisor? 2. I think there are 2 kinds of page fault. 1) normal page fault in guest, which should be handled by guest; 2) invoked by guest updating the page table, which should be handled by Xen. So, if there's a page-miss fault in guest, how many times it will trap into Xen? First, page miss, trap into Xen. Xen finds out it's the 1st kind fault, then it go back to guest to handle it. Then, in guest, when it updates the page table to fix the page fault, it will invoke the 2nd kind fault, which will trap into Xen again. Am I right? 3. For the user space part, are the attribute bits of the entries in Guest page table and Shadow page table the same? Thanks, Wu ------=_Part_104774_223071.1243327618698 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable Hi,

I have some questions about Shadow = ;page table in Xen.

1.
Xen used shadow-1= , shadow-2, and shadow-3 from beginning to&nb= sp;now.
(http://blog.xen.org/index.php/2008/08/27/xen-33-feature-shadow-= 3/)
In Xen 3.3, it re-use out-of-sync, whi= ch is used in Shadow-1.

Shadow-1. Its = method of propagating changes from guest page= tables 
to the shadow pagetables was as&nb= sp;follows:

  1. Remove write access t= o any guest pagetable.
  2. When a&nb= sp;guest attempts to write to the guest = pagetable, mark it
     out-of-sync,&= nbsp;add the page to the out-of-sync list&nbs= p;and give write 
     permissio= n.
  3. On the next page fault o= r cr3 write, take each page from the&nbs= p;
     out-of-sync list and:
&nbs= p;    - resync the page: look = for changes to the guest pagetable, 
 = ;      propagate those entries = ;into the shadow pagetable
     = - remove write permission, and clear the = ;out-of-sync bit.

My question is that, dose=  step 2 trap into Xen hypervisor?


= 2.
I think there are 2 kinds of page&= nbsp;fault. 1) normal page fault in guest,which should be handled by guest; 2) in= voked by guest updating the page 
table,&n= bsp;which should be handled by Xen.

So,&nbs= p;if there's a page-miss fault in guest, = ;how many times it will trap into Xen?First, page miss, trap into Xen. Xen f= inds out it's the 1st kind fault, 
th= en it go back to guest to handle it=
Then, in guest, when it updates the = ;page table to fix the page fault, 
i= t will invoke the 2nd kind fault, which&= nbsp;will trap into Xen again.

Am I ri= ght?

3.
For the user space part, are&nbs= p;the attribute bits of the entries 
in&nb= sp;Guest page table and Shadow page table&nbs= p;the same?

Thanks,
Wu


=B4=A9=D4=BD=B5=D8=D5=F0=B4=F8 =BC=CD=C4=EE=E3=EB=B4=A8=B5=D8=D5=F0= =D2=BB=D6=DC=C4=EA
------=_Part_104774_223071.1243327618698-- --===============1961081575== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1961081575==--