Re: [PATCH v2 2/2] drm/imagination: Size page table preallocation by device address

From: Gyeyoung Baek

Date: Tue Oct 06 2026 - 04:17:13 EST


Hi Alessio, Brajesh,

>
> Somewhere in the description, could you also point out that the previous MMU
> page count calculation could underflow when a mapping crossed a page table
> boundary, that would lead to the driver preallocating a huge number of MMU
> pages, exhausting system memory (so more or less what Sashiko pointed out in v1
> of your VM_BIND series and in one of Brajesh's recent patches), and that the new
> calculation also fixes that? I think it's ok to fix these together, or anyway
> I'm fine with it in this case, but up to you if you'd rather split them.

Since it's all within one function, I think keeping it in a single
patch makes more sense.

> Due to all of these and the fact that these errors are easy to trigger from
> userspace, I think this patch needs Cc: stable@xxxxxxxxxxxxxxx below.
>

Agreed, will add.

> > @@ -2337,7 +2337,7 @@ void pvr_mmu_op_context_destroy(struct pvr_mmu_op_context *op_ctx)
> > * @ctx: MMU context associated with owning VM context.
> > * @sgt: Scatter gather table containing pages pinned for use by this context.
> > * @device_addr: Virtual device address at the start of the requested mapping.
> > - * @sgt_offset: Start offset of the requested device-virtual memory mapping.
> > + * @sgt_offset: Offset into @sgt of the start of the requested mapping.
>
> nit: could you also update the other similar description inside struct
> pvr_mmu_op_context?

I'll address the rest in v3 as well.

Thanks to both of you for the reviews!

--
Thanks,
Gyeyoung