WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] pfn to mfn mapping for HVM domains?

thing in PV domains.  Try using xc_translate_gpfn_list instead, which
does P2M translation on HVM domains.

I'm having trouble with the value returned from this function. I've been working on this for a while and my conclusion is that there must be an error in my logic (most likely!) or a bug in this function. Perhaps someone could help me figure out which it is...

These are the steps that I'm taking:

* Assume that I have an HVM domain running fedora core 5. My goal is to view the memory page holding the symbol swapper_pg_dir (the kernel page global directory, or kpgd for short).

* I lookup the virtual address for kpgd in the System.map file

* I subtract 0xc0000000 from the virtual address to get the physical address (which should be valid since this is kernel memory and the PAGE_OFFSET for this kernel is 0xc0000000).

* I convert the physical address to a pfn by bit shifting PAGE_SHIFT bits to the right

* I translate the pfn to a mfn using the xc_domain_translate_gpfn_list function

* I mmap the mfn using xc_map_foreign_range

After doing this, the page that is returned from xc_map_foreign_range does not appear to be the correct page. The offset where the kpgd should be located contains all zeros, which can't be correct.

I've tried the same steps with other kernel symbols as well. Each time I get a valid mfn returned by xc_domain_translate_gpfn_list. But each time when I map this mfn, the expected information is not on that page, so I conclude that the mfn is not correct.

With the exception of the pfn to mfn conversion step, I can do the exact same steps on a PV domain and it works every time. So I'm inclined to think that my logic for converting a virtual address to a pfn is valid. Does this imply that there's a bug in xc_domain_translate_gpfn_list or am I misinterpreting the function's output?

Thanks,
bryan


-
Bryan D. Payne
Graduate Student, Computer Science
Georgia Tech Information Security Center
http://www.bryanpayne.org




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>