[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH/RFC 2/6] vfio: Ignore real IOMMUs if CONFIG_VFIO_NOI
From: |
Geert Uytterhoeven |
Subject: |
[Qemu-devel] [PATCH/RFC 2/6] vfio: Ignore real IOMMUs if CONFIG_VFIO_NOIOMMU=y |
Date: |
Fri, 9 Feb 2018 16:16:49 +0100 |
Allow use of the No-IOMMU mode even if a real IOMMU is present.
This is useful in case the device is not part of an actual IOMMU group.
Not-Signed-off-by: Geert Uytterhoeven <address@hidden>
---
Question:
- Some devices (e.g. rcar-gpio) don't use DMA, so why do they need an
IOMMU group?
- Even devices using DMA may do so using a separate DMAC module,
pointed to by "dmas" DT properties (e.g. sh-sci), hence they may be
not part of an IOMMU group.
- How to know which devices do DMA?
---
drivers/vfio/vfio.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 2bc3705a99bd2f1a..7736c3fbe468a3da 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -129,9 +129,13 @@ struct iommu_group *vfio_iommu_group_get(struct device
*dev)
* bus. We set iommudata simply to be able to identify these groups
* as special use and for reclamation later.
*/
- if (group || !noiommu || iommu_present(dev->bus))
+ if (group || !noiommu)
return group;
+ if (iommu_present(dev->bus))
+ dev_warn(dev, "iommu present (%ps), ignoring\n",
+ dev->bus->iommu_ops);
+
group = iommu_group_alloc();
if (IS_ERR(group))
return NULL;
--
2.7.4
- [Qemu-devel] [PATCH/RFC 0/6] R-Car Gen3 GPIO Pass-Through Prototype (Linux), Geert Uytterhoeven, 2018/02/09
- [Qemu-devel] [PATCH/RFC 4/6] arm64: renesas_defconfig: Enable VFIO_PLATFORM and VFIO_NOIOMMU, Geert Uytterhoeven, 2018/02/09
- [Qemu-devel] [PATCH/RFC 3/6] clk: renesas: r8a7795: Mark the GPIO6 clock critical, Geert Uytterhoeven, 2018/02/09
- [Qemu-devel] [PATCH/RFC 1/6] vfio: platform: Allow runtime override of reset_required, Geert Uytterhoeven, 2018/02/09
- [Qemu-devel] [PATCH/RFC 6/6] arm64: Add virt_defconfig, Geert Uytterhoeven, 2018/02/09
- [Qemu-devel] [PATCH/RFC 5/6] gpio: rcar: Add virtualization workarounds, Geert Uytterhoeven, 2018/02/09
- [Qemu-devel] [PATCH/RFC 2/6] vfio: Ignore real IOMMUs if CONFIG_VFIO_NOIOMMU=y,
Geert Uytterhoeven <=