thods can only be used with DRM_GPUVM_IMMEDIATE_MODE.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm_gpuvm.c | 174
include/drm/drm_gpuvm.h | 26 +++
2 files changed, 200 insertions(+)
diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gp
On Thu, Sep 11, 2025 at 12:15:37PM +0200, Boris Brezillon wrote:
> On Tue, 09 Sep 2025 13:36:23 +
> Alice Ryhl wrote:
>
> > static void panthor_vma_init(struct panthor_vma *vma, u32 flags)
> > @@ -2084,12 +2010,12 @@ static int panthor_gpuva_sm_step_map(struct
>
Using build_assert! to assert that offsets are in bounds is really
fragile and likely to result in spurious and hard-to-debug build
failures. Therefore, build_assert! should be avoided for this case.
Thus, update the code to perform the check in const evaluation instead.
Signed-off-by: Alice Ryhl
On Thu, Sep 11, 2025 at 06:57:40PM -0400, Lyude Paul wrote:
> In order to implement the gem export callback, we need a type to represent
> struct dma_buf. So - this commit introduces a set of stub bindings for
> dma_buf. These bindings provide a ref-counted DmaBuf object, but don't
> currently impl
On Mon, Sep 08, 2025 at 02:46:35PM -0400, Lyude Paul wrote:
> This is the first few patches that were originally part of the series to
> introduce gem shmem bindings for rust into the Linux kernel, which can
> be found here:
>
> https://lkml.org/lkml/2025/8/29/1533
>
> These patches don't have an
so
> rust_platform_driver.rs.
>
> Lastly, the name "Tyr" is inspired by Norse mythology, reflecting ARM's
> tradition of naming their GPUs after Nordic mythological figures and
> places.
>
> Co-developed-by: Alice Ryhl
> Signed-off-by: Alice Ryhl
> Co-dev
On Tue, Sep 09, 2025 at 04:20:32PM +0200, Thomas Hellström wrote:
> On Tue, 2025-09-09 at 13:36 +0000, Alice Ryhl wrote:
> > When using GPUVM in immediate mode, it is necessary to call
> > drm_gpuvm_unlink() from the fence signalling critical path. However,
> > unlink may
On Tue, Sep 09, 2025 at 01:36:22PM +, Alice Ryhl wrote:
> When using GPUVM in immediate mode, it is necessary to call
> drm_gpuvm_unlink() from the fence signalling critical path. However,
> unlink may call drm_gpuvm_bo_put(), which causes some challenges:
>
> 1. drm_gpuvm
vm_bo
cleanup. Take inspiration from that by moving the logic into GPUVM, and
adjust Panthor to use the new GPUVM logic.
Signed-off-by: Alice Ryhl
---
Changes in v2:
- Fix missing kfree in Panthor.
- Rework mutex_lock() calls to be less confusing.
- Add note about resv lock in drm_gpuvm_bo_is_dead(
preserved the
behavior where panthor_gpuva_sm_step_map() drops the refcount right away
rather than letting panthor_vm_cleanup_op_ctx() do it later.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/panthor/panthor_mmu.c | 113 ++
1 file changed, 19 insertions(+), 94
On Tue, Sep 9, 2025 at 1:11 PM Thomas Hellström
wrote:
>
> On Tue, 2025-09-09 at 12:47 +0200, Danilo Krummrich wrote:
> > On 9/9/25 12:39 PM, Thomas Hellström wrote:
> > > On 9/8/25 14:20, Danilo Krummrich wrote:
> > > > On 9/8/25 2:11 PM, Boris Brezillon wrote:
> > > > > On Mon, 08 Sep 2025 13:11
/gem.rs | 8 ++--
> rust/kernel/drm/driver.rs | 3 ++
> rust/kernel/drm/gem/mod.rs | 93 -
> 3 files changed, 47 insertions(+), 57 deletions(-)
For all 3 patches:
Reviewed-by: Alice Ryhl
On Mon, Sep 08, 2025 at 09:11:40AM +0200, Boris Brezillon wrote:
> Hi Alice,
>
> On Sun, 7 Sep 2025 11:39:41 +0000
> Alice Ryhl wrote:
>
> > Yeah I guess we could have unlink remove the gpuva, but then allow the
> > end-user to attach the gpuva to a list of gpu
Hi Dave and Sima,
Here's the first PR for the drm-rust-fixes branch. It includes the
commit to add the drm-rust repository to MAINTAINERS.
The following changes since commit b320789d6883cc00ac78ce83bccbfe7ed58afcf0:
Linux 6.17-rc4 (2025-08-31 15:33:07 -0700)
are available in the Git repositor
On Sun, Sep 07, 2025 at 01:28:05PM +0200, Danilo Krummrich wrote:
> On Sun Sep 7, 2025 at 1:15 PM CEST, Alice Ryhl wrote:
> > On Sat, Sep 06, 2025 at 12:47:36AM +0200, Danilo Krummrich wrote:
> >> On Fri Sep 5, 2025 at 8:18 PM CEST, Alice Ryhl wrote:
> >> > On Fri
On Sat, Sep 06, 2025 at 12:47:36AM +0200, Danilo Krummrich wrote:
> On Fri Sep 5, 2025 at 8:18 PM CEST, Alice Ryhl wrote:
> > On Fri, Sep 5, 2025 at 3:25 PM Boris Brezillon
> > wrote:
> >> On Fri, 05 Sep 2025 12:11:28 +
> >> Alice Ryhl wrote:
> >> &
On Wed, Aug 27, 2025 at 06:20:01PM +1000, Alistair Popple wrote:
> From: Joel Fernandes
>
> A data structure that can be used to write across multiple slices which
> may be out of order in memory. This lets SBuffer user correctly and
> safely write out of memory order, without error-prone trackin
On Fri, Sep 5, 2025 at 3:25 PM Boris Brezillon
wrote:
>
> On Fri, 05 Sep 2025 12:11:28 +0000
> Alice Ryhl wrote:
>
> > When using GPUVM in immediate mode, it is necessary to call
> > drm_gpuvm_unlink() from the fence signalling critical path. However,
> > un
On Fri, Sep 5, 2025 at 2:53 PM Boris Brezillon
wrote:
>
> On Fri, 05 Sep 2025 12:11:29 +0000
> Alice Ryhl wrote:
>
> > static void panthor_vm_cleanup_op_ctx(struct panthor_vm_op_ctx *op_ctx,
> > struct panthor_vm *vm)
> > {
>
thods can only be used with DRM_GPUVM_IMMEDIATE_MODE.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm_gpuvm.c | 167
include/drm/drm_gpuvm.h | 26 +++
2 files changed, 193 insertions(+)
diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gp
preserved the
behavior where panthor_gpuva_sm_step_map() drops the refcount right away
rather than letting panthor_vm_cleanup_op_ctx() do it later.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/panthor/panthor_mmu.c | 112 ++
1 file changed, 18 insertions(+), 94
vm_bo
cleanup. Take inspiration from that by moving the logic into GPUVM, and
adjust Panthor to use the new GPUVM logic.
Signed-off-by: Alice Ryhl
---
Alice Ryhl (2):
drm/gpuvm: add deferred vm_bo cleanup
panthor: use drm_gpuva_unlink_defer()
drivers/gpu/drm/drm_gpu
driver
> trees respectively. Until then, drm-rust provides a dedicated place to
> coordinate development without disrupting existing workflows too much.
>
> Cc: Alice Ryhl
> Cc: David Airlie
> Cc: Simona Vetter
> Cc: Maarten Lankhorst
> Cc: Maxime Ripard
> Cc: Th
On Sat, Aug 30, 2025 at 12:42 AM Lyude Paul wrote:
>
> For retrieving a pointer to the struct dma_resv for a given GEM object. We
> also introduce it in a new trait, BaseObjectPrivate, which we automatically
> implement for all gem objects and don't expose to users outside of the
> crate.
>
> Sign
driver
> trees respectively. Until then, drm-rust provides a dedicated place to
> coordinate development without disrupting existing workflows too much.
>
> Cc: Alice Ryhl
> Cc: David Airlie
> Cc: Simona Vetter
> Cc: Maarten Lankhorst
> Cc: Maxime Ripard
> Cc: Th
driver
> trees respectively. Until then, drm-rust provides a dedicated place to
> coordinate development without disrupting existing workflows too much.
>
> Cc: Alice Ryhl
> Cc: David Airlie
> Cc: Simona Vetter
> Cc: Maarten Lankhorst
> Cc: Maxime Ripard
> Cc: Th
nings being treated as errors
> make[6]: *** [scripts/Makefile.build:287:
> drivers/gpu/drm/tests/drm_exec_test.o] Error 1
> make[6]: *** Waiting for unfinished jobs
>
> In order to fix this, allocate the GEM objects in test_prepare_array()
> with kzalloc(), rather than placing the
On Thu, Aug 28, 2025 at 11:27 AM Danilo Krummrich wrote:
>
> On Wed Aug 27, 2025 at 3:38 PM CEST, Alice Ryhl wrote:
> > #ifdef CONFIG_LOCKDEP
> > -/**
> > - * drm_gem_gpuva_set_lock() - Set the lock protecting accesses to the
> > gpuva list.
> > - * @obj: th
m_bo could lead to the GEM object getting destroyed.
The requirement that GEM object cleanup is fence signalling safe is
dubious and likely to be violated in practice.
Panthor already has its own custom implementation of postponing vm_bo
cleanup.
Reviewed-by: Boris Brezillon
Signed-off-by:
e the intent is
that the flag will also cause vm_bo cleanup to become deferred. However,
that will happen in a follow-up patch.
Reviewed-by: Boris Brezillon
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm_gpuvm.c | 30 -
drivers/gpu/drm/panthor/panthor_gem.c
Now that drm_gem_object has a dedicated mutex for the gpuva list that is
intended to be used in cases that must be fence signalling safe, use it
in Panthor.
Reviewed-by: Boris Brezillon
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/panthor/panthor_gem.c | 4 +---
drivers/gpu/drm/panthor
See the first patch for motivation.
Signed-off-by: Alice Ryhl
---
Changes in v3:
- Documentation improvements in patch 1 and 3.
- No code changes.
- Link to v2:
https://lore.kernel.org/r/20250822-gpuva-mutex-in-gem-v2-0-c41a10d1d...@google.com
Changes in v2:
- Move the mutex_destroy() call to
On Fri, Aug 22, 2025 at 12:25 PM Danilo Krummrich wrote:
>
> On Fri Aug 22, 2025 at 11:28 AM CEST, Alice Ryhl wrote:
> > diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> > index
> > 4a22b9d848f7b3d5710ca554f5b01556abf95985..598ba376b9430cdd4ab7bacdc15d
After working with this code for a while, I came across several typos.
This patch fixes them.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm_gpuvm.c | 80 ++---
include/drm/drm_gpuvm.h | 10 +++---
2 files changed, 45 insertions(+), 45 deletions
n owned value
> that is populated using an unaligned read, removing the lifetime
> constraint and making it usable even on non-aligned byte slices.
>
> Signed-off-by: Alexandre Courbot
Reviewed-by: Alice Ryhl
On Fri, Aug 22, 2025 at 12:25:34PM +0200, Danilo Krummrich wrote:
> On Fri Aug 22, 2025 at 11:28 AM CEST, Alice Ryhl wrote:
> > diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> > index
> > 4a22b9d848f7b3d5710ca554f5b01556abf95985..598ba376b9430cdd4ab
On Fri, Aug 22, 2025 at 11:52:21AM +0200, Boris Brezillon wrote:
> On Fri, 22 Aug 2025 09:28:24 +
>
> Maybe it's time we start moving some bits of the gpuva field docs next
> to the fields they describe:
>
> /**
>* @gpuva: Fields used by GPUVM to manage mappings pointing to this
See the first patch for motivation.
Signed-off-by: Alice Ryhl
---
Changes in v2:
- Move the mutex_destroy() call to drm_gem_private_object_fini()
- Add a third patch to get rid of the lockdep map.
- Link to v1:
https://lore.kernel.org/r/20250814-gpuva-mutex-in-gem-v1-0-e202cbfe6...@google.com
m_bo could lead to the GEM object getting destroyed.
The requirement that GEM object cleanup is fence signalling safe is
dubious and likely to be violated in practice.
Panthor already has its own custom implementation of postponing vm_bo
cleanup.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm
e the intent is
that the flag will also cause vm_bo cleanup to become deferred. However,
that will happen in a follow-up patch.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm_gpuvm.c | 30 +--
drivers/gpu/drm/panthor/panthor_gem.c | 1 -
drivers/gpu/drm/pa
Now that drm_gem_object has a dedicated mutex for the gpuva list that is
intended to be used in cases that must be fence signalling safe, use it
in Panthor.
Reviewed-by: Boris Brezillon
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/panthor/panthor_gem.c | 4 +---
drivers/gpu/drm/panthor
On Thu, Aug 14, 2025 at 4:59 PM Danilo Krummrich wrote:
>
> On Thu Aug 14, 2025 at 3:53 PM CEST, Alice Ryhl wrote:
> > There are two main ways that GPUVM might be used:
> >
> > * staged mode, where VM_BIND ioctls update the GPUVM immediately so that
> > the GPUV
Now that drm_gem_object has a dedicated mutex for the gpuva list that is
intended to be used in cases that must be fence signalling safe, use it
in Panthor.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/panthor/panthor_gem.c | 4 +---
drivers/gpu/drm/panthor/panthor_gem.h | 12
m_bo could lead to the GEM object getting destroyed.
The requirement that GEM object cleanup is fence signalling safe is
dubious and likely to be violated in practice.
Panthor already has its own custom implementation of postponing vm_bo
cleanup.
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/drm
See the first patch for motivation.
Signed-off-by: Alice Ryhl
---
Alice Ryhl (2):
drm_gem: add mutex to drm_gem_object.gpuva
panthor: use drm_gem_object.gpuva.lock instead of gpuva_list_lock
drivers/gpu/drm/drm_gem.c | 2 ++
drivers/gpu/drm/panthor/panthor_gem.c | 4
On Wed, Aug 13, 2025 at 09:11:51PM +0100, Mark Brown wrote:
> On Wed, Aug 13, 2025 at 11:59:10AM -0400, Tamir Duberstein wrote:
> > This series depends on step 3[0] which depends on steps 2a[1] and 2b[2]
> > which both depend on step 1[3].
> >
> > This series also has a minor merge conflict with a
On Fri, Aug 08, 2025 at 11:20:49AM +0200, Danilo Krummrich wrote:
> GPUVM deserves a bit more coordination, also given the upcoming Rust
> work for GPUVM, hence add a dedicated maintainers entry for DRM GPUVM.
>
> Cc: Boris Brezillon
> Cc: Matthew Brost
> Cc: Thomas Hellström
d create a proper
> kmalloc() compatible Layout.
>
> Fixes: 1e4b8896c0f3 ("rust: drm: add device abstraction")
> Signed-off-by: Danilo Krummrich
Reviewed-by: Alice Ryhl
On Fri, Aug 1, 2025 at 11:29 AM Danilo Krummrich wrote:
>
> On Fri Aug 1, 2025 at 11:18 AM CEST, Alice Ryhl wrote:
> > On Thu, Jul 31, 2025 at 05:48:07PM +0200, Danilo Krummrich wrote:
> >> drm::Device is allocated through __drm_dev_alloc() (which uses
> >> kmalloc(
On Thu, Jul 31, 2025 at 05:48:07PM +0200, Danilo Krummrich wrote:
> drm::Device is allocated through __drm_dev_alloc() (which uses
> kmalloc()) and the driver private data, ::Data, is
> initialized in-place.
>
> Due to the order of fields in drm::Device
>
> pub struct Device {
> dev: Opaqu
h have to call subsystem specific kmalloc() based
> allocation primitives directly, can make use of it.
>
> Fixes: 8a799831fc63 ("rust: alloc: implement `ReallocFunc`")
> Signed-off-by: Danilo Krummrich
I guess vmalloc handles alignment in a different way ... ok makes sense
to me.
Reviewed-by: Alice Ryhl
}
I think it would somewhat more consistent to use the naming raw_get() or
cast_into(), but I am ok with this naming too.
Reviewed-by: Alice Ryhl
Alice
-project/issues/37280 [1]
> Reported-by: Andrei Lalaev
> Closes:
> https://lore.kernel.org/dri-devel/c0a2771c-f3f5-4d4c-aa82-d673b3c5c...@gmail.com/
> Fixes: 675008f196ca ("drm/panic: Use a decimal fifo to avoid u64 by u64
> divide")
> Signed-off-by: Jocelyn Falempe
Reviewed-by: Alice Ryhl
.
>
> Signed-off-by: Beata Michalska
> Acked-by: Danilo Krummrich
> Reviewed-by: Boqun Feng
I'm guessing this should go through the DRM tree?
Reviewed-by: Alice Ryhl
On Mon, Jul 14, 2025 at 4:49 PM Joel Fernandes wrote:
>
> Hello, Rhys,
>
> On Mon, Jul 14, 2025 at 04:02:23AM -0700, Rhys Lloyd wrote:
> > Instead of the data field containing a u32 and changing the alignment,
> > change data to [u8; 4] and convert to u32 with a helper function.
> > Removes anothe
::from_raw,
fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw,
SeqFile::from_raw, VmaNew::from_raw, Io::from_raw.
Link: https://lore.kernel.org/r/aCd8D5IA0RXZvtcv@pollux
Signed-off-by: Alice Ryhl
---
rust/kernel/auxiliary.rs | 2 +-
rust/kernel/cpu.rs| 2 +-
rust/kernel/device.rs
::from_raw,
fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw,
SeqFile::from_raw, VmaNew::from_raw, Io::from_raw.
Link: https://lore.kernel.org/r/aCd8D5IA0RXZvtcv@pollux
Signed-off-by: Alice Ryhl
---
rust/kernel/drm/device.rs | 2 +-
rust/kernel/drm/file.rs| 8
rust/kernel
::from_raw,
fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw,
SeqFile::from_raw, VmaNew::from_raw, Io::from_raw.
For more, see: https://lore.kernel.org/r/aCd8D5IA0RXZvtcv@pollux
Signed-off-by: Alice Ryhl
---
Changes in v2:
- Split into two patches.
- Use a different lore link.
- Link to v1
str.rs| 97
> ---
> samples/rust/rust_print_main.rs | 2 +-
> 10 files changed, 83 insertions(+), 50 deletions(-)
> ---
> base-commit: 769e324b66b0d92d04f315d0c45a0f72737c7494
> change-id: 20250704-core-cstr-prepare-9b9e6a7bd57e
>
> Best regards,
> --
> Tamir Duberstein
>
Reviewed-by: Alice Ryhl
On Wed, Jul 9, 2025 at 4:07 PM Danilo Krummrich wrote:
>
> On Wed Jul 9, 2025 at 3:53 PM CEST, Alice Ryhl wrote:
> > The prefix as_* should not be used for a constructor. Constructors
> > usually use the prefix from_* instead.
> >
> > Some prior art in the stdlib: Bo
::from_raw,
fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw,
SeqFile::from_raw, VmaNew::from_raw, Io::from_raw.
Link: https://lore.kernel.org/r/aCZYcs6Aj-cz81qs@pollux
Signed-off-by: Alice Ryhl
---
rust/kernel/auxiliary.rs | 2 +-
rust/kernel/cpu.rs | 2 +-
rust/kernel
On Fri, Jul 4, 2025 at 10:16 PM Tamir Duberstein wrote:
>
> `core::ffi::*` is in the prelude, which is imported here.
>
> Signed-off-by: Tamir Duberstein
Reviewed-by: Alice Ryhl
27;s release callback.
>
> Fixes: 1e4b8896c0f3 ("rust: drm: add device abstraction")
> Signed-off-by: Danilo Krummrich
Reviewed-by: Alice Ryhl
people to never use core::ffi as the integer types are wrong,
and I think it would be nice if we can continue to tell people "never
use core::ffi".
Either way, for the whole series:
Reviewed-by: Alice Ryhl
Alice
On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote:
>
> On 32bits ARM, u64 divided by a constant is not optimized to a
> multiply by inverse by the compiler [1].
> So do the multiply by inverse explicitly for this architecture.
>
> Link: https://github.com/llvm/llvm-project/issues/37280 [1]
>
t changing the inner type. Also
rename raw_get() to cast_into() for naming consistency.
Signed-off-by: Alice Ryhl
---
Changes in v2:
- Use new naming, and rename raw_get().
- Link to v1:
https://lore.kernel.org/r/20250617-opaque-from-raw-v1-1-a2e99efa3...@google.com
---
Alice Ryhl (2):
rust:
t changing the inner type. Also
update the docs to reflect this as well as some existing users.
Signed-off-by: Alice Ryhl
---
rust/kernel/drm/device.rs | 4 +---
rust/kernel/drm/gem/mod.rs | 4 +---
rust/kernel/lib.rs | 7 +++
rust/kernel/types.rs | 5 +
4 files changed, 14
. However, I could
not find a great naming scheme that works with raw_get(). The previous
version of this patch used from_raw(), but functions of that name
typically have a different signature, so that's not a great option.
Suggested-by: Danilo Krummrich
Signed-off-by: Alice Ryhl
---
rust/k
On Thu, Jun 19, 2025 at 1:01 PM Benno Lossin wrote:
>
> On Thu Jun 19, 2025 at 12:55 PM CEST, Danilo Krummrich wrote:
> > On Thu, Jun 19, 2025 at 12:21:02PM +0200, Beata Michalska wrote:
> >> diff --git a/rust/kernel/drm/ioctl.rs b/rust/kernel/drm/ioctl.rs
> >> index 445639404fb7..12b296131672 100
On Tue, Jun 17, 2025 at 03:54:19PM +0200, Danilo Krummrich wrote:
> On Tue, Jun 17, 2025 at 01:36:47PM +0000, Alice Ryhl wrote:
> > Since commit b20fbbc08a36 ("rust: check type of `$ptr` in
> > `container_of!`") we have enforced that the field pointer passed to
> &g
anging the inner type.
Signed-off-by: Alice Ryhl
---
rust/kernel/drm/device.rs | 4 +---
rust/kernel/drm/gem/mod.rs | 4 +---
rust/kernel/lib.rs | 7 +++
rust/kernel/types.rs | 5 +
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/rust/kernel/drm/device
On Wed, May 14, 2025 at 12:58 PM Andrew Ballance
wrote:
>
> currently the rust `Io` type maps to the c read{b, w, l, q}/write{b, w, l, q}
> functions and have no support for port io. this can be a problem for pci::Bar
> because the pointer returned by pci_iomap can be either PIO or MMIO [0].
>
> t
On Fri, May 30, 2025 at 08:27:44AM -0400, Tamir Duberstein wrote:
> `kernel::ffi::CStr` was introduced in commit d126d2380131 ("rust: str:
> add `CStr` type") in November 2022 as an upstreaming of earlier work
> that was done in May 2021[0]. That earlier work, having predated the
> inclusion of `CS
On Fri, May 30, 2025 at 08:27:45AM -0400, Tamir Duberstein wrote:
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible and rename
> `kernel::c_str!` to `str_to_cstr!` to clarify its intended use.
>
> Closes: https://github.com/R
On Wed, May 21, 2025 at 8:45 AM Alexandre Courbot wrote:
>
> Introduce the `num` module, featuring the `NumExt` extension trait
> that expands unsigned integers with useful operations for the kernel.
>
> These are to be used by the nova-core driver, but they are so ubiquitous
> that other drivers
On Sat, May 24, 2025 at 04:33:00PM -0400, Tamir Duberstein wrote:
> This picks up from Michal Rostecki's work[0]. Per Michal's guidance I
> have omitted Co-authored tags, as the end result is quite different.
>
> Link:
> https://lore.kernel.org/rust-for-linux/20240819153656.28807-2-vadorov...@pro
On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote:
> On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote:
> >
> > On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
> > > +macro_rules! c_str_avoid_literals {
> >
> > I don't like this name, how about `concat_to_c_str` or
>
On Tue, May 27, 2025 at 12:18 AM Tamir Duberstein wrote:
> > > +}
> > > +
> > > +fn make_ident<'a, T: IntoIterator>(
> > > +span: Span,
> > > +names: T,
> > > +) -> impl Iterator + use<'a, T> {
> > > +names.into_iter().flat_map(move |name| {
> > > +[
> > > +TokenTre
On Mon, Mar 3, 2025 at 10:46 AM Andy Shevchenko
wrote:
>
> On Mon, Mar 03, 2025 at 08:45:15AM +, Alice Ryhl wrote:
> > This moves the rust_fmt_argument function over to use the new #[export]
> > macro, which will verify at compile-time that the function signature
> >
This moves the rust_fmt_argument function over to use the new #[export]
macro, which will verify at compile-time that the function signature
matches what is in the header file.
Reviewed-by: Andreas Hindborg
Reviewed-by: Tamir Duberstein
Acked-by: Greg Kroah-Hartman
Signed-off-by: Alice Ryhl
On Fri, Feb 28, 2025 at 6:15 PM Tamir Duberstein wrote:
>
> On Fri, Feb 28, 2025 at 12:08 PM Alice Ryhl wrote:
> >
> > On Fri, Feb 28, 2025 at 4:55 PM Tamir Duberstein wrote:
> > >
> > > On Fri, Feb 28, 2025 at 7:41 AM Alice Ryhl wrote:
> > > &g
Kroah-Hartman
Signed-off-by: Alice Ryhl
---
rust/macros/quote.rs | 27 +--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/rust/macros/quote.rs b/rust/macros/quote.rs
index 33a199e4f176..31b7ebe504f4 100644
--- a/rust/macros/quote.rs
+++ b/rust/macros/quo
a header file so it can be
included in the Rust bindings helper, and the extern keyword is removed
as it is unnecessary.
Reviewed-by: Andreas Hindborg
Reviewed-by: Tamir Duberstein
Acked-by: Simona Vetter
Acked-by: Greg Kroah-Hartman
Signed-off-by: Alice Ryhl
---
drivers/gpu/drm/d
.
Reviewed-by: Tamir Duberstein
Reviewed-by: Andreas Hindborg
Acked-by: Greg Kroah-Hartman
Signed-off-by: Alice Ryhl
---
rust/kernel/prelude.rs | 2 +-
rust/macros/export.rs | 29 +
rust/macros/helpers.rs | 19 ++-
rust/macros/lib.rs | 24
`%pA` format specifier")
Reviewed-by: Tamir Duberstein
Acked-by: Greg Kroah-Hartman
Signed-off-by: Alice Ryhl
---
lib/vsprintf.c | 2 +-
rust/kernel/print.rs | 7 +++
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 56fe96319292..a
The main commit of this series is "rust: add #[export] macro".
Signed-off-by: Alice Ryhl
---
Changes in v3:
- Reword commit message about cbindgen to remove cargo comment.
- Add # token to quote! macro and mention allow(unused_mut) warning.
- Use quote! macro for #[no_mangle] in #[export
On Fri, Feb 28, 2025 at 4:40 PM Tamir Duberstein wrote:
>
> On Fri, Feb 28, 2025 at 7:40 AM Alice Ryhl wrote:
> >
> > Rust has two different tools for generating function declarations to
> > call across the FFI boundary:
> >
> > * bindgen. Generat
On Fri, Feb 28, 2025 at 4:26 PM Tamir Duberstein wrote:
>
> On Fri, Feb 28, 2025 at 7:42 AM Alice Ryhl wrote:
> >
> > This gives the quote! macro support for the following additional tokens:
> >
> > * The = token.
> > * The _ token.
> > *
On Fri, Feb 28, 2025 at 4:55 PM Tamir Duberstein wrote:
>
> On Fri, Feb 28, 2025 at 7:41 AM Alice Ryhl wrote:
> >
> > This validates at compile time that the signatures match what is in the
> > header file. It highlights one annoyance with the compile-time check,
> >
On Fri, Feb 28, 2025 at 4:37 PM Andy Shevchenko
wrote:
>
> On Fri, Feb 28, 2025 at 12:39:33PM +, Alice Ryhl wrote:
> > This moves the rust_fmt_argument function over to use the new #[export]
> > macro, which will verify at compile-time that the function signature
> >
On Fri, Feb 28, 2025 at 4:34 PM Andy Shevchenko
wrote:
>
> On Fri, Feb 28, 2025 at 12:39:34PM +, Alice Ryhl wrote:
> > This validates at compile time that the signatures match what is in the
> > header file. It highlights one annoyance with the compile-time check,
> &
} else {
#name
};
};
where #name has type Ident.
Signed-off-by: Alice Ryhl
---
rust/macros/quote.rs | 21 +++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/rust/macros/quote.rs b/rust/macros/quote.rs
index 33a199e4f176
On Fri, Feb 28, 2025 at 2:12 PM Miguel Ojeda
wrote:
>
> On Fri, Feb 28, 2025 at 1:40 PM Alice Ryhl wrote:
> >
> > This is because cbindgen assumes a
> > cargo-based buildsystem, so it is not compatible with the kernel's build
> > system.
>
> I don't
pected unsafe fn, found
safe fn
|
= note: expected fn item `unsafe extern "C" fn(_, _) -> _
{kernel::bindings::drm_panic_qr_max_data_size}`
found fn item `extern "C" fn(_, _) -> _
{drm_panic_qr_max_data_size}`
Reviewed-by: Andreas Hindborg
Signe
This moves the rust_fmt_argument function over to use the new #[export]
macro, which will verify at compile-time that the function signature
matches what is in the header file.
Reviewed-by: Andreas Hindborg
Signed-off-by: Alice Ryhl
---
I'm not sure which header file to put this in. Any a
c_void) -> *mut i8 {print::rust_fmt_argument}`
It is unfortunate that the error message starts out by saying "`if` and
`else` have incompatible types", but I believe the rest of the error
message is reasonably clear and not too confusing.
Signed-off-by: Alice Ryhl
---
-> *mut i8 {print::rust_fmt_argument}`
The error may be different depending on the architecture.
To fix this, change the void pointer argument to use a const pointer,
and change the imports to use crate::ffi instead of core::ffi for
integer types.
Fixes: 787983da7718 ("vsprintf: add new `
Please
see its commit message for more details.
Signed-off-by: Alice Ryhl
---
Changes in v2:
- Various improvements to documentation.
- Split out quote! changes into its own commit.
- Link to v1:
https://lore.kernel.org/r/20250227-export-macro-v1-0-948775fc3...@google.com
---
Alice Ryhl (5):
On Thu, Feb 27, 2025 at 8:31 PM Greg Kroah-Hartman
wrote:
>
> On Thu, Feb 27, 2025 at 05:01:58PM +, Alice Ryhl wrote:
> > Signed-off-by: Alice Ryhl
>
> It's a bit odd to sign off on a 0/X email with no patch or description
> :)
>
> Seriously, nice work! Thi
On Fri, Feb 28, 2025 at 9:20 AM Andreas Hindborg wrote:
>
> "Alice Ryhl" writes:
>
> > This macro behaves like #[no_mangle], but also performs an assertion
> > that the Rust function has the same signature as what is declared in the
> > C header.
> >
1 - 100 of 123 matches
Mail list logo