From: Stefano Stabellini Date: Wed, 15 Apr 2020 01:02:55 +0000 (-0700) Subject: xen/arm: call iomem_permit_access for passthrough devices X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~197 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6b75c7a95420acbb9c118624ff0a5e973287c1e4;p=xen.git xen/arm: call iomem_permit_access for passthrough devices 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 Acked-by: Julien Grall --- diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 3d7a75c318..e824ba34b0 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -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),