Re: [PATCH 1/2] xen/swiotlb: relax alignment requirements

From: Jürgen Groß
Date: Wed Feb 12 2025 - 06:04:35 EST


On 12.02.25 07:53, Jan Beulich wrote:
On 11.02.2025 13:04, Juergen Gross wrote:
When mapping a buffer for DMA via .map_page or .map_sg DMA operations,
there is no need to check the machine frames to be aligned according
to the mapped areas size. All what is needed in these cases is that the
buffer is contiguous at machine level.

Is this really true in all cases? Can't e.g. compound pages make it here,
with the caller then still being permitted to assume higher than page
alignment? Alignment checking in xen_swiotlb_map_page() would perhaps
need doing with the base address of the incoming page, i.e. excluding
the incoming offset.

The DMA interfaces in question (.map_page and .map_sg) are explicitly
designed for DMA streaming mode. I don't think streaming mode requires a
special page alignment.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature