]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
xen/arm: call iomem_permit_access for passthrough devices
authorStefano Stabellini <sstabellini@kernel.org>
Wed, 15 Apr 2020 01:02:55 +0000 (18:02 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 27 May 2020 20:21:22 +0000 (13:21 -0700)
iomem_permit_access should be called for MMIO regions of devices
assigned to a domain. Currently it is not called for MMIO regions of
passthrough devices of Dom0less guests. This patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Acked-by: Julien Grall <julien@xen.org>
xen/arch/arm/domain_build.c

index 3d7a75c31881f98d34cb4d9397f1e08ea5bcd0cd..e824ba34b012556b908d323f8fc5b9a03980ef1c 100644 (file)
@@ -1804,6 +1804,17 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
             return -EINVAL;
         }
 
+        res = iomem_permit_access(kinfo->d, paddr_to_pfn(mstart),
+                                  paddr_to_pfn(PAGE_ALIGN(mstart + size - 1)));
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to permit to dom%d access to"
+                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
+                   kinfo->d->domain_id,
+                   mstart & PAGE_MASK, PAGE_ALIGN(mstart + size) - 1);
+            return res;
+        }
+
         res = map_regions_p2mt(kinfo->d,
                                gaddr_to_gfn(gstart),
                                PFN_DOWN(size),