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

Re: [Xen-devel] [RFC PATCH] xen/gntdev: Stop abusing DT of_dma_configure API


  • To: Robin Murphy <robin.murphy@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, Rob Herring <robh@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Thu, 26 Sep 2019 11:16:46 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=ISxund8ZLkCm9KPxkGZUMFADQwJSZft4ADgIcincfr0=; b=Nn9uqv17nJmuva+BpA+YXQo3qGYcASpGCMa42jipoWWmThL4MSZmMTyXWR+YVTiavDgkXLUrYbGJZd3Uj2jie4y4krRb1Jwk17S//ZG6RDB6ulFVRi5kn9U02wApXnx2KasJWGXtQbUQnJHwJ1F0L0yyymvoHtKgvim0wxwUnKZNDerZQ/IaYxxpIMtG2NldKsyksU7UUWTJeVQy/yziWYjfjyft6jIgH5PACe/BI4f5iZW6S5xIQt7db3X79iAgP5fnqEesWC8+FBgLMZS6FJHg6uxFaCoyyH+bQgGyqwspTIk1TOcffXcOZGy+5qR9ilhxJGBjOlQRfEssziosJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dFSvtQkvFExxbJtXiM4VpIUkePG0c/H4k19/NvY5wRZASSBhgWbNup3rio211QJ5e9IGoXLG3iqdkx+ZSyd9lOJiq6lBEB3JcZMQxRjhU1SLucThM70y1cIY5p6dOFBE165UHJE7GQyWU6hsnCrua9b0IDmps88ln5Fs8Io3Go7v2jcIkpZx9960bcQj4dqnHYLyNhx+zbO2fyJDbpfiFybs+NJIEhlS6wHMuEgNuureF1kXthdiW1rUB8DNyH2GjCzuZfx9MM83zeHnTJIhY6vIewJY57AgfAEDD/qcgST4t5iFhZjX8x2XCo/uzEOM7TC8rW+/rXeWBGLkgneZ3w==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Oleksandr_Andrushchenko@xxxxxxxx;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Nicolas Saenz Julienne <nsaenzjulienne@xxxxxxx>
  • Delivery-date: Thu, 26 Sep 2019 11:16:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVc+s0RRpCCJNN+0uv/ZIcTqnc7ac9t66AgAAHl4CAAAgUAIAACJOA
  • Thread-topic: [RFC PATCH] xen/gntdev: Stop abusing DT of_dma_configure API

On 9/26/19 1:46 PM, Robin Murphy wrote:
> On 2019-09-26 11:17 am, Oleksandr Andrushchenko wrote:
>>
>> On 9/26/19 12:49 PM, Julien Grall wrote:
>>> Hi Rob,
>>>
>>>
>>> On 9/25/19 10:50 PM, Rob Herring wrote:
>>>> As the comment says, this isn't a DT based device. of_dma_configure()
>>>> is going to stop allowing a NULL DT node, so this needs to be fixed.
>>>
>>> And this can't work on arch not selecting CONFIG_OF and can select
>>> CONFIG_XEN_GRANT_DMA_ALLOC.
>>>
>>> We are lucky enough on x86 because, AFAICT, arch_setup_dma_ops is just
>>> a nop.
>>>
>> No luck is needed as [1] does nothing for those platforms not using
>> CONFIG_OF
>>>>
>>>> Not sure exactly what setup besides arch_setup_dma_ops is needed...
>>>
>>> We probably want to update dma_mask, coherent_dma_mask and
>>> dma_pfn_offset.
>>>
>>> Also, while look at of_configure_dma, I noticed that we consider the
>>> DMA will not be coherent for the grant-table. Oleksandr, do you know
>>> why they can't be coherent?
>> The main and the only reason to use of_configure_dma is that if we don't
>> then we
>> are about to stay with dma_dummy_ops [2]. It effectively means that
>> operations on dma-bufs
>> will end up returning errors, like [3], [4], thus not making it possible
>> for Xen PV DRM and DMA
>> part of gntdev driver to do what we need (dma-bufs in our use-cases
>> allow zero-copying
>> while using graphics buffers and many more).
>>
>> I didn't find any better way of achieving that, but of_configure_dma...
>> If there is any better solution which will not break the existing
>> functionality then
>> I will definitely change the drivers so we do not abuse DT )
>> Before that, please keep in mind that merging this RFC will break Xen PV
>> DRM +
>> DMA buf support in gntdev...
>> Hope we can work out some acceptable solution, so everyone is happy
>
> As I mentioned elsewhere, the recent dma-direct rework means that 
> dma_dummy_ops are now only explicitly installed for the ACPI error 
> case, so - much as I may dislike it - you should get regular 
> (direct/SWIOTLB) ops by default again.
Ah, my bad, I missed that change. So, if no dummy dma ops are to be used 
then
I believe we can apply both changes, e.g. remove of_dma_configure from 
both of the drivers.
>
> Coherency is trickier - if the guest is allocating buffers for the PV 
> device, which may be shared directly with hardware by the host driver, 
> then the coherency of the PV device should really reflect that of the 
> underlying hardware to avoid potential problems. There are some cases 
> where the stage 2 attributes alone wouldn't be enough to correct a 
> mismatch.
>
> Robin.
Thank you,
Oleksandr
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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