]> xenbits.xensource.com Git - xen.git/commitdiff
AMD/IOMMU: don't increase perms when splitting superpage
authorJan Beulich <jbeulich@suse.com>
Fri, 20 Aug 2021 10:31:08 +0000 (12:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 Aug 2021 10:31:08 +0000 (12:31 +0200)
The old (super)page's permissions ought to be propagated, rather than
blindly allowing both reads and writes.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/amd/iommu_map.c

index 1ed39bbee5c2d5ab6a33b6fd4437f6d136ec1c09..0d4dd7cc37fe17a487baa5bb85b94fd429e8d056 100644 (file)
@@ -231,7 +231,7 @@ static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
             next_table_mfn = mfn_x(page_to_mfn(table));
 
             set_iommu_ptes_present(next_table_mfn, pfn, mfn, PTE_PER_TABLE_SIZE,
-                                   next_level, true, true);
+                                   next_level, pde->iw, pde->ir);
             smp_wmb();
             set_iommu_pde_present(pde, next_table_mfn, next_level, true,
                                   true);