[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN v2] xen/arm64: io: Decode 32-bit ldr/str post-indexing instructions


  • To: Andre Przywara <andre.przywara@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 1 Dec 2021 13:02:27 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+ZLyFXtU+qxq8Gam5maldnYSMZEm7r1hmDKd6T8okO8=; b=PrJ7pBWUAOcMwvvgpRb3EfskxhSprhxYlfPw/Jd60CKZn2JgSeDAL4OAGlct5Oz5jCXJl66H00d3V83fgsOS0abDgXXlKl+vwkcO8lwGr8mMkJG1+LOdIXkAEfUugZwYM6ykBXnLr96IHQ/orbvFgGbQZldQ10JXlcvihC3xzPfETDbnH3v5Z9wcAzA5cwabUVZrSOoJ0vU6ncjTfwR/DLX+I3VG0d8hz9CY4VM7UeSSwLhLshAr5OwVP5JBkZFO+v+stVUXEWRC/dUSKIBnQ8Wkh1Qj0tXU5ka5Pmmrq80c129Xj1GIjcrxBzq7DfCz9bAJ2oh2cLfdJApVk8Xyeg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TG29IB6FxAx7frFv8OgKgu2thOnNZrPvkNHRNb0cz2oxRQ+2JxefX2xlWJjsqzOoJscLiTGWHZ66/uAcwHxFe5BSN/zmxKJn2VFCF5KhAtuDgFuriNdXY/i6iORyyZeiT2fNbpwu3r2H+ZGkdnFOL20Nn5yHgqIx0Y2OTKGYOX6pWOZSlWi9+QnVXb7i/aPqMLU2qdFH26xFv8Adx34eqAyhaU+FADAKsjjZEl/EqsQ3poCEbyT6SsEuPttHD5EWQQypz5kif5H1BOwHkDeUCMagSxd4mGs5i9jOUy1zhc9u8op+Mk/2ctGBUJKCP0gVCr4ehbIyuK8LD5uBo/yF+A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, stefanos@xxxxxxxxxx, julien@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx>
  • Delivery-date: Wed, 01 Dec 2021 12:02:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.12.2021 12:58, Andre Przywara wrote:
> On Tue, 30 Nov 2021 19:13:41 +0000
> Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx> wrote:
>> On 30/11/2021 09:49, Andre Przywara wrote:
>>> On Mon, 29 Nov 2021 19:16:38 +0000
>>> Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx> wrote:
>>>> At the moment, Xen is only handling data abort with valid syndrome (i.e.
>>>> ISV=0). Unfortunately, this doesn't cover all the instructions a domain
>>>> could use to access MMIO regions.
>>>>
>>>> For instance, Xilinx baremetal OS will use:
>>>>
>>>>          volatile u32 *LocalAddr = (volatile u32 *)Addr;
>>>>          *LocalAddr = Value;
>>>>
>>>> This leave the compiler to decide which store instructions to use.  
>>>
>>> As mentioned in the other email, this is wrong, if this points to MMIO:
>>> don't let the compiler do MMIO accesses. If a stage 2 fault isn't in
>>> an MMIO area, you should not see traps that you cannot handle already.
>>>
>>> So I don't think it's a good idea to use that as an example. And since
>>> this patch only seems to address this use case, I would doubt its
>>> usefulness in general.  
>> Yes, I should have fixed the comment.
>>
>> Currently, I am testing with baremetal app which uses inline assembly 
>> code with post indexing instructions, to access the MMIO.
>>
>> ATM, I am testing with 32 bit MMIO only.
>>
>> On the usefulness, I am kind of torn as it is legitimate for post 
>> indexing instructions to be used in an inline-assembly code for 
>> accessing MMIO. However, that may not be something commonly seen.
> 
> It is legitimate, but I question the usefulness: for a start it wouldn't
> work under today's Xen (or KVM), and I doubt this would be backported. So
> you would always require users to use the newest version of the hypervisor.
> Also MMIO accesses are slow anyway, so while using post-indexing might be
> convenient from an assembly writer's point of view, it doesn't give you
> much performance-wise, probably.

Just so it gets mentioned: Smaller code size may also be a consideration
here, beyond the more general one about performance.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.