> From: Jason Gunthorpe <[email protected]>
> Sent: Saturday, November 8, 2025 12:50 AM
> +
> +static int pfn_reader_fill_dmabuf(struct pfn_reader_dmabuf *dmabuf,
> + struct pfn_batch *batch,
> + unsigned long start_index,
> + unsigned long last_index)
> +{
> + unsigned long start = dmabuf->start_offset + start_index * PAGE_SIZE;
> +
> + /*
> + * This works in PAGE_SIZE indexes, if the dmabuf is sliced and
> + * starts/ends at a sub page offset then the batch to domain code will
> + * adjust it.
> + */
dmabuf->start_offset comes from pages->dmabuf.start, which is initialized as:
pages->dmabuf.start = start - start_byte;
so it's always page-aligned. Where is the sub-page offset coming from?
> @@ -1687,6 +1737,12 @@ static void __iopt_area_unfill_domain(struct
> iopt_area *area,
>
> lockdep_assert_held(&pages->mutex);
>
> + if (iopt_is_dmabuf(pages)) {
> + iopt_area_unmap_domain_range(area, domain, start_index,
> + last_index);
> + return;
> + }
> +
this belongs to patch3?
Reviewed-by: Kevin Tian <[email protected]>