All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Introduce bitfield and move register macro to rust/kernel/
@ 2025-09-09 21:20 Joel Fernandes
  2025-09-09 21:20 ` [PATCH v3 1/5] nova-core: bitfield: Move bitfield-specific code from register! into new macro Joel Fernandes
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Joel Fernandes @ 2025-09-09 21:20 UTC (permalink / raw)
  To: linux-kernel, dri-devel, dakr, acourbot
  Cc: Alistair Popple, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	bjorn3_gh, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, David Airlie, Simona Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, John Hubbard, Joel Fernandes,
	Timur Tabi, joel, Elle Rhumsaa, Yury Norov, Daniel Almeida,
	nouveau

These patches extract and enhance the bitfield support in the register macro in
nova to define Rust structures with bitfields. This is extremely useful as it
allows clean Rust structure definitions without requiring explicit masks and
shifts.

See [1] example code using it.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git/patch/?id=76797b31facae8f1a1be139412c78568df1da9f3

v2 of the patches is at:
https://lore.kernel.org/all/20250903215428.1296517-1-joelagnelf@nvidia.com/

v1 of the patches is at:
https://lore.kernel.org/all/20250824135954.2243774-1-joelagnelf@nvidia.com/

v2->v3:
* Renamed bitstruct to bitfield.
* Various suggestions to improve code (Alex, Yury, Miguel).
* Added reviewed-by tags from Elle Rhumsaa.
* Added KUNIT tests including tests for overlap.
* Added F: maintainers file entry for new files under BITOPS.

v1->v2:
* Use build_assert in bitstruct
* Split move and enhance patches for easier review
* Move out of Nova into kernel crate for other drivers like Tyr which will use.
* Miscellaneous cosmetic improvements.

Joel Fernandes (5):
  nova-core: bitfield: Move bitfield-specific code from register! into
    new macro
  nova-core: bitfield: Add support for different storage widths
  nova-core: bitfield: Add support for custom visiblity
  rust: Move register and bitfield macros out of Nova
  rust: Add KUNIT tests for bitfield

 MAINTAINERS                                   |   1 +
 drivers/gpu/nova-core/falcon.rs               |   2 +-
 drivers/gpu/nova-core/falcon/gsp.rs           |   3 +-
 drivers/gpu/nova-core/falcon/sec2.rs          |   2 +-
 drivers/gpu/nova-core/regs.rs                 |   6 +-
 rust/kernel/bits.rs                           |   2 +
 rust/kernel/bits/bitfield.rs                  | 661 ++++++++++++++++++
 rust/kernel/io.rs                             |   1 +
 .../macros.rs => rust/kernel/io/register.rs   | 289 +-------
 9 files changed, 698 insertions(+), 269 deletions(-)
 create mode 100644 rust/kernel/bits/bitfield.rs
 rename drivers/gpu/nova-core/regs/macros.rs => rust/kernel/io/register.rs (73%)

-- 
2.34.1


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

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

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 21:20 [PATCH v3 0/5] Introduce bitfield and move register macro to rust/kernel/ Joel Fernandes
2025-09-09 21:20 ` [PATCH v3 1/5] nova-core: bitfield: Move bitfield-specific code from register! into new macro Joel Fernandes
2025-09-09 21:20 ` [PATCH v3 2/5] nova-core: bitfield: Add support for different storage widths Joel Fernandes
2025-09-09 21:20 ` [PATCH v3 3/5] nova-core: bitfield: Add support for custom visiblity Joel Fernandes
2025-09-09 21:20 ` [PATCH v3 4/5] rust: Move register and bitfield macros out of Nova Joel Fernandes
2025-09-09 21:36   ` Miguel Ojeda
2025-09-10  0:15     ` Joel Fernandes
2025-09-09 21:20 ` [PATCH v3 5/5] rust: Add KUNIT tests for bitfield Joel Fernandes
2025-09-10  3:04   ` Yury Norov
2025-09-10 23:08     ` Joel Fernandes
2025-09-11  1:47       ` Yury Norov
2025-09-16  9:59         ` Joel Fernandes
2025-09-16 10:10           ` Joel Fernandes
2025-09-19 23:02           ` Joel Fernandes
2025-09-20  0:39           ` Joel Fernandes
2025-09-20  0:52             ` John Hubbard
2025-09-20  9:33               ` Joel Fernandes
2025-09-21 11:41             ` Miguel Ojeda
2025-09-10 23:22     ` Joel Fernandes

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.