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

Re: [PATCH v2 8/8] xen/arm: Add support for SMMUv3 driver


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Mon, 7 Dec 2020 08:33:36 +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=5x7ZIarv5NJNQsVwJ/NCQ2f8jE3i9jzD+g2YJKYMKlQ=; b=WLCHfmKyfFIceH0Tfn/WdjtAnC0U32MSfEhJ/gD0p7Xr5pa+rnHTP8/sfxq4oU5UFOtZycTGTUquTJIGo/uvpjuF+D34h6JjIoYBINUigzw1yEEghRepH8xH7gwkcY3F1dDZ+n3rKkglPMc7S99AQCZ7a3vrXCCYO7AFKgOzpVT+9b3fubLEEyrl4wNML8vRxulPFctVONyXNUZY9l+OmydyGvBkQtHgW2z0Nb2Z5jqk0BBzBxL9mmhI+m6aIL7LOm3zIle2uPFc8CRGFw83C3ncVSVPZuQydw/UZbARk1KYwcoU4PhTBDwJt0pT0JDR7XN22Pr+TMgUnjpqmJ5OMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EPE2tInPFDhAMzHAkblyhFJ27/Tse3AkrqIw6kTCZ+sO5JOrnfpi0hlSNQe5N42t3no4G4Tbc6QarrX1YXpRsDF6PrVH2qHym877wVC4ijJd87xP+EZZgAupT/pGtziWh/J3fo+zkVpvm12qd4qzLR0XkaH3H1VltMfcNijwl/vaICgotOgU72n1bYa7WU1AtyG3T2fpjeRXxKiwlEqV2e76IvXes2dY8nxOKW5j6MiTsYQdJQM3qlcdEJ6mF4vJ2Cvi6xQJshSb2aQtreKoa7DVcyaFWm2+4RAOYwIG5dv1P6WEIg2BDNqM+v13lFnry87DStaOulB+FAzyoTx5bw==
  • Authentication-results-original: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Cc: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 07 Dec 2020 08:34:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWxBX/ttp8YMNqT0KunkbXuSldmKnjI/iAgADpk4CAAL+AgIAAr2CAgABFBACABZ2zgA==
  • Thread-topic: [PATCH v2 8/8] xen/arm: Add support for SMMUv3 driver

Hello Stefano,

> On 3 Dec 2020, at 6:47 pm, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> On Thu, 3 Dec 2020, Rahul Singh wrote:
>>> On 3 Dec 2020, at 4:13 am, Stefano Stabellini <sstabellini@xxxxxxxxxx> 
>>> wrote:
>>> On Wed, 2 Dec 2020, Julien Grall wrote:
>>>> On 02/12/2020 02:51, Stefano Stabellini wrote:
>>>>> On Thu, 26 Nov 2020, Rahul Singh wrote:
>>>>>> +/* Alias to Xen device tree helpers */
>>>>>> +#define device_node dt_device_node
>>>>>> +#define of_phandle_args dt_phandle_args
>>>>>> +#define of_device_id dt_device_match
>>>>>> +#define of_match_node dt_match_node
>>>>>> +#define of_property_read_u32(np, pname, out) (!dt_property_read_u32(np,
>>>>>> pname, out))
>>>>>> +#define of_property_read_bool dt_property_read_bool
>>>>>> +#define of_parse_phandle_with_args dt_parse_phandle_with_args
>>>>> 
>>>>> Given all the changes to the file by the previous patches we are
>>>>> basically fully (or almost fully) adapting this code to Xen.
>>>>> 
>>>>> So at that point I wonder if we should just as well make these changes
>>>>> (e.g. s/of_phandle_args/dt_phandle_args/g) to the code too.
>>>> 
>>>> I have already accepted the fact that keeping Linux code as-is is nearly
>>>> impossible without much workaround :). The benefits tends to also limited 
>>>> as
>>>> we noticed for the SMMU driver.
>>>> 
>>>> I would like to point out that this may make quite difficult (if not
>>>> impossible) to revert the previous patches which remove support for some
>>>> features (e.g. atomic, MSI, ATS).
>>>> 
>>>> If we are going to adapt the code to Xen (I'd like to keep Linux code style
>>>> though), then I think we should consider to keep code that may be useful in
>>>> the near future (at least MSI, ATS).
>>> 
>>> (I am fine with keeping the Linux code style.)
>>> 
>>> We could try to keep the code as similar to Linux as possible. This
>>> didn't work out in the past.
>>> 
>>> Otherwise, we could fully adapt the driver to Xen. If we fully adapt the
>>> driver to Xen (code style aside) it is better to be consistent and also
>>> do substitutions like s/of_phandle_args/dt_phandle_args/g. Then the
>>> policy becomes clear: the code comes from Linux but it is 100% adapted
>>> to Xen.
>>> 
>>> 
>>> Now the question about what to do about the MSI and ATS code is a good
>>> one. We know that we are going to want that code at some point in the
>>> next 2 years. Like you wrote, if we fully adapt the code to Xen and
>>> remove MSI and ATS code, then it is going to be harder to add it back.
>>> 
>>> So maybe keeping the MSI and ATS code for now, even if it cannot work,
>>> would be better. I think this strategy works well if the MSI and ATS
>>> code can be disabled easily, i.e. with a couple of lines of code in the
>>> init function rather than #ifdef everywhere. It doesn't work well if we
>>> have to add #ifdef everywhere.
>>> 
>>> It looks like MSI could be disabled adding a couple of lines to
>>> arm_smmu_setup_msis.
>>> 
>>> Similarly ATS seems to be easy to disable by forcing ats_enabled to
>>> false.
>>> 
>>> So yes, this looks like a good way forward. Rahul, what do you think?
>> 
>> 
>> I am ok to have the PCI ATS and MSI functionality in the code. 
>> As per the discussion next version of the patch will include below 
>> modification:Please let me know if there are any suggestion overall that 
>> should be added in next version.
>> 
>> 1. Keep the PCI ATS and MSI functionality code.
> 
> I'll repeat one point I wrote above that I think it is important: please
> try to disable ATS and MSI without invasive changes, ideally just a
> couple of lines to force-disable each feature

Yes I will disable the feature.
> 
> 
>> 2. Make the code with XEN compatible ( remove linux compatibility functions)
>> 3. Keep the Linux coding style for code imported from Linux.
>> 4. Fix all comments.
> 
> Sounds good.
> 
> 
>> I have one query what will be coding style for new code to make driver work  
>> for XEN ? 
> 
> We try to keep the same code style for the entirety of a source file. In
> this case, the whole driver should use Linux code style (both imported
> code and new code).

Ok.

Regards,
Rahul   


 


Rackspace

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