lkml.org 
[lkml]   [2022]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 6/6] arm/xen: Assign xen-virtio DMA ops for virtio devices in Xen guests
Date
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Call xen_virtio_setup_dma_ops() only for Xen-aware virtio devices
in Xen guests if restricted access to the guest memory is enabled.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
include/xen/arm/xen-ops.h | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/include/xen/arm/xen-ops.h b/include/xen/arm/xen-ops.h
index 621da05..28b2ad3 100644
--- a/include/xen/arm/xen-ops.h
+++ b/include/xen/arm/xen-ops.h
@@ -2,12 +2,19 @@
#ifndef _ASM_ARM_XEN_OPS_H
#define _ASM_ARM_XEN_OPS_H

+#include <linux/virtio_config.h>
#include <xen/swiotlb-xen.h>
+#include <xen/xen-ops.h>

static inline void xen_setup_dma_ops(struct device *dev)
{
if (xen_swiotlb_detect())
dev->dma_ops = &xen_swiotlb_dma_ops;
+
+#ifdef CONFIG_XEN_VIRTIO
+ if (arch_has_restricted_virtio_memory_access() && xen_is_virtio_device(dev))
+ xen_virtio_setup_dma_ops(dev);
+#endif
}

#endif /* _ASM_ARM_XEN_OPS_H */
--
2.7.4
\
 
 \ /
  Last update: 2022-04-14 21:21    [W:0.176 / U:1.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site