From: xinyue Subject: Re: =?utf-8?q?=5BXen-users=5D_xen_physical_address?= =?utf-8?b?77yIcGFkZHLvvIlhbmQgbWFjaGluZSBhZGRyZXNzIChtYWRkcik=?= Date: Mon, 29 Jun 2015 18:35:37 +0800 (CST) Message-ID: <1752659282.107797.1435574137605.JavaMail.tomcat@nfs.iscas.ac.cn> Reply-To: xinyue@nfs.iscas.ac.cn Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8223274136967243628==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "ian.campbell" Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --===============8223274136967243628== Content-Type: multipart/alternative; boundary="----=_Part_107796_1263525374.1435574137604" ------=_Part_107796_1263525374.1435574137604 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks very much=EF=BC=8CI think it‘s very helpful and I'll try i= t. Does "for an arbitrary guest page it is unlikely to be from the xenhea= p" 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 w= on't monitor guest domains memory regions? Thanks again and best regards! xinyue =E5=9C=A8 2015-06-29, Mon, 16:21:53 ,Ian Campbell =E5=86=99=E5=88=B0=EF=BC= =9A On Sun, 2015-06-28 at 13:13 +0800, xinyue wrote: Per http://wiki.xen.org/wi= ki/Asking_Xen_Devel_Questions#Observe_list_etiquette. please do not cross p= ost. You question seems to be xen-development related, so I have put the ot= her two to bcc. > I wan't to hash the kernel code segment of HVM Dom= U 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 t= hen 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 simp= lify 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 &g= t; translate between them. Is paddr the same with virtral address in xen &g= t; heap? No. A paddr is a physical address, not a virtual one. The latest x= en.git contains a comment in xen/include/xen/mm.h which describes the diffe= rent types of memory. To get a Xen virtual address for a domheap page you n= eed 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 > Xen-users@lists.xen.org > htt= p://lists.xen.org/xen-users=20 ------=_Part_107796_1263525374.1435574137604 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks very much=EF=BC=8CI think it‘s very helpful and I'll = try it.

Does "for an arbitrar= y 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 w= on't monitor guest domains memory regions?

Thanks again and best regards!

xinyue


=E5=9C=A8 2015-06-29, Mon, 16:21:53 ,Ian Campbell =E5=86=99=E5=88=B0=EF=BC= =9A
On Sun, 2015-06-28 at 13:13 +0800, xinyue wrote: Per http://wiki.xen.org/wi= ki/Asking_Xen_Devel_Questions#Observe_list_etiquette. please do not cross p= ost. You question seems to be xen-development related, so I have put the ot= her two to bcc. > I wan't to hash the kernel code segment of HVM Dom= U 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 t= hen 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 simp= lify 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 &g= t; translate between them. Is paddr the same with virtral address in xen &g= t; heap? No. A paddr is a physical address, not a virtual one. The latest x= en.git contains a comment in xen/include/xen/mm.h which describes the diffe= rent types of memory. To get a Xen virtual address for a domheap page you n= eed 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 > Xen-users@lists.xen.org > htt= p://lists.xen.org/xen-users=20
------=_Part_107796_1263525374.1435574137604-- --===============8223274136967243628== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8223274136967243628==--