public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] rust: add `bitfield!` macro
@ 2026-05-01  6:03 Alexandre Courbot
  2026-05-01  6:03 ` [PATCH v3 1/5] rust: extract `bitfield!` macro from `register!` Alexandre Courbot
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Alexandre Courbot @ 2026-05-01  6:03 UTC (permalink / raw)
  To: Joel Fernandes, Yury Norov, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, David Airlie,
	Simona Vetter
  Cc: John Hubbard, Alistair Popple, Timur Tabi, Zhi Wang,
	Eliot Courtney, linux-kernel, rust-for-linux, nova-gpu,
	driver-core, Alexandre Courbot, Yury Norov

This is the continuation of the `bitfield!` macro which started
alongside the `register!` one before being temporarily integrated into
it [1].

Thanks for all the feedback on v2; I believe this version addresses all
of it, modulo Eliot's suggestion for more explicit range error messages.
Since this is not fundamentally broken, I'd like to address this in a
follow-up change to keep the series focused on the macro extraction from
`register!`.

This version is based on today's `rust-next`, which happens to be
`7.1-rc1`. If review proves satisfying, I see several possible merge
strategies, the one with the least friction being patches 1 and 2 are
merged into the rust tree this cycle, followed by patches 3-5 via the
I/O and DRM trees during the following cycle. This path would not
require any signed tag.

[1] https://lore.kernel.org/all/20260120-register-v1-0-723a1743b557@nvidia.com/

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v3:
- Split patch 1 into the addition of the `bitfield!` macro and its use
  in the `io` module.
- Mention reserved field names in `bitfield!`'s doccomment.
- Properly order fields in the KUnit test.
- Add a Kconfig option for building the KUnit tests.
- Document behavior on non-covered bits.
- Document support for signed fields and storage types (TL;DR: not
  supported).
- Move `nova-core`'s `bitfield` module deletion into its own patch.
- Link to v2: https://patch.msgid.link/20260409-bitfield-v2-0-23ac400071cb@nvidia.com

---
Alexandre Courbot (4):
      rust: extract `bitfield!` macro from `register!`
      rust: io: use the `bitfield!` macro in `register!`
      gpu: nova-core: switch to kernel bitfield macro
      gpu: nova-core: remove the driver-local `bitfield!` macro

Joel Fernandes (1):
      rust: bitfield: Add KUnit tests for bitfield

 MAINTAINERS                        |   8 +
 drivers/gpu/nova-core/bitfield.rs  | 329 --------------
 drivers/gpu/nova-core/gsp/fw.rs    |  11 +-
 drivers/gpu/nova-core/nova_core.rs |   3 -
 lib/Kconfig.debug                  |  12 +
 rust/kernel/bitfield.rs            | 865 +++++++++++++++++++++++++++++++++++++
 rust/kernel/io/register.rs         | 246 +----------
 rust/kernel/lib.rs                 |   1 +
 8 files changed, 894 insertions(+), 581 deletions(-)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260408-bitfield-6e18254f4fdc

Best regards,
--  
Alexandre Courbot <acourbot@nvidia.com>


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

end of thread, other threads:[~2026-05-01 22:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01  6:03 [PATCH v3 0/5] rust: add `bitfield!` macro Alexandre Courbot
2026-05-01  6:03 ` [PATCH v3 1/5] rust: extract `bitfield!` macro from `register!` Alexandre Courbot
2026-05-01  6:03 ` [PATCH v3 2/5] rust: bitfield: Add KUnit tests for bitfield Alexandre Courbot
2026-05-01 17:37   ` Yury Norov
2026-05-01  6:03 ` [PATCH v3 3/5] rust: io: use the `bitfield!` macro in `register!` Alexandre Courbot
2026-05-01 17:47   ` Yury Norov
2026-05-01 17:51     ` Yury Norov
2026-05-01 18:19     ` Danilo Krummrich
2026-05-01 20:41       ` Yury Norov
2026-05-01 21:55         ` Danilo Krummrich
2026-05-01 22:15           ` Yury Norov
2026-05-01  6:03 ` [PATCH v3 4/5] gpu: nova-core: switch to kernel bitfield macro Alexandre Courbot
2026-05-01  6:03 ` [PATCH v3 5/5] gpu: nova-core: remove the driver-local `bitfield!` macro Alexandre Courbot

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