linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] Rust pin-init for v6.17
@ 2025-07-08 14:14 Benno Lossin
  2025-07-08 18:33 ` Andreas Hindborg
  2025-07-13 21:13 ` Miguel Ojeda
  0 siblings, 2 replies; 3+ messages in thread
From: Benno Lossin @ 2025-07-08 14:14 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Andreas Hindborg, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, Breno Leitao, Fiona Behrens, Christian Schrefl,
	Alban Kurti, Michael Vetter
  Cc: linux-block, rust-for-linux, linux-kernel

Hi Miguel,

This time there are a couple of interesting changes, see below. Most
importantly, we can now use `Result` as an initializer. And implement
`Zeroable` via the `MaybeZeroable` derive macro. When the second part of
[1] is merged, this will make all types in bindings that can be zeroed
implement `Zeroable`.

There is one small mistake in the second commit e832374ccadf ("rust:
pin-init: change blanket impls for `[Pin]Init` and add one for
`Result<T, E>`") I forgot to ping Andreas about the changes in Rust
block and thus don't have his Acked-by. We discussed this privately
and he his okay with the changes. I didn't rebase due to the fact that
the commit already is pretty old and that Danilo already merged that
commit into driver-core-next, see below. Sorry about this!

All commits have been in linux-next for over three weeks.

No conflicts expected.

Note that driver-core-next is also merging the tag
`pin-init-v6.17-result-blanket` that includes the first two commits.

Please pull for v6.17 -- thanks!

[1]: https://lore.kernel.org/all/20250523145125.523275-1-lossin@kernel.org

---
Cheers,
Benno

The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:

  Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)

are available in the Git repository at:

  https://github.com/Rust-for-Linux/linux.git tags/pin-init-v6.17

for you to fetch changes up to fc3870dc5cadb701b4122e4a8daa85f9fa2f57b9:

  rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests (2025-06-11 21:13:57 +0200)

----------------------------------------------------------------
pin-init changes for v6.17

Added:

- 'impl<T, E> [Pin]Init<T, E> for Result<T, E>', so results are now
  (pin-)initializers.

- 'Zeroable::init_zeroed()' delegating to 'init_zeroed()'.

- New 'zeroed()', a safe version of 'mem::zeroed()' and also provide
  it via 'Zeroable::zeroed()'.

- Implement 'Zeroable' for 'Option<&T>' and 'Option<&mut T>'.

- Implement 'Zeroable' for 'Option<[unsafe] [extern "abi"]
  fn(...args...) -> ret>' for '"Rust"' and '"C"' ABIs and up to 20
  arguments.

Changed:

- Blanket impls of 'Init' and 'PinInit' from 'impl<T, E> [Pin]Init<T, E>
  for T' to 'impl<T> [Pin]Init<T> for T'.

- Renamed 'zeroed()' to 'init_zeroed()'.

Upstream dev news:

- More CI improvements to deny warnings, use '--all-targets'. Also check
  the synchronization status of the two '-next' branches in upstream and
  the kernel.

----------------------------------------------------------------
Benno Lossin (12):
      rust: pin-init: improve safety documentation for `impl<T> [Pin]Init<T> for T`
      rust: pin-init: change blanket impls for `[Pin]Init` and add one for `Result<T, E>`
      rust: pin-init: examples, tests: add conditional compilation in order to compile under any feature combination
      rust: pin-init: examples: pthread_mutex: disable the main test for miri
      rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature
      rust: pin-init: rename `zeroed` to `init_zeroed`
      rust: pin-init: add `Zeroable::init_zeroed`
      rust: pin-init: add `zeroed()` & `Zeroable::zeroed()` functions
      rust: pin-init: implement `ZeroableOption` for `&T` and `&mut T`
      rust: pin-init: change `impl Zeroable for Option<NonNull<T>>` to `ZeroableOption for NonNull<T>`
      rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments
      rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests

