From: Yao Subject: Questions for the shadow page code Date: Fri, 11 Mar 2011 10:35:12 +0800 (CST) Message-ID: <53223977.4c0f.12ea2c48806.Coremail.yffbrave@163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0955104618==" 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 --===============0955104618== Content-Type: multipart/alternative; boundary="----=_Part_52315_1740083978.1299810912261" ------=_Part_52315_1740083978.1299810912261 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit Hi, guys Lately I've been researching the implementation of the shadow page and I didn't really understand the mechanism. For instance, the function shadow_get_and_create_l*e in x86/mm/shadow/multi.c If the GuestOS is 32-bit, then shadow_get_and_create_l1e should execute { *sl2mfn = pagetable_get_mfn(v->arch.shadow_table[0]); (void) shadow_l2_index(sl2mfn, guest_l2_table_offset(gw->va)); return sh_linear_l2_table(v) + shadow_l2_linear_offset(gw->va); } 1.How does the Xen organize the spt? it looks like xen used 36-bit pae for spt, but how does it correspond to the guest 2 level page table? 2.What's the function of sh_linear_l2_table & the whole return sentence? It's the same situation in the shadow_get_and_create_l2e. There are some assemble code and it screw me up :( 3.Are there any docs to help me to figure it out? Regards, Yao ------=_Part_52315_1740083978.1299810912261 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit Hi, guys
Lately I've been researching the implementation of the shadow page and I didn't really understand the mechanism. For instance, the function shadow_get_and_create_l*e in x86/mm/shadow/multi.c
If the GuestOS is 32-bit, then shadow_get_and_create_l1e should execute
{
    *sl2mfn = pagetable_get_mfn(v->arch.shadow_table[0]);

    (void) shadow_l2_index(sl2mfn, guest_l2_table_offset(gw->va));

    return sh_linear_l2_table(v) + shadow_l2_linear_offset(gw->va);
}
1.How does the Xen organize the spt? it looks like xen used 36-bit pae for spt, but how do es it correspond to the guest 2 level page table?
2.What's the function of sh_linear_l2_table & the whole return sentence? It's the same situation in the shadow_get_and_cr eate_l2e.  There are some assemble code and it screw me up :(
3.Are there any docs to help me to figure it out?


Regards,
Yao


------=_Part_52315_1740083978.1299810912261-- --===============0955104618== 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 --===============0955104618==--