[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V1 6/6] arm/xen: Assign xen-grant DMA ops for xen-grant DMA devices
- To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
- From: Oleksandr <olekstysh@xxxxxxxxx>
- Date: Sun, 24 Apr 2022 19:07:23 +0300
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>
- Delivery-date: Sun, 24 Apr 2022 16:07:45 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 23.04.22 19:42, Christoph Hellwig wrote:
Hello Christoph
On Fri, Apr 22, 2022 at 07:51:03PM +0300, Oleksandr Tyshchenko wrote:
static inline void xen_setup_dma_ops(struct device *dev)
{
#ifdef CONFIG_XEN
- if (xen_swiotlb_detect())
+ if (arch_has_restricted_virtio_memory_access() &&
+ xen_is_grant_dma_device(dev))
+ xen_grant_setup_dma_ops(dev);
+ else if (xen_swiotlb_detect())
I don't think that arch_has_restricted_virtio_memory_access
check should be there as it still is a bit of a layering violation.
Well, I will remove it then (and update commit description).
For virtualized but non-virtio devices, it is not needed at all. For the
virtio devices, this check is already present at
virtio.c:virtio_features_ok()
--
Regards,
Oleksandr Tyshchenko
|