On 09/10/18 20:34, Spencer Michaels wrote: > 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?
Have you come across libvmi? It seems to be exactly what you are trying to make here. ~Andrew _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
