[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Mapping HVM guest memory from Dom0



Hello,

I'm developing an application that runs in Dom0 and needs to read memory from a guest given a guest address (for instance, reading RIP from the guest CPU context and then reading the current instruction). I'm using xenforeignmemory_map() to map the guest memory, but this function takes the MFN of the guest address to read, not the address itself. Xen does not seem to have an API for doing the virtual address --> MFN conversion.

I've figured out how to do this for PV guests: map the domain's meminfo struct and use the PFN for the guest address (i.e. address >> XC_PAGE_SHIFT) as an index into the P2M table.

However, I am having trouble doing the same for HVM guests. Right now I am trying to follow the implementation of bg_hvm_va2mfn in xen/arch/x86/debug.c, but this function uses so many internal Xen functions it seems I would have to copy tons of code out from Xen, and I'm wondering if there's a better way. Is there some API I'm missing that lets me to do the vaddr --> MFN conversion for HVM guests? If not, what is the simplest way to do this conversion?

Thanks,
Spencer
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.