diff options
author | Gavin Shan | 2014-07-14 14:09:43 +0200 |
---|---|---|
committer | Alexander Graf | 2014-07-15 16:11:59 +0200 |
commit | 27e27782f78212cbd97170b0854c35a0738cfd34 (patch) | |
tree | b89877a5020186b5f4fcd49a2cfebdd5389c433d /hw/misc | |
parent | spapr: Enable use of huge pages (diff) | |
download | qemu-27e27782f78212cbd97170b0854c35a0738cfd34.tar.gz qemu-27e27782f78212cbd97170b0854c35a0738cfd34.tar.xz qemu-27e27782f78212cbd97170b0854c35a0738cfd34.zip |
sPAPR/IOMMU: Fix TCE entry permission
The permission of TCE entry should exclude physical base address.
Otherwise, unmapping TCE entry can be interpreted to mapping TCE
entry wrongly for VFIO devices.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/misc')
-rw-r--r-- | hw/misc/vfio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index aef4c9ce9d..0b9eba0c84 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -2489,7 +2489,7 @@ static void vfio_iommu_map_notify(Notifier *n, void *data) return; } - if (iotlb->perm != IOMMU_NONE) { + if ((iotlb->perm & IOMMU_RW) != IOMMU_NONE) { vaddr = memory_region_get_ram_ptr(mr) + xlat; ret = vfio_dma_map(container, iotlb->iova, |