[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/arm: Fix under-mapping in map_range_to_domain()



Hi Michal,

Sorry for the late reply.

On 12/10/2026 08:32, Orzel, Michal wrote:

I don't think we can reject unaligned regions in map_range_to_domain()
though, as the host DT is not under our control and hwdom would fail to
boot on platforms with sub-page devices. I asked AI to look at the Linux boards
for Arm and Arm64 (140 boards in total with unaligned regions) and even the
boards we claim to support have nodes that would fail:
- RPI4: hdmi@7ef00700, <0x7ef01f00 0x400>
- IMX8QXP: clock-controller@5b290004, <0x5b290004 0x10000>

I am not suggesting to reject unaligned regions when mapped into the
hardware domain. I am suggesting to reject it when we want to
passthrough to another domain. So we don't end up in a situation two
different devices on the same page are passthrough to two different
domains (or between Xen and a domain).

Codewise, it would mean map_range_to_domain() would enforce the
alignment and the caller will be left to decide what to do. We could
also decide about the alignment base don whether this is the HW domain
or not within the function.
For passthrough this is already the case. map_range_to_domain() does
not map anything for nodes with xen,passthrough and the domU mapping is done by
handle_passthrough_prop(), which rejects mstart, gstart and size that are not
page aligned.

The remaining case is the overlay which can be attached to any 1:1 domain and
this goes through handle_device() -> map_range_to_domain() without any alignment
check. All the other callers operate on hwdom, so I think we could reject a
region that is not page aligned if d is not the hardware domain, before granting
the iomem permission in map_range_to_domain().

Shouldn't we accept this patch as is so that we can backport (overlay is not
supported) it as a fix and then add a second one with a rejection mentioned
above that will help the overlay (and any future) case?

Thanks for the input. I didn't realise we would want to backport this patch. If so, I agree the split make sense.

Acked-by: Julien Grall <julien@xxxxxxx>

Cheers,

--
Julien Grall




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.