Miguel Ojeda (2):
      rust: init: re-enable doctests
      rust: init: remove doctest's `Error::from_errno` workaround

 rust/kernel/block/mq/tag_set.rs               |  12 +-
 rust/kernel/configfs.rs                       |   4 +-
 rust/kernel/init.rs                           |  28 ++---
 rust/pin-init/README.md                       |   2 +-
 rust/pin-init/examples/big_struct_in_place.rs |  28 +++--
 rust/pin-init/examples/linked_list.rs         |  10 +-
 rust/pin-init/examples/mutex.rs               |  97 +++++++++-------
 rust/pin-init/examples/pthread_mutex.rs       |   4 +
 rust/pin-init/examples/static_init.rs         |  75 ++++++------
 rust/pin-init/src/__internal.rs               |   1 +
 rust/pin-init/src/lib.rs                      | 158 ++++++++++++++++++++++----
 rust/pin-init/src/macros.rs                   |  16 +--
 12 files changed, 287 insertions(+), 148 deletions(-)

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

* Re: [GIT PULL] Rust pin-init for v6.17
  2025-07-08 14:14 [GIT PULL] Rust pin-init for v6.17 Benno Lossin
@ 2025-07-08 18:33 ` Andreas Hindborg
  2025-07-13 21:13 ` Miguel Ojeda
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Hindborg @ 2025-07-08 18:33 UTC (permalink / raw)
  To: Benno Lossin
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Breno Leitao, Fiona Behrens, Christian Schrefl, Alban Kurti,
	Michael Vetter, linux-block, rust-for-linux, linux-kernel

Benno Lossin <lossin@kernel.org> writes:

> Hi Miguel,
>
> This time there are a couple of interesting changes, see below. Most
> importantly, we can now use `Result` as an initializer. And implement
> `Zeroable` via the `MaybeZeroable` derive macro. When the second part of
> [1] is merged, this will make all types in bindings that can be zeroed
> implement `Zeroable`.
>
> There is one small mistake in the second commit e832374ccadf ("rust:
> pin-init: change blanket impls for `[Pin]Init` and add one for
> `Result<T, E>`") I forgot to ping Andreas about the changes in Rust
> block and thus don't have his Acked-by. We discussed this privately
> and he his okay with the changes. I didn't rebase due to the fact that
> the commit already is pretty old and that Danilo already merged that
> commit into driver-core-next, see below. Sorry about this!

Acked-by: Andreas Hindborg <a.hindborg@kernel.org>


Best regards,
Andreas Hindborg



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

* Re: [GIT PULL] Rust pin-init for v6.17
  2025-07-08 14:14 [GIT PULL] Rust pin-init for v6.17 Benno Lossin
  2025-07-08 18:33 ` Andreas Hindborg
@ 2025-07-13 21:13 ` Miguel Ojeda
  1 sibling, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2025-07-13 21:13 UTC (permalink / raw)
  To: Benno Lossin
  Cc: Miguel Ojeda, Alex Gaynor, Andreas Hindborg, Boqun Feng, Gary Guo,
	Björn Roy Baron, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Breno Leitao, Fiona Behrens, Christian Schrefl, Alban Kurti,
	Michael Vetter, linux-block, rust-for-linux, linux-kernel

On Tue, Jul 8, 2025 at 4:15 PM Benno Lossin <lossin@kernel.org> wrote:
>
> Please pull for v6.17 -- thanks!

Merged into `rust-next` -- thank you!

I added Andreas' Acked-by in the merge commit as discussed.

I noticed a missing space while inspecting the commits, so I sent a PR
to you upstream so that eventually it arrives back here:

    https://github.com/Rust-for-Linux/pin-init/pull/73

Cheers,
Miguel

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

end of thread, other threads:[~2025-07-13 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08 14:14 [GIT PULL] Rust pin-init for v6.17 Benno Lossin
2025-07-08 18:33 ` Andreas Hindborg
2025-07-13 21:13 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).