[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH qemu v15 03/17] vfio: Check that IOMMU MR translates t
From: |
Alexey Kardashevskiy |
Subject: |
[Qemu-ppc] [PATCH qemu v15 03/17] vfio: Check that IOMMU MR translates to system address space |
Date: |
Mon, 4 Apr 2016 19:33:32 +1000 |
At the moment IOMMU MR only translate to the system memory.
However if some new code changes this, we will need clear indication why
it is not working so here is the check.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: David Gibson <address@hidden>
---
Changes:
v15:
* added some spaces
v14:
* new to the series
---
hw/vfio/common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 27753d8..23dd738 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -266,6 +266,12 @@ static void vfio_iommu_map_notify(Notifier *n, void *data)
trace_vfio_iommu_map_notify(iova, iova + iotlb->addr_mask);
+ if (iotlb->target_as != &address_space_memory) {
+ error_report("Wrong target AS \"%s\", only system memory is allowed",
+ iotlb->target_as->name ? iotlb->target_as->name : "none");
+ return;
+ }
+
/*
* The IOMMU TLB entry we have just covers translation through
* this IOMMU to its immediate target. We need to translate
--
2.5.0.rc3
- [Qemu-ppc] [PATCH qemu v15 00/17] spapr: vfio: Enable Dynamic DMA windows (DDW), Alexey Kardashevskiy, 2016/04/04
- [Qemu-ppc] [PATCH qemu v15 03/17] vfio: Check that IOMMU MR translates to system address space,
Alexey Kardashevskiy <=
- [Qemu-ppc] [PATCH qemu v15 01/17] memory: Fix IOMMU replay base address, Alexey Kardashevskiy, 2016/04/04
- [Qemu-ppc] [PATCH qemu v15 11/17] vfio: spapr: Add SPAPR IOMMU v2 support (DMA memory preregistering), Alexey Kardashevskiy, 2016/04/04
- [Qemu-ppc] [PATCH qemu v15 02/17] vmstate: Define VARRAY with VMS_ALLOC, Alexey Kardashevskiy, 2016/04/04
- [Qemu-ppc] [PATCH qemu v15 10/17] memory: Add reporting of supported page sizes, Alexey Kardashevskiy, 2016/04/04
- [Qemu-ppc] [PATCH qemu v15 06/17] spapr_iommu: Finish renaming vfio_accel to need_vfio, Alexey Kardashevskiy, 2016/04/04
- [Qemu-ppc] [PATCH qemu v15 12/17] spapr_pci: Add and export DMA resetting helper, Alexey Kardashevskiy, 2016/04/04