From: Andreas Hindborg <a.hindborg@kernel.org>
To: "Danilo Krummrich" <dakr@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Tamir Duberstein" <tamird@gmail.com>,
"Viresh Kumar" <viresh.kumar@linaro.org>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Maíra Canal" <mcanal@igalia.com>
Subject: [PATCH v3 0/2] rust: improve `ForeignOwnable`
Date: Thu, 12 Jun 2025 15:09:42 +0200 [thread overview]
Message-ID: <20250612-pointed-to-v3-0-b009006d86a1@kernel.org> (raw)
This series improves `ForeignOwnable` by:
- changing the way we assert pointer allignment,
- improving the safety requirements of the trait.
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
---
Changes in v3:
- Remove more instances of absolute paths to `ffi` types.
- Reword safety requirements in terms of function guarantees.
- Add a patch to restrict use of null pointers with `ForeignOwnable`.
- Link to v2: https://lore.kernel.org/r/20250610-pointed-to-v2-1-fad8f92cf1e5@kernel.org
Changes in v2:
- Replace qualified path with `use` for `crate::ffi::c_void`.
- Fix a typo and rephrase docs for `ForeignOwnable`.
- Reorganize docs for `ForeignOwnable::into_foreign`.
- Link to v1: https://lore.kernel.org/r/20250605-pointed-to-v1-1-ee1e262912cc@kernel.org
---
Andreas Hindborg (2):
rust: types: add FOREIGN_ALIGN to ForeignOwnable
rust: types: require `ForeignOwnable::into_foreign` return non-null
rust/kernel/alloc/kbox.rs | 41 +++++++++++++++++++++++------------------
rust/kernel/miscdevice.rs | 10 +++++-----
rust/kernel/pci.rs | 2 +-
rust/kernel/platform.rs | 2 +-
rust/kernel/sync/arc.rs | 24 +++++++++++++-----------
rust/kernel/types.rs | 46 +++++++++++++++++++++++-----------------------
rust/kernel/xarray.rs | 9 +++++----
7 files changed, 71 insertions(+), 63 deletions(-)
---
base-commit: ec7714e4947909190ffb3041a03311a975350fe0
change-id: 20250605-pointed-to-6170ae01520f
Best regards,
--
Andreas Hindborg <a.hindborg@kernel.org>
next reply other threads:[~2025-06-12 13:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 13:09 Andreas Hindborg [this message]
2025-06-12 13:09 ` [PATCH v3 1/2] rust: types: add FOREIGN_ALIGN to ForeignOwnable Andreas Hindborg
2025-06-12 13:09 ` [PATCH v3 2/2] rust: types: require `ForeignOwnable::into_foreign` return non-null Andreas Hindborg
2025-06-12 14:52 ` Benno Lossin
2025-06-13 12:53 ` Andreas Hindborg
2025-06-14 18:53 ` Benno Lossin
2025-06-27 14:20 ` [PATCH v3 0/2] rust: improve `ForeignOwnable` Alice Ryhl
2025-07-14 23:32 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250612-pointed-to-v3-0-b009006d86a1@kernel.org \
--to=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bhelgaas@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mcanal@igalia.com \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@gmail.com \
--cc=tmgross@umich.edu \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).