From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas K Lengyel Subject: Re: [PATCH for-4.5 v8 19/19] tools/tests: Enable xen-access on ARM Date: Wed, 24 Sep 2014 18:05:01 +0200 Message-ID: References: <1411478070-13836-1-git-send-email-tklengyel@sec.in.tum.de> <1411478070-13836-20-git-send-email-tklengyel@sec.in.tum.de> <1411571533.28127.67.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3836814947526191849==" Return-path: In-Reply-To: <1411571533.28127.67.camel@kazak.uk.xensource.com> 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: Tim Deegan , Julien Grall , Ian Jackson , "xen-devel@lists.xen.org" , Stefano Stabellini , Andres Lagar-Cavilla , Jan Beulich , Daniel De Graaf , Tamas K Lengyel List-Id: xen-devel@lists.xenproject.org --===============3836814947526191849== Content-Type: multipart/alternative; boundary=001a11c3bcccaa64370503d1d8a8 --001a11c3bcccaa64370503d1d8a8 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Sep 24, 2014 at 5:12 PM, Ian Campbell wrote: > On Tue, 2014-09-23 at 15:14 +0200, Tamas K Lengyel wrote: > > Define the ARM specific test_and_set_bit functions and switch > > to use maximum gpfn as the limit to setting permissions. Also, > > move HAS_MEM_ACCESS definition into config. > > Please could you mention the removal of the x86 comment about atomicity > here, since the reasoning for its correctness will be of interest to > future code archaeologists. > Ack. I'm still hoping we can figure out if its the code or the comments that's wrong. I tend to think its the comment as it smells like a copy-paste. > > > - rc = xc_set_mem_access(xch, domain_id, default_access, 0, > > - xenaccess->domain_info->max_pages); > > + rc = xc_set_mem_access(xch, domain_id, default_access, START_PFN, > > + (xenaccess->max_gpfn - START_PFN) ); > > So the reason why info->max_pages is no use any more is because ARM > starts at non-zero and has multiple banks? > > I suppose that's fair enough. > > Ian. > Yeap. It's not a problem to start at 0, this is just a bit of optimization from the user's side that I would consider best-practice. The user could also include some logic to skip the hole in-between the banks (if there are multiple banks), but that I felt is too much complexity to include here. Tamas --001a11c3bcccaa64370503d1d8a8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Wed, Sep 24, 2014 at 5:12 PM, Ian Campbell <Ian.Campbell@citr= ix.com> wrote:
On Tue, 2014-09-23 at 15:14 +0200, Tamas K Lengyel wrote:
> Define the ARM specific test_and_set_bit functions and switch
> to use maximum gpfn as the limit to setting permissions. Also,
> move HAS_MEM_ACCESS definition into config.

Please could you mention the removal of the x86 comment about atomic= ity
here, since the reasoning for its correctness will be of interest to
future code archaeologists.

Ack. I'= m still hoping we can figure out if its the code or the comments that's= wrong. I tend to think its the comment as it smells like a copy-paste.
=
=A0

> -=A0 =A0 rc =3D xc_set_mem_access(xch, domain_id, default_access, 0, > -=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xenaccess->= domain_info->max_pages);
> +=A0 =A0 rc =3D xc_set_mem_access(xch, domain_id, default_access, STAR= T_PFN,
> +=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(xenaccess->= ;max_gpfn - START_PFN) );

So the reason why info->max_pages is no use any more is because A= RM
starts at non-zero and has multiple banks?

I suppose that's fair enough.

Ian.


Yeap. It's not a= problem to start at 0, this is just a bit of optimization from the user= 9;s side that I would consider best-practice. The user could also include s= ome logic to skip the hole in-between the banks (if there are multiple bank= s), but that I felt is too much complexity to include here.

Tamas
--001a11c3bcccaa64370503d1d8a8-- --===============3836814947526191849== 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 --===============3836814947526191849==--