From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B352831F99E for ; Fri, 10 Jul 2026 14:27:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783693667; cv=none; b=tIjL6hIVqCSnzvnleJJOToTxmX+l1TygAQyEuF/HKWuDN8++EW7OvhrW6DPxbKehWLtyCw5zce4OCDlJwCBeap0Iysm556jIFfgN9TLNqQLnbJLlJTuG6qi2jlrAQN4PJ4ndJUCq7BH9SIKdTfGevmZ4MMUsyT/22ovwYykHD5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783693667; c=relaxed/simple; bh=YEG54FXZqI/1KLY3tXJ7rHla6Je6lHhbzWeOJELuXSQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=QzD3yvvvDAykDHzPQhEay9eo6g1qU8d981M5bhlQ5R9AJkAXlDnRNgGH9b/aZrpBJC8+TSx+iH3g8a3zCIT0gcmC0mivwLOm28Xmk54i3cLrWdFz4K/33LZO/IvfSjFbq+zWBJQdy1hIASG59folAl7W1B0+Rzi1o1JPFlDxcww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FgpB4sTx; arc=none smtp.client-ip=209.85.218.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FgpB4sTx" Received: by mail-ej1-f74.google.com with SMTP id a640c23a62f3a-c15d2ae8d2dso106673666b.1 for ; Fri, 10 Jul 2026 07:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783693664; x=1784298464; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZJxWnguOTe6CKBDsvGkeHPaaIWVYmyS6i3squ7Maq6Q=; b=FgpB4sTx4EcOFW2efrWjV4o5XoozoMEu5aYaM8CnLjVnvqm88yrRJYeF/y1/iZkrT7 u2hDwwjcaAv39gh3fvCaESoFEEOxYGal5UhjnDVgldMluvXOaJt6na4I/5vgP/PQUpjN g5H5aZqP3bz6XpuK4wv7aCirQFPhefGBF0gUkmlRBc3BJoCsPxSRPTck2ptsbuqP/wtK ofeXERQQZOJgVHQf2N7V8xXsGE6UBFr45zNrZERLnGDoOWjXmytTOpvZuzCI7Jba+4qD utJEFWhZ1evYptfMthypXJnlqRdeVZsKOnbWQ1IDXEUnq/e/YAtlzNr/uIJbwrFOkSmW EZFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783693664; x=1784298464; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZJxWnguOTe6CKBDsvGkeHPaaIWVYmyS6i3squ7Maq6Q=; b=SD6ZLsfVA7D4O4VYPyHRVEJ1TxJOc+wIo50t8/ekLBIq6xBzZMkpic1Rg6bKon47IR 6qnUwK6RmSpIMN4Uty8yrerxtArnNTciGY/t5vgnCKcv0LnYWYjVajniFaaedy43g3Ce udP2MYFV+QTYQX3Lyn0XtVXu9Ca4uEE+tR651eGql+XUgLDfv8aRnkr6nsQ2rcUrio5+ sSy+EO3BrtddMQbSpZIwasJNNO8c3OwJPuDXsobrSKGnGnJjL1QkhDKEU+DuYJxuFfCz NvwGyqzJFd5HQO28jFAbnNOjinnHV1M+tQ2GpClEy3VQxiHoVuptX45fSCaaQhZ2BTKQ jOyA== X-Forwarded-Encrypted: i=1; AHgh+RqrBN+jrtwgnFAgv/KHOc7Il7KTRgy5JRaCR2cFUqEwkkLho6v7EvSPXMe6o4za8XdNOS7nqS2NeN9/j3A=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3tUNB5jBdVG2JXqtHhEzjaXsoyTU9/p776NbEieMeTFCu91F5 7hMP9snz/jwqglwcZvJYBQwlM+r4rpKTY86KnU1ZH4dJrxWmkC1w+db77o2WK+45KmgFDgGRrB5 HzMO6dZN5CPVAEFaN3A== X-Received: from edqi22.prod.google.com ([2002:aa7:c716:0:b0:698:c0bc:3a7f]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:1f0d:b0:698:663d:d7bd with SMTP id 4fb4d7f45d1cf-69ab446e0a8mr4806641a12.11.1783693663712; Fri, 10 Jul 2026 07:27:43 -0700 (PDT) Date: Fri, 10 Jul 2026 14:27:42 +0000 In-Reply-To: <20260709-fw-boot-b4-v6-4-ca391e1a4108@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260709-fw-boot-b4-v6-0-ca391e1a4108@collabora.com> <20260709-fw-boot-b4-v6-4-ca391e1a4108@collabora.com> Message-ID: Subject: Re: [PATCH v6 4/7] drm/tyr: add GPU virtual memory (VM) support From: Alice Ryhl To: Deborah Brouwer Cc: Daniel Almeida , Danilo Krummrich , David Airlie , Simona Vetter , Benno Lossin , Gary Guo , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, boris.brezillon@collabora.com, samitolvanen@google.com, acourbot@nvidia.com, alvin.sun@linux.dev, laura.nao@collabora.com, work@onurozkan.dev, beata.michalska@arm.com, steven.price@arm.com, lyude@redhat.com Content-Type: text/plain; charset="utf-8" On Thu, Jul 09, 2026 at 02:36:44PM -0700, Deborah Brouwer wrote: > From: Boris Brezillon > > Add GPU virtual address space management using the DRM GPUVM framework. > Each virtual memory (VM) space is backed by ARM64 LPAE Stage 1 page tables > and can be mapped into hardware address space (AS) slots for GPU execution. > > The implementation provides memory isolation and virtual address > allocation. VMs support mapping GEM buffer objects with configurable > protection flags (readonly, noexec, uncached) and handle both 4KB and 2MB > page sizes. A new_dummy_object() helper is provided to create a dummy GEM > object for use as a GPUVM root. > > The vm module integrates with the MMU for address space activation and > provides map/unmap/remap operations with page table synchronization. > > Signed-off-by: Boris Brezillon > Co-developed-by: Daniel Almeida > Signed-off-by: Daniel Almeida > Co-developed-by: Deborah Brouwer > Signed-off-by: Deborah Brouwer I'm seeing some build failures on 32-bit arm: error[E0308]: mismatched types --> /home/runner/work/linux/linux/linux/drivers/gpu/drm/tyr/vm.rs:572:45 | 572 | let mut sgt_entry_length: u64 = sgt_entry.dma_len(); | --- ^^^^^^^^^^^^^^^^^^^ expected `u64`, found `u32` | | | expected due to this | help: you can convert a `u32` to a `u64` | 572 | let mut sgt_entry_length: u64 = sgt_entry.dma_len().into(); | +++++++ error[E0308]: mismatched types --> /home/runner/work/linux/linux/linux/drivers/gpu/drm/tyr/vm.rs:581:26 | 581 | paddr += skip; | ^^^^ expected `u32`, found `u64` error[E0277]: cannot add-assign `u64` to `u32` --> /home/runner/work/linux/linux/linux/drivers/gpu/drm/tyr/vm.rs:581:23 | 581 | paddr += skip; | ^^ no implementation for `u32 += u64` | = help: the trait `core::ops::AddAssign` is not implemented for `u32` help: `u32` implements trait `core::ops::AddAssign` --> /home/runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/internal_macros.rs:61:9 | 61 | impl const $imp<&$u> for $t { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `core::ops::AddAssign<&u32>` | ::: /home/runner/work/linux/linux/linux/rust/zerocopy/src/byteorder.rs:316:9 | 316 | impl core::ops::$trait_assign<$name> for $native { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `core::ops::AddAssign>` ... 720 | / define_type!( 721 | | A, 722 | | "A 32-bit unsigned integer", 723 | | U32, ... | 735 | | [U64, U128] 736 | | ); | |_- in this macro invocation | ::: /home/runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/arith.rs:786:9 | 786 | impl const AddAssign for $t { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `core::ops::AddAssign` CC drivers/base/firmware_loader/builtin/main.o ... 799 | add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128 } | ----------------------------------------------------------------------------------------- in this macro invocation = note: this error originates in the macro `impl_ops_traits` which comes from the expansion of the macro `add_assign_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> /home/runner/work/linux/linux/linux/drivers/gpu/drm/tyr/vm.rs:596:65 | 596 | let segment_mapped = match pt_map(context.pt, iova, paddr, len, prot) { | ------ ^^^^^ expected `u64`, found `u32` | | | arguments to this function are incorrect | note: function defined here --> /home/runner/work/linux/linux/linux/drivers/gpu/drm/tyr/vm.rs:731:4 | 731 | fn pt_map( | ^^^^^^ ... 734 | paddr: u64, | ---------- help: you can convert a `u32` to a `u64` | 596 | let segment_mapped = match pt_map(context.pt, iova, paddr.into(), len, prot) { | +++++++ CC net/core/tso.o error: aborting due to 4 previous errors