Re: [PATCH 2/3] drm/amdgpu: fix VM update overrun on non-4K page kernels

From: Christian König

Date: Mon Aug 10 2026 - 09:24:55 EST




On 8/8/26 19:03, Junrui Luo wrote:
> On Thu, Aug 06, 2026 at 01:59:52PM +0200, Christian König wrote:
>>
>> That check is clearly not correct. The pages_addr must be fully consumed, otherwise we run into major problems later on.
>
> Is that an invariant today? num_entries <= AMDGPU_GPU_PAGES_IN_CPU_PAGE
> skips the scan and is used as it is, so on a 64K page kernel a 4K mapping
> maps a single GPU page and pages_addr is not consumed in whole CPU pages
> there either.

Exactly that doesn't work. On a 64K page kernel mappings *must* be 64K as well.

> So what should the code do for a mapping whose size is not a multiple of
> AMDGPU_GPU_PAGES_IN_CPU_PAGE? Could you sketch what you have in mind?

That case simply can't happen for user space allocations in the first place.

Regards,
Christian.

>
> Thanks,
> Junrui Luo