From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: Performance problem about address translation Date: Mon, 06 Jul 2015 09:11:36 +0100 Message-ID: <559A3838.3080604@citrix.com> References: <1064283602.109093.1436167378616.JavaMail.tomcat@nfs.iscas.ac.cn> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1708070873391848438==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZC1V6-0005wf-Du for xen-devel@lists.xenproject.org; Mon, 06 Jul 2015 08:11:40 +0000 In-Reply-To: <1064283602.109093.1436167378616.JavaMail.tomcat@nfs.iscas.ac.cn> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xinyue@nfs.iscas.ac.cn, "ian.campbell" , xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============1708070873391848438== Content-Type: multipart/alternative; boundary="------------080106050809050908060406" This is a multi-part message in MIME format. --------------080106050809050908060406 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 06/07/2015 08:22, xinyue wrote: > Hi, > > For I want to translate the virtual address in HVM DomU to virtual > address in Xen. But when I use the function paging_gva_to_gfn and > get_gfn, I can feel the performance down quickly, the machine become > very hot and then I have to force the machine shutting down. Your machine clearly isn't cooled sufficiently, which is the first problem. > > The codes I used as below: > uint32_t pfec = PFEC_page_present; > unsigned long gfn; > unsigned long mfn; > unsigned long virtaddr; > struct vcpu *vcpu = current; > struct domain *d = vcpu->domain; > > gfn = paging_gva_to_gfn(current, 0xc0290000, &pfec); > mfn = get_gfn(d, gfn, &t); > virtaddr = map_domain_page(mfn_x(mfn)); > > I also use the dbg_hvm_va2mfn function in debug.c, performance problem > still present. Walking pagetables in software is slow. There is no getting around this. Your performance problems will be caused by performing the operation far too often. You should find a way to reduce this. ~Andrew --------------080106050809050908060406 Content-Type: text/html; charset=windows-1252 Content-Length: 2359 Content-Transfer-Encoding: quoted-printable
On 06/07/2015 08:22, xinyue wrote:
Hi,

=A0=A0=A0 For I want to translate the virtual address in HVM DomU to virtual address in Xen. But when I use the function paging_gva_to_gfn and get_gfn, I can feel the performance down quickly, the machine become very hot and then I have to force the machine shutting down.

Your machine clearly isn't cooled sufficiently, which is the first problem.


The codes I used as below:
=A0=A0=A0 uint32_t pfec =3D PFEC_page_present;
=A0=A0=A0 unsigned long gfn;
=A0=A0=A0 unsigned long mfn;
=A0=A0=A0 unsigned long virtaddr;
=A0=A0=A0 struct vcpu *vcpu =3D current;
=A0=A0=A0 struct domain *d =3D vcpu->domain;

=A0=A0=A0 gfn =3D paging_gva_to_gfn(current, 0xc0290000, &pfec);
=A0=A0=A0 mfn =3D get_gfn(d, gfn, &t);
=A0=A0=A0 virtaddr =3D map_domain_page(mfn_x(mfn));

I also use the dbg_hvm_va2mfn function in debug.c, performance problem still present.

Walking pagetables in software is slow.=A0 There is no getting around this.

Your performance problems will be caused by performing the operation far too often.=A0 You should find a way to reduce this.

~Andrew
--------------080106050809050908060406-- --===============1708070873391848438== 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 --===============1708070873391848438==--