Skip to contentSkip to conversation

xen physical address(paddr)and machine address (maddr)

Xen-users xinyue 2 participants 2 messages Jun 29, 2015

lore
Share & tools
lore

xinyue

author
#0 lore raw

Thanks very much,I think it‘s very helpful and I'll try it.

Does "for an arbitrary guest page it is unlikely to be from the xenheap" means that some guest pages can't be mapped to xen heap page?

And I wonder in HVM doms with EPT supported, is there any difference if I won't monitor guest domains memory regions?

Thanks again and best regards!

xinyue

在 2015-06-29, Mon, 16:21:53 ,Ian Campbell 写到:
On Sun, 2015-06-28 at 13:13 +0800, xinyue wrote: Per http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions#Observe_list_etiquette. please do not cross post. You question seems to be xen-development related, so I have put the other two to bcc. > I wan't to hash the kernel code segment of HVM DomU in Xen > hypervisor, so I have to transilate the virtral address in VM to the > virtral address in xen. Is there some easy ways ? You need to first translate the guest virtual address to a guest physical address and then to a machine address which you can then map in to Xen. I think you need paging_gva_to_gfn for the first step, then one of the get_gfn* functions, then map_domain_page. I don't know if there is a helper which will simplify all this. > I read the source code about memory in Xen and confuse the > relationship between the paddr and maddr. How does HVM with EPT > translate between them. Is paddr the same with virtral address in xen > heap? No. A paddr is a physical address, not a virtual one. The latest xen.git contains a comment in xen/include/xen/mm.h which describes the different types of memory. To get a Xen virtual address for a domheap page you need to use (un)map_domain_page on the underlying machine address (or struct page_info *) to create a temporary mapping. For xenheap pages you can use other mechanisms, but for an arbitrary guest page it is unlikely to be from the xenheap. > > > Thanks for any advices and with best regards! > > > xinyue > > > _______________________________________________ > Xen-users mailing list > [email protected] > http://lists.xen.org/xen-users

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw

On Mon, 2015-06-29 at 18:35 +0800, xinyue wrote:

Please don't top post. Please have another read of hte Etiquette section of http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions .

Quoted 4 lines

Thanks very much,I think it‘s very helpful and I'll try it.

Does "for an arbitrary guest page it is unlikely to be from the xenheap" means that some guest pages can't be mapped to xen heap page?

Any given page is either a domheap page or a xenheap page, so there is no mapping in the sense you seem to be thinking of.

Quoted 2 lines

And I wonder in HVM doms with EPT supported, is there any difference if I won't monitor guest domains memory regions?

I'm afraid I don't understand the question.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel