All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Arm: relax iomem_access_permitted() check
@ 2021-08-18  7:52 Jan Beulich
  2021-08-18 17:44 ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2021-08-18  7:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, Stefano Stabellini, Volodymyr Babchuk

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>

--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -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);



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-19  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18  7:52 [PATCH] Arm: relax iomem_access_permitted() check Jan Beulich
2021-08-18 17:44 ` Julien Grall
2021-08-19  8:11   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.