Guest page table dumping
Hello List,
I'm trying to get at the guest's (x86_64 VMX HVM guest, x86_64 Xen 3.0.4-1) view of the page tables and dump them out so I can read them offline. My strategy to do this is to add a domctl I can use to map the domain page that corresponds to the guest's page table page (for right now just the top level page table, PML4) then dump out that page to dom0 so I can process it. I've got the skeleton domctl working but the trouble is I don't know exactly how I should transform the guests view of the CR3 address in order for map_domain_page() to be happy.
What transformation should I use to get vmx.cpu_cr3 into a happy address for use with map_domain_page(). My best guess so far is map_domain_page(gmfn_to_mfn(d, v->arch.hvm_cpu.u.vmx.cpu_cr3 >> PAGE_SHIFT)), is that in the ballpark?
Is cpu_cr3 the correct cr3 to use to get at the level 4 guest page table?
Would it be easier to dump the shadow representation of the l4 page table?
TIA,
-Travis
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Hi Travis,
Quoted 4 lines · Travis Johnson
I've
got the skeleton domctl working but the trouble is I don't know exactly how I should transform the guests view of the CR3 address in order formap_domain_page()to be happy.
Have a read through sh_update_cr3(); near the top it calls hvm_get_guest_ctrl_reg(v, 3) to read the guest's CR3 and translates it to a guest frame-number and then to a machine frame-number (suitable for map_domain_page())
Quoted 1 line
Is
cpu_cr3the correct cr3 to use to get at the level 4 guest page table?
Yes, though calling hvm_get_guest_ctrl_reg() would be cleaner.
Quoted 1 line
Would it be easier to dump the shadow representation of the l4 page table?
You can get that at v->arch.shadow_table[0] for 64bit guests.
There's also some code in svm.c for dumping page tables, but it may have bit-rotted.
Cheers,
Tim.
Signature · 2 lines
Tim Deegan <[email protected]>, XenSource UK Limited Registered office c/o EC2Y 5EB, UK; company number 05334508