linux/drivers/gpu
Gyeyoung Baek 789f290b2e drm/imagination: Size page table preallocation by device address
Commit 0a8224058a ("drm/imagination: Fix page count for page table for
map() interface") passed the device address to
pvr_mmu_op_context_create(), but the preallocation is still sized from
device_addr + sgt_offset with an exclusive end. The offset into the
object's pages has no place in a device-virtual range, and the exclusive
end allocates one table too many when the range ends on a table
boundary.

Count the tables from device_addr and the inclusive end of the range.

The new calculation does not take page table indices into account. This
fixes another issue with the previous implementation, where the
difference between start and end indices could underflow when a mapping
crossed a page table boundary. This would lead to the driver
preallocating a huge number of MMU pages, exhausting system memory and
triggering an out of memory panic.

Fixes: 0a8224058a ("drm/imagination: Fix page count for page table for map() interface")
Fixes: ff5f643de0 ("drm/imagination: Add GEM and VM related code")
Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
Reviewed-by: Brajesh Gupta <brajesh.gupta@imgtec.com>
Reviewed-by: Alessio Belle <alessio.belle@imgtec.com>
Cc: stable@vger.kernel.org
[Alessio: add paragraph to point out OOM bug being fixed, cc stable]
Link: https://patch.msgid.link/20261001-pvr-fixes-a-v2-2-f58254e5dfb8@gmail.com
Signed-off-by: Alessio Belle <alessio.belle@imgtec.com>
2026-10-08 10:32:31 +01:00
..
drm drm/imagination: Size page table preallocation by device address 2026-10-08 10:32:31 +01:00
host1x Linux 7.2 2026-08-20 10:58:44 +10:00
ipu-v3
nova-core drm for 7.3-rc1 2026-08-21 08:41:00 -07:00
tests drm/tests/gpu_buddy: fix interleaving in buffer clearance test 2026-08-06 18:07:10 +05:30
trace
vga
buddy.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
Kconfig gpu: Fix dependencies in CONFIG_GPU_BUDDY_KUNIT_TEST 2026-07-29 13:06:24 +02:00
Makefile