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

Re: [XEN PATCH v1] xen/arm : Add support for SMMUv3 driver


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 30 Oct 2020 11:33:29 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-SenderADCheck; bh=h2qMybRCDFhgG6MNeBGmhEN/2We65xIKDLyNqtdOX5g=; b=fSTa9GSTLD78iG00KF+E1W33cwtWAvrUcChF4EHOc7I6bXgMQJRGfxKDJge+pQIhuiBaO1g05glkT2CI1YR4w75U3i+lfPFHNtclao1RDziimlTcXDYTIFu9sKxXOh5HmKDNi9iRyo2+5tCGjJ93V0GIDOu7vQxniLpssvRnBlRpaIW7U1dcUV+JqwLNmxXCck0Z8BqMKDRL/Fs7xmqhfoQbS/vgtB3HOd913fJLWzntJCI544H+SrmGw9yNF8snQOfwFhilG5giIdtgTp1LY8uoh1iRLN+SP2EhX29+JIb8c2bLXTrWR6kXf+4Rk9V3Wg/YqR6sDd64cgogNUrRaA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUv1EJVUJ6kZqLgnlNAR7JsARWTteCCCLX9ifXoYZRAaOVYRexFFNZCvDTCi0mOYRBb/34kHMn/Zf+Ybj0Rh+HrvqCu5urObIZwc5QpAFW0EbdU/hC63nPK6+Eyv7EDcITHqug9g49NiYdbdfOOn6r9vkSRLbtonXXXbNQtPrPXBO5tiLHi1BFe6W0Qv+aFSny0ZpFkMGUR63Mx97mKvY+UtDY2/gaLRMschobu568jEd0D3hDhIUts8QpdawcsTE+VN/toEIx3cRCnmLx5c9uN9o4H9HX6+H1gG0PeRPLIB1hygH/nDxYTzBCkTaZYF5SPjbqu5MAKCAp9XGo8Zrw==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 30 Oct 2020 11:33:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWoVvrkmJwOYERdUOadvid1OghFamgw0AAgAEzsQCAAWIugIABA+CAgADBXICAABfBAIAAGI6AgAAOSACABG94AIADrVCAgAFBfQCAAGM1gIAA0RiAgAAJ+ACAAAarAIAABWQAgAAYtgA=
  • Thread-topic: [XEN PATCH v1] xen/arm : Add support for SMMUv3 driver

Hello Julien,

> On 30 Oct 2020, at 10:05 am, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 30/10/2020 09:45, Rahul Singh wrote:
>> Hello Julien,
>>> On 30 Oct 2020, at 9:21 am, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> Hi,
>>> 
>>> On 30/10/2020 08:46, Rahul Singh wrote:
>>>> Ok Yes when I ported the driver I port the command queue operation from 
>>>> the previous commit where atomic operations is not used and rest all the 
>>>> code is from the latest code. I will again make sure that any bug that is 
>>>> fixed in Linux should be fixed in XEN also.
>>> 
>>> I would like to seek some clarifications on the code because there seem to 
>>> be conflicting information provided in this thread.
>>> 
>>> The patch (the baseline commit is provided) and the discussion with 
>>> Bertrand suggests that you took a snapshot of the code last year and 
>>> adapted for Xen.
>>> 
>>> However, here you suggest that you took an hybrid approach where part of 
>>> the code is based from last year and other part is based from the latest 
>>> code (I assume v5.9).
>>> 
>>> So can you please clarify?
>>> 
>>> Cheers,
>> Approach I took is to first merge the code  from the commit ( Jul 2, 2019 
>> 7c288a5b27934281d9ea8b5807bc727268b7001a ) the snapshot before atomic 
>> operation is used in SMMUv3 code for command queue operations.
>> After that I fixed  the other code( not related to command queue 
>> operations.)  from the latest code so that no bug is introduced in XEN 
>> because of using the last year commit.
> 
> Ok. That was definitely not clear from the commit message. Please make this 
> clearer in the commit message.
> 

Ok. I will make this clearer in the commit message.

> Anway, it means we need to do a full review of the code (rather than a light 
> one) because of the hybrid model.
> 
> I am still a bit puzzle to why it would require almost of a restart of the 
> implementation in order to sync the latest code. Does it imply that you are 
> mostly using the old code?
> 

SMMuv3 code is divided into below parts :

1. Low-level/High level queue manipulation functions.
2. Context descriptor manipulation functions.
3. Stream table manipulation functions.
4. Interrupt handling.
5. Linux IOMMU API functions.
6. Driver initialisation functions( probe/reset ).

Low-level/High-level queue manipulation functions are from the old code, rest 
is the new code whenever it was possible.

I started with porting the latest code but there are many dependencies for the 
queue manipulation function so we decided to use the old queue manipulation 
function. 
As the queue manipulation function is a big part of the code it will require a 
lot of effort and testing to sync with the latest code once the atomic 
operation is in place to use.

Once atomic operation is available in XEN we have merge the below commit from 
Linux to XEN to make XEN in sync with Linux code.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/iommu/arm-smmu-v3.c?h=v5.8&id=587e6c10a7ce89a5924fdbeff2ec524fbd6a124b

> Cheers,
> 
> -- 
> Julien Grall

Regards,
Rahul




 


Rackspace

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