xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: david <david_n@gmx.at>
To: xen-devel@lists.xensource.com
Subject: Can't map the page referenced by HVM-DomU CR3 in Dom0
Date: Fri, 15 Apr 2011 15:45:34 +0200	[thread overview]
Message-ID: <4DA84BFE.4060904@gmx.at> (raw)

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

             reply	other threads:[~2011-04-15 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 13:45 david [this message]
2011-04-18  9:34 ` Can't map the page referenced by HVM-DomU CR3 in Dom0 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

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=4DA84BFE.4060904@gmx.at \
    --to=david_n@gmx.at \
    --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).