Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/tyr: fix partial 2MB block unmaps on GPUVM remap
@ 2026-11-17 19:32 Alice Ryhl
  2026-11-17 19:32 ` [PATCH 1/4] rust: drm/gpuvm: add GpuVa::data_ref accessor Alice Ryhl
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alice Ryhl @ 2026-11-17 19:32 UTC (permalink / raw)
  To: Daniel Almeida, Deborah Brouwer, Sami Tolvanen
  Cc: Danilo Krummrich, Matthew Brost, Thomas Hellström,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Trevor Gross, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Boris Brezillon, dri-devel,
	rust-for-linux, linux-kernel, iommu, Alice Ryhl

Tyr configures its ARM64 LPAE page tables with 4KB and 2MB block sizes,
but arm-lpae rejects unmapping part of a 2MB block. As a result, a
partial unmap or overlapping remap that splits a 2MB block in
GpuVmData::sm_step_remap() fails in __arm_lpae_unmap().

This series ports the remap fix and supporting accessors from tyr-dev
onto drm-rust-next, along with a defensive bounds check in pt_unmap():

1. Add the GpuVa::data_ref() accessor.
2. Add the IoPageTable::iova_to_phys() accessor.
3. Expand sub-block unmaps in sm_step_remap() to 2MB boundaries when
   the swept head/tail fragment is physically contiguous, widen the AS
   lock over the expanded range, rebuild the surviving fragments, and
   take the preallocated GPUVAs before mutating page tables.
4. Check the remaining-length subtraction in pt_unmap() against
   underflow.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Sami Tolvanen (4):
      rust: drm/gpuvm: add GpuVa::data_ref accessor
      rust: iommu: pgtable: add iova_to_phys
      drm/tyr: vm: expand sub-block unmaps to 2MB boundaries on remap
      drm/tyr: vm: check the remaining length in pt_unmap()

 drivers/gpu/drm/tyr/mmu.rs               |  13 +++
 drivers/gpu/drm/tyr/mmu/address_space.rs |  29 ++++++
 drivers/gpu/drm/tyr/vm.rs                | 152 ++++++++++++++++++++++++++++---
 rust/kernel/drm/gpuvm/va.rs              |   6 ++
 rust/kernel/iommu/pgtable.rs             |  23 +++++
 5 files changed, 209 insertions(+), 14 deletions(-)
---
base-commit: 8045d0e7d208ad389a387f1407ce0db9070805af
change-id: 20261116-tyr-remap-2mb-7a53b8475cfc

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>


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

end of thread, other threads:[~2026-11-17 19:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 19:32 [PATCH 0/4] drm/tyr: fix partial 2MB block unmaps on GPUVM remap Alice Ryhl
2026-11-17 19:32 ` [PATCH 1/4] rust: drm/gpuvm: add GpuVa::data_ref accessor Alice Ryhl
2026-11-17 19:40   ` Danilo Krummrich
2026-11-17 19:32 ` [PATCH 2/4] rust: iommu: pgtable: add iova_to_phys Alice Ryhl
2026-11-17 19:32 ` [PATCH 3/4] drm/tyr: vm: expand sub-block unmaps to 2MB boundaries on remap Alice Ryhl
2026-11-17 19:32 ` [PATCH 4/4] drm/tyr: vm: check the remaining length in pt_unmap() Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox