All of lore.kernel.org
 help / color / mirror / Atom feed
* Workaround for partial huge page unmaps in Panthor
@ 2025-12-17 21:32 Adrián Larumbe
  2025-12-17 21:32 ` [PATCH v5 1/1] drm/panthor: Support partial unmaps of huge pages Adrián Larumbe
  0 siblings, 1 reply; 4+ messages in thread
From: Adrián Larumbe @ 2025-12-17 21:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: dri-devel, Steven Price, Boris Brezillon, kernel,
	Adrián Larumbe

This is v4 of [1]. This patch is a workaround for performing partial unmaps of a VM region backed
by huge pages. Since these are now disallowed, the patch makes sure unmaps are done on a backing
page-granularity, and then regions untouched by the VM_BIND unmap operation are restored.

A patch series with IGT tests to validate this functionality is found at [2].

Changelog:
v5:
 - Addressed minor formating nit.
 - Passedd right range value to panthor_vm_lock_region() rather than end address.
 - Added R-b tag.

v4:
 - Added VM lock for expanded unmap region.
 - No longer pass the original VMA when calculating expanded unmap address and ranges for
 calculating BO offsets, as this can be obtained from the map va op's
 - Added more comments and renamed the unmap boundary calculation function
 - Calculate prev and next map offsets, sizes and addresses in the block prelude for
 the sake of clarity.
 - Addressed some minor style nits.
 - Rebased the patch onto the latest drm-misc.

v3:
 - Reworked address logic so that prev and next gpuava_op's va's are used in the calculations
   instead of those of the original unmap vma.
 - Got rid of the return struct from get_map_unmap_intervals() and now reckon panthor_vm_map_pages()
   arguments by fiddlign with the gpuva's respective gem object offsets.
 - Use folio_size() instead of folio_order() because the latter implies page sizes from the
   CPU's MMU perspective, rather than that of the GPU.

v2:
 - Fixed bug caused by confusion between semantics of gpu_va prev and next ops boundaries
   and those of the original vma object.
 - Coalesce all unmap operations into a single one.
 - Refactored and simplified code.

[1] https://lore.kernel.org/dri-devel/20251214202426.3186811-1-adrian.larumbe@collabora.com/
[2] https://lore.kernel.org/igt-dev/20251213190205.2435793-1-adrian.larumbe@collabora.com/T/#

Adrián Larumbe (1):
  drm/panthor: Support partial unmaps of huge pages

 drivers/gpu/drm/panthor/panthor_mmu.c | 100 +++++++++++++++++++++++---
 1 file changed, 92 insertions(+), 8 deletions(-)

--
2.51.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-19 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17 21:32 Workaround for partial huge page unmaps in Panthor Adrián Larumbe
2025-12-17 21:32 ` [PATCH v5 1/1] drm/panthor: Support partial unmaps of huge pages Adrián Larumbe
2025-12-19 12:19   ` Steven Price
2025-12-19 12:32   ` Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.