]> xenbits.xensource.com Git - xen.git/commitdiff
Arm: relax iomem_access_permitted() check
authorJan Beulich <jbeulich@suse.com>
Thu, 19 Aug 2021 11:37:42 +0000 (13:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 19 Aug 2021 11:37:42 +0000 (13:37 +0200)
Ranges checked by iomem_access_permitted() are inclusive; to permit a
mapping there's no need for access to also have been granted for the
subsequent page.

Fixes: 80f9c3167084 ("xen/arm: acpi: Map MMIO on fault in stage-2 page table for the hardware domain")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/traps.c

index 4ccb6e7d18bb50a4371ceb2b350ef837558b68ee..219ab3c3fbdefa847a3d6fd7e3017b7080dcf363 100644 (file)
@@ -1893,7 +1893,7 @@ static bool try_map_mmio(gfn_t gfn)
         return false;
 
     /* The hardware domain can only map permitted MMIO regions */
-    if ( !iomem_access_permitted(d, mfn_x(mfn), mfn_x(mfn) + 1) )
+    if ( !iomem_access_permitted(d, mfn_x(mfn), mfn_x(mfn)) )
         return false;
 
     return !map_regions_p2mt(d, gfn, 1, mfn, p2m_mmio_direct_c);