[PATCH v3 0/4] Add vm_bind param check to ensure no overlap with kbo AS carveout

From: Adrián Larumbe

Date: Mon Jun 29 2026 - 16:18:23 EST


Just a quick check to make sure user-supplied vm_bind regions aren't
clashing with the region reserved for kernel bo's.

I tried to introduce a similar check for panthor_vm_alloc_va(), to throw
back an error when mappings of kernel bo's against specific addresses fall
within the auto_va region. However that is not possible, since there's one
FW region that must be mapped right at CSF_MCU_SHARED_REGION_START. That
is usually not a problem, since drm_mm_insert_node_in_range() will pick
the next one available.

v3 also comes with an early bind range overflow check for sparse mappings.

Signed-off-by: Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx>
---
Changes in v3:
- Fixed off-by-one error for user va range calculations.
- Added new commit for panthor_vm_prepare_unmap_op_ctx to take a whole operation.
- Added commit with bind range early overflow check.
- Link to v2: https://patch.msgid.link/20260619-vm_bind_checks-v2-0-b51abab35f71@xxxxxxxxxxxxx

Changes in v2:
- Simplified user VA range with kernel BO range overlap to a single statement.
- Link to v1: https://patch.msgid.link/20260616-vm_bind_checks-v1-0-956198602ae3@xxxxxxxxxxxxx

To: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
To: Steven Price <steven.price@xxxxxxx>
To: Liviu Dudau <liviu.dudau@xxxxxxx>
To: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
To: Maxime Ripard <mripard@xxxxxxxxxx>
To: Thomas Zimmermann <tzimmermann@xxxxxxx>
To: David Airlie <airlied@xxxxxxxxx>
To: Simona Vetter <simona@xxxxxxxx>
To: Heiko Stuebner <heiko@xxxxxxxxx>
To: Grant Likely <grant.likely@xxxxxxxxxx>
To: Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

---
Adrián Larumbe (4):
drm/panthor: Add vm_bind region with kbo range overlap check
drm/panthor: Fix comment to reflect actual struct field name
drm/panthor: Have prepare_unmap_op_ctx receive a whole vm_bind op
drm/panthor: Check for sparse binding range overflow

drivers/gpu/drm/panthor/panthor_mmu.c | 42 +++++++++++++++++++++++++++--------
1 file changed, 33 insertions(+), 9 deletions(-)
---
base-commit: 8fca3d8dbebf8d960dad7b10db3cb4a61139454b
change-id: 20260614-vm_bind_checks-46075ba069a0

Best regards,
--
Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx>