From: Peter Xu Date: Fri, 19 May 2017 03:19:45 +0000 (+0800) Subject: intel_iommu: use IOMMU_ACCESS_FLAG() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5a38cb5940f71254e7dcc4bce7ffca8c2102f0ec;p=qemu.git intel_iommu: use IOMMU_ACCESS_FLAG() We have that now, so why not use it. Signed-off-by: Peter Xu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Jason Wang --- diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index b4771430e0..3240e5de37 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1010,7 +1010,7 @@ out: entry->iova = addr & page_mask; entry->translated_addr = vtd_get_slpte_addr(slpte) & page_mask; entry->addr_mask = ~page_mask; - entry->perm = (writes ? 2 : 0) + (reads ? 1 : 0); + entry->perm = IOMMU_ACCESS_FLAG(reads, writes); } static void vtd_root_table_setup(IntelIOMMUState *s)