xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Can't map the page referenced by HVM-DomU CR3 in Dom0
@ 2011-04-15 13:45 david
  2011-04-18  9:34 ` Tim Deegan
  0 siblings, 1 reply; 6+ messages in thread
From: david @ 2011-04-15 13:45 UTC (permalink / raw)
  To: xen-devel

Hi,

I'm trying to access the page containing the paging information for a 
DomU from Dom0.

I'm doing that by translating the address contained in the DomU CR3 
register with xc_translate_foreign_address (libxc) and try to map the
returned frame number with xc_map_foreign_range.

The problem is, that the return value from xc_translate_foreign_address 
is 0 (guest cr3 is 0x002f3000 in my case), which indicates an error 
(corresponding to the code comments). After some debugging I have 
discovered, that pte becomes 0 when level=2 and therefore the function 
returns 0 on line 79:

tools/libxc/xc_pagetab.c
69    /* Walk the pagetables */
70    for (level = pt_levels; level > 0; level--) {
71        paddr += ((virt & mask) >> (xc_ffs64(mask) - 1)) * size;
72        map = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ,
73                                   paddr >>PAGE_SHIFT);
74        if (!map)
75            return 0;
76        memcpy(&pte, map + (paddr & (PAGE_SIZE - 1)), size);
77        munmap(map, PAGE_SIZE);
78        if (!(pte & 1))
79            return 0;
80        paddr = pte & 0x000ffffffffff000ull;
...
...

I'm currently trying to examine why pte becomes 0. Is anyone familiar 
with this part of the code and can explain why it is not possible to map 
the page?

My setup:
Dom0: debian 2.6.32.26 x86_64
DomU: HVM Win XP SP2 32bit
xen-4.0.1


thanks for any hints,


david

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-19 22:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 13:45 Can't map the page referenced by HVM-DomU CR3 in Dom0 david
2011-04-18  9:34 ` Tim Deegan
2011-04-19 15:44   ` david
2011-04-19 16:26     ` Keir Fraser
2011-04-19 21:58       ` david
2011-04-19 22:14         ` Keir Fraser

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).