mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
f92f5da108
commit
27e27782f7
2 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue