Allow inlining C helpers into Rust when using LTO
Subsystems (17)
Alice Ryhl
maintainerv2 cover Allow inlining C helpers into Rust when using LTO
This patch series adds __rust_helper to every single rust helper. The patches do not depend on each other, so maintainers please go ahead and pick up any patches relevant to your subsystem! Or provide your Acked-by so that Miguel can pick them up.
These changes were generated by adding __rust_helper and running ClangFormat. Unrelated formatting changes were removed manually.
Why is __rust_helper needed?
============================
Currently, C helpers cannot be inlined into Rust even when using LTO because LLVM detects slightly different options on the codegen units.
* LLVM doesn't want to inline functions compiled with -fno-delete-null-pointer-checks with code compiled without. The C CGUs all have this enabled and Rust CGUs don't. Inlining is okay since this is one of the hardening features that does not change the ABI, and we shouldn't have null pointer dereferences in these helpers.
* LLVM doesn't want to inline functions with different list of builtins. C side has -fno-builtin-wcslen; wcslen is not a Rust builtin, so they should be compatible, but LLVM does not perform inlining due to attributes mismatch.
* clang and Rust doesn't have the exact target string. Clang generates +cmov,+cx8,+fxsr but Rust doesn't enable them (in fact, Rust will complain if -Ctarget-feature=+cmov,+cx8,+fxsr is used). x86-64 always enable these features, so they are in fact the same target string, but LLVM doesn't understand this and so inlining is inhibited. This can be bypassed with --ignore-tti-inline-compatible, but this is a hidden option.
(This analysis was written by Gary Guo.)
How is this fixed?
==================
To fix this we need to add __always_inline to all helpers when compiling with LTO. However, it should not be added when running bindgen as bindgen will ignore functions marked inline. To achieve this, we are using a #define called __rust_helper that is defined differently depending on whether bindgen is running or not.
Note that __rust_helper is currently always #defined to nothing. Changing it to __always_inline will happen separately in another patch series.
---
Changes in v2:
- Pick up Reviewed-by: Boqun Feng <[email protected]>, Gary Guo <[email protected]>
- Update formatting in mm and slab patches.
- Add new helpers in files uaccess, pwm, and time.
- Drop any patches that have been merged.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Alice Ryhl (27):
rust: barrier: add __rust_helper to helpers
rust: blk: add __rust_helper to helpers
rust: bug: add __rust_helper to helpers
rust: clk: add __rust_helper to helpers
rust: completion: add __rust_helper to helpers
rust: cpu: add __rust_helper to helpers
rust: cred: add __rust_helper to helpers
rust: err: add __rust_helper to helpers
rust: jump_label: add __rust_helper to helpers
rust: maple_tree: add __rust_helper to helpers
rust: mm: add __rust_helper to helpers
rust: of: add __rust_helper to helpers
rust: processor: add __rust_helper to helpers
rust: pwm: add __rust_helper to helpers
rust: rbtree: add __rust_helper to helpers
rust: rcu: add __rust_helper to helpers
rust: refcount: add __rust_helper to helpers
rust: security: add __rust_helper to helpers
rust: slab: add __rust_helper to helpers
rust: sync: add __rust_helper to helpers
rust: task: add __rust_helper to helpers
rust: time: add __rust_helper to helpers
rust: uaccess: add __rust_helper to helpers
rust: usb: add __rust_helper to helpers
rust: wait: add __rust_helper to helpers
rust: workqueue: add __rust_helper to helpers
rust: xarray: add __rust_helper to helpers
rust/helpers/barrier.c | 6 +++--- rust/helpers/blk.c | 4 ++-- rust/helpers/bug.c | 4 ++-- rust/helpers/build_bug.c | 2 +- rust/helpers/clk.c | 24 +++++++++++++----------- rust/helpers/completion.c | 2 +- rust/helpers/cpu.c | 2 +- rust/helpers/cred.c | 4 ++-- rust/helpers/err.c | 6 +++--- rust/helpers/jump_label.c | 2 +- rust/helpers/maple_tree.c | 3 ++- rust/helpers/mm.c | 20 ++++++++++---------- rust/helpers/mutex.c | 13 +++++++------ rust/helpers/of.c | 2 +- rust/helpers/page.c | 9 +++++---- rust/helpers/processor.c | 2 +- rust/helpers/pwm.c | 6 +++--- rust/helpers/rbtree.c | 9 +++++---- rust/helpers/rcu.c | 4 ++-- rust/helpers/refcount.c | 10 +++++----- rust/helpers/security.c | 26 +++++++++++++++----------- rust/helpers/signal.c | 2 +- rust/helpers/slab.c | 4 ++-- rust/helpers/spinlock.c | 13 +++++++------ rust/helpers/sync.c | 4 ++-- rust/helpers/task.c | 24 ++++++++++++------------ rust/helpers/time.c | 14 +++++++------- rust/helpers/uaccess.c | 10 ++++++---- rust/helpers/usb.c | 3 ++- rust/helpers/vmalloc.c | 2 +- rust/helpers/wait.c | 2 +- rust/helpers/workqueue.c | 8 +++++--- rust/helpers/xarray.c | 10 +++++----- 33 files changed, 136 insertions(+), 120 deletions(-)
---
base-commit: 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb
change-id: 20251202-define-rust-helper-f7b531813007
Best regards,
Signature · 1 line
Alice Ryhl <[email protected]>
Alice Ryhl
maintainerPATCH v2 1/27 rust: barrier: add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
---
Cc: Peter Zijlstra <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: Elle Rhumsaa <[email protected]>
--- rust/helpers/barrier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
rust/helpers/barrier.c +3 -3
@@ -2,17 +2,17 @@#include <asm/barrier.h> -void rust_helper_smp_mb (void ) +__rust_helper void rust_helper_smp_mb(void) {smp_mb (); } -void rust_helper_smp_wmb (void ) +__rust_helper void rust_helper_smp_wmb(void) {smp_wmb (); } -void rust_helper_smp_rmb (void ) +__rust_helper void rust_helper_smp_rmb(void) {smp_rmb (); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: barrier: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: aa574e0f21a6e7a28e4b8794ad4238d3bfd4f9df Gitweb: https://git.kernel.org/tip/aa574e0f21a6e7a28e4b8794ad4238d3bfd4f9df Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:14 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:41 +08:00
rust: barrier: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/barrier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
rust/helpers/barrier.c +3 -3
@@ -2,17 +2,17 @@#include <asm/barrier.h> -void rust_helper_smp_mb (void ) +__rust_helper void rust_helper_smp_mb(void) {smp_mb (); } -void rust_helper_smp_wmb (void ) +__rust_helper void rust_helper_smp_wmb(void) {smp_wmb (); } -void rust_helper_smp_rmb (void ) +__rust_helper void rust_helper_smp_rmb(void) {smp_rmb (); }
Alice Ryhl
maintainerPATCH v2 2/27 rust: blk: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Andreas Hindborg <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: [email protected]
--- rust/helpers/blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/blk.c +2 -2
@@ -3,12 +3,12 @@#include <linux/blk-mq.h> #include <linux/blkdev.h> -void *rust_helper_blk_mq_rq_to_pdu (struct request *rq) +__rust_helper void *rust_helper_blk_mq_rq_to_pdu(struct request *rq) {return blk_mq_rq_to_pdu (rq); } -struct request *rust_helper_blk_mq_rq_from_pdu (void *pdu) +__rust_helper struct request *rust_helper_blk_mq_rq_from_pdu(void *pdu) {return blk_mq_rq_from_pdu (pdu); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 02/27] rust: blk: add __rust_helper to helpers
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Best regards,
Andreas Hindborg
[tip: locking/core] rust: blk: Add __rust_helper to helpers
In reply to Alice RyhlThe following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 71a4d13fa1cf2b7a4f45a6ee41548c27783f7940 Gitweb: https://git.kernel.org/tip/71a4d13fa1cf2b7a4f45a6ee41548c27783f7940 Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:15 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:41 +08:00
rust: blk: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/blk.c +2 -2
@@ -3,12 +3,12 @@#include <linux/blk-mq.h> #include <linux/blkdev.h> -void *rust_helper_blk_mq_rq_to_pdu (struct request *rq) +__rust_helper void *rust_helper_blk_mq_rq_to_pdu(struct request *rq) {return blk_mq_rq_to_pdu (rq); } -struct request *rust_helper_blk_mq_rq_from_pdu (void *pdu) +__rust_helper struct request *rust_helper_blk_mq_rq_from_pdu(void *pdu) {return blk_mq_rq_from_pdu (pdu); }
Alice Ryhl
maintainerPATCH v2 3/27 rust: bug: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: FUJITA Tomonori <[email protected]>
Cc: Miguel Ojeda <[email protected]>
--- rust/helpers/bug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/bug.c +2 -2
@@ -2,12 +2,12 @@#include <linux/bug.h> -__noreturn void rust_helper_BUG (void ) +__rust_helper __noreturn void rust_helper_BUG(void) {BUG (); } -bool rust_helper_WARN_ON (bool cond) +__rust_helper bool rust_helper_WARN_ON(bool cond) {return WARN_ON (cond); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 4/27 rust: clk: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Michael Turquette <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
--- rust/helpers/clk.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
rust/helpers/clk.c +13 -11
@@ -7,60 +7,62 @@* CONFIG_HAVE_CLK or CONFIG_HAVE_CLK_PREPARE aren't set. */ #ifndef CONFIG_HAVE_CLK -struct clk *rust_helper_clk_get (struct device *dev,const char *id) +__rust_helper struct clk *rust_helper_clk_get(struct device *dev, +const char *id) {return clk_get (dev, id); } -void rust_helper_clk_put (struct clk *clk) +__rust_helper void rust_helper_clk_put(struct clk *clk) {clk_put (clk); } -int rust_helper_clk_enable (struct clk *clk) +__rust_helper int rust_helper_clk_enable(struct clk *clk) {return clk_enable (clk); } -void rust_helper_clk_disable (struct clk *clk) +__rust_helper void rust_helper_clk_disable(struct clk *clk) {clk_disable (clk); } -unsigned long rust_helper_clk_get_rate (struct clk *clk) +__rust_helper unsigned long rust_helper_clk_get_rate (struct clk *clk) {return clk_get_rate (clk); } -int rust_helper_clk_set_rate (struct clk *clk,unsigned long rate) +__rust_helper int rust_helper_clk_set_rate(struct clk *clk, unsigned long rate) {return clk_set_rate (clk, rate); }#endif #ifndef CONFIG_HAVE_CLK_PREPARE -int rust_helper_clk_prepare (struct clk *clk) +__rust_helper int rust_helper_clk_prepare(struct clk *clk) {return clk_prepare (clk); } -void rust_helper_clk_unprepare (struct clk *clk) +__rust_helper void rust_helper_clk_unprepare(struct clk *clk) {clk_unprepare (clk); }#endif -struct clk *rust_helper_clk_get_optional (struct device *dev,const char *id) +__rust_helper struct clk *rust_helper_clk_get_optional(struct device *dev, +const char *id) {return clk_get_optional (dev, id); } -int rust_helper_clk_prepare_enable (struct clk *clk) +__rust_helper int rust_helper_clk_prepare_enable(struct clk *clk) {return clk_prepare_enable (clk); } -void rust_helper_clk_disable_unprepare (struct clk *clk) +__rust_helper void rust_helper_clk_disable_unprepare(struct clk *clk) {clk_disable_unprepare (clk); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 04/27] rust: clk: add __rust_helper to helpers
Quoting Alice Ryhl (2026-01-05 04:42:17)
Quoted 6 lines
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>---
Alice Ryhl
maintainerPATCH v2 5/27 rust: completion: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Benno Lossin <[email protected]>
Cc: Danilo Krummrich <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: Miguel Ojeda <[email protected]>
--- rust/helpers/completion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/completion.c +1 -1
@@ -2,7 +2,7 @@#include <linux/completion.h> -void rust_helper_init_completion (struct completion *x) +__rust_helper void rust_helper_init_completion(struct completion *x) {init_completion (x); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: completion: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 1c7a6f48f7eeb3014584d2fc55fc67f0cbaeef69 Gitweb: https://git.kernel.org/tip/1c7a6f48f7eeb3014584d2fc55fc67f0cbaeef69 Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:18 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:41 +08:00
rust: completion: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/completion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/completion.c +1 -1
@@ -2,7 +2,7 @@#include <linux/completion.h> -void rust_helper_init_completion (struct completion *x) +__rust_helper void rust_helper_init_completion(struct completion *x) {init_completion (x); }
Alice Ryhl
maintainerPATCH v2 6/27 rust: cpu: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
--- rust/helpers/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/cpu.c +1 -1
@@ -2,7 +2,7 @@#include <linux/smp.h> -unsigned int rust_helper_raw_smp_processor_id (void ) +__rust_helper unsigned int rust_helper_raw_smp_processor_id(void) {return raw_smp_processor_id (); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: cpu: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 9f658bd5378d5c357d5eeb1e699f1504a7498dbf Gitweb: https://git.kernel.org/tip/9f658bd5378d5c357d5eeb1e699f1504a7498dbf Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:19 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:41 +08:00
rust: cpu: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/cpu.c +1 -1
@@ -2,7 +2,7 @@#include <linux/smp.h> -unsigned int rust_helper_raw_smp_processor_id (void ) +__rust_helper unsigned int rust_helper_raw_smp_processor_id(void) {return raw_smp_processor_id (); }
Alice Ryhl
maintainerPATCH v2 7/27 rust: cred: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Paul Moore <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: [email protected]
--- rust/helpers/cred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/cred.c +2 -2
@@ -2,12 +2,12 @@#include <linux/cred.h> -const struct cred *rust_helper_get_cred (const struct cred *cred) +__rust_helper const struct cred *rust_helper_get_cred(const struct cred *cred) {return get_cred (cred); } -void rust_helper_put_cred (const struct cred *cred) +__rust_helper void rust_helper_put_cred(const struct cred *cred) {put_cred (cred); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 7 lines
---
Cc: Paul Moore <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: [email protected]--- rust/helpers/cred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
paul-moore.com
Paul Moore
maintainerRe: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Quoted 16 lines · Paul Moore
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>Quoted 7 lines
---
Cc: Paul Moore <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: [email protected]--- rust/helpers/cred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 1 line
Acked-by Paul Moore <[email protected]>
Ooops, sorry, I just saw that these were okay to merge into the various subsystem trees. Merged into lsm/dev, thanks.
Signature · 1 line
paul-moore.com
Alice Ryhl
maintainerRe: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Quoted 18 lines · Paul Moore
Quoted 16 lines · Paul Moore
Quoted 13 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>---
Cc: Paul Moore <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: [email protected]--- rust/helpers/cred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines
Quoted 1 line
Acked-by Paul Moore <[email protected]>Ooops, sorry, I just saw that these were okay to merge into the various subsystem trees. Merged into lsm/dev, thanks.
Thanks!
Alice Ryhl
maintainerPATCH v2 8/27 rust: err: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
--- rust/helpers/build_bug.c | 2 +- rust/helpers/err.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
rust/helpers/build_bug.c +1 -1
@@ -2,7 +2,7 @@#include <linux/errname.h> -const char *rust_helper_errname (int err) +__rust_helper const char *rust_helper_errname(int err) {return errname (err); }
rust/helpers/err.c +3 -3
@@ -2,17 +2,17 @@#include <linux/err.h> -__force void *rust_helper_ERR_PTR (long err) +__rust_helper __force void *rust_helper_ERR_PTR(long err) {return ERR_PTR (err); } -bool rust_helper_IS_ERR (__force const void *ptr) +__rust_helper bool rust_helper_IS_ERR(__force const void *ptr) {return IS_ERR (ptr); } -long rust_helper_PTR_ERR (__force const void *ptr) +__rust_helper long rust_helper_PTR_ERR (__force const void *ptr) {return PTR_ERR (ptr); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 9/27 rust: jump_label: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Peter Zijlstra <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
--- rust/helpers/jump_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/jump_label.c +1 -1
@@ -7,7 +7,7 @@#include <linux/jump_label.h> #ifndef CONFIG_JUMP_LABEL -int rust_helper_static_key_count (struct static_key *key) +__rust_helper int rust_helper_static_key_count(struct static_key *key) {return static_key_count (key); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 6 lines
---
Cc: Peter Zijlstra <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
This one is the last one -- I guess if new ones were added during the merge window, we can have a v3 next cycle with this one plus any new ones.
Otherwise, I guess I will end up applying it after -rc1 -- and Acked-by would be nice.
Thanks!
Cheers,
Miguel
Re: [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
Quoted 14 lines · Miguel Ojeda
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>Quoted 6 lines
---
Cc: Peter Zijlstra <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Quoted 6 lines
This one is the last one -- I guess if new ones were added during the merge window, we can have a v3 next cycle with this one plus any new ones.
Otherwise, I guess I will end up applying it after -rc1 -- and Acked-by would be nice.
Sure
I think Alison poked me on this, but cracks and all :/ Feel free to take through rust tree.
Re: [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
Quoted 7 lines · Peter Zijlstra
Sure
I think Alison poked me on this, but cracks and all :/ Feel free to take through rust tree.
Thanks, will do!
Cheers,
Miguel
Alice Ryhl
maintainerPATCH v2 10/27 rust: maple_tree: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Andrew Morton <[email protected]>
Cc: "Liam R. Howlett" <[email protected]>
Cc: Andrew Ballance <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- rust/helpers/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
rust/helpers/maple_tree.c +2 -1
@@ -2,7 +2,8 @@#include <linux/maple_tree.h> -void rust_helper_mt_init_flags (struct maple_tree *mt,unsigned int flags) +__rust_helper void rust_helper_mt_init_flags(struct maple_tree *mt, +unsigned int flags) {mt_init_flags (mt, flags); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 10/27] rust: maple_tree: add __rust_helper to helpers
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Acked-by Andrew Ballance <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 28 lines
---
Cc: Andrew Morton <[email protected]>
Cc: "Liam R. Howlett" <[email protected]>
Cc: Andrew Ballance <[email protected]>
Cc: [email protected]
Cc: [email protected]--- rust/helpers/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)rust/helpers/maple_tree.c +2
-1@@ -2,7 +2,8 @@#include <linux/maple_tree.h> -void rust_helper_mt_init_flags (struct maple_tree *mt,unsigned int flags) +__rust_helper void rust_helper_mt_init_flags(struct maple_tree *mt, +unsigned int flags) {mt_init_flags (mt, flags); }Signature · 2 lines
-- 2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 11/27 rust: mm: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Andrew Morton <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: "Liam R. Howlett" <[email protected]>
Cc: Uladzislau Rezki <[email protected]>
Cc: Vitaly Wool <[email protected]>
Cc: [email protected]
--- rust/helpers/mm.c | 20 ++++++++++---------- rust/helpers/page.c | 9 +++++---- rust/helpers/vmalloc.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-)
rust/helpers/mm.c +10 -10
@@ -3,48 +3,48 @@#include <linux/mm.h> #include <linux/sched/mm.h> -void rust_helper_mmgrab (struct mm_struct *mm) +__rust_helper void rust_helper_mmgrab(struct mm_struct *mm) {mmgrab (mm); } -void rust_helper_mmdrop (struct mm_struct *mm) +__rust_helper void rust_helper_mmdrop(struct mm_struct *mm) {mmdrop (mm); } -void rust_helper_mmget (struct mm_struct *mm) +__rust_helper void rust_helper_mmget(struct mm_struct *mm) {mmget (mm); } -bool rust_helper_mmget_not_zero (struct mm_struct *mm) +__rust_helper bool rust_helper_mmget_not_zero(struct mm_struct *mm) {return mmget_not_zero (mm); } -void rust_helper_mmap_read_lock (struct mm_struct *mm) +__rust_helper void rust_helper_mmap_read_lock(struct mm_struct *mm) {mmap_read_lock (mm); } -bool rust_helper_mmap_read_trylock (struct mm_struct *mm) +__rust_helper bool rust_helper_mmap_read_trylock(struct mm_struct *mm) {return mmap_read_trylock (mm); } -void rust_helper_mmap_read_unlock (struct mm_struct *mm) +__rust_helper void rust_helper_mmap_read_unlock(struct mm_struct *mm) {mmap_read_unlock (mm); } -struct vm_area_struct *rust_helper_vma_lookup (struct mm_struct *mm, -unsigned long addr) +__rust_helper struct vm_area_struct * +rust_helper_vma_lookup (struct mm_struct *mm,unsigned long addr) {return vma_lookup (mm, addr); } -void rust_helper_vma_end_read (struct vm_area_struct *vma) +__rust_helper void rust_helper_vma_end_read(struct vm_area_struct *vma) {vma_end_read (vma); }
rust/helpers/page.c +5 -4
@@ -4,23 +4,24 @@#include <linux/highmem.h> #include <linux/mm.h> -struct page *rust_helper_alloc_pages (gfp_t gfp_mask,unsigned int order) +__rust_helper struct page *rust_helper_alloc_pages(gfp_t gfp_mask, +unsigned int order) {return alloc_pages (gfp_mask, order); } -void *rust_helper_kmap_local_page (struct page *page) +__rust_helper void *rust_helper_kmap_local_page(struct page *page) {return kmap_local_page (page); } -void rust_helper_kunmap_local (const void *addr) +__rust_helper void rust_helper_kunmap_local(const void *addr) {kunmap_local (addr); }#ifndef NODE_NOT_IN_PAGE_FLAGS -int rust_helper_page_to_nid (const struct page *page) +__rust_helper int rust_helper_page_to_nid(const struct page *page) {return page_to_nid (page); }
rust/helpers/vmalloc.c +1 -1
@@ -2,7 +2,7 @@#include <linux/vmalloc.h> -void * __must_check __realloc_size(2) +__rust_helper void *__must_check __realloc_size(2) rust_helper_vrealloc_node_align(const void *p, size_t size, unsigned long align, gfp_t flags, int node) {
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 11/27] rust: mm: add __rust_helper to helpers
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 126 lines
---
Cc: Andrew Morton <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: "Liam R. Howlett" <[email protected]>
Cc: Uladzislau Rezki <[email protected]>
Cc: Vitaly Wool <[email protected]>
Cc: [email protected]--- rust/helpers/mm.c | 20 ++++++++++---------- rust/helpers/page.c | 9 +++++---- rust/helpers/vmalloc.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-)rust/helpers/mm.c +10
-10@@ -3,48 +3,48 @@#include <linux/mm.h> #include <linux/sched/mm.h> -void rust_helper_mmgrab (struct mm_struct *mm) +__rust_helper void rust_helper_mmgrab(struct mm_struct *mm) {mmgrab (mm); } -void rust_helper_mmdrop (struct mm_struct *mm) +__rust_helper void rust_helper_mmdrop(struct mm_struct *mm) {mmdrop (mm); } -void rust_helper_mmget (struct mm_struct *mm) +__rust_helper void rust_helper_mmget(struct mm_struct *mm) {mmget (mm); } -bool rust_helper_mmget_not_zero (struct mm_struct *mm) +__rust_helper bool rust_helper_mmget_not_zero(struct mm_struct *mm) {return mmget_not_zero (mm); } -void rust_helper_mmap_read_lock (struct mm_struct *mm) +__rust_helper void rust_helper_mmap_read_lock(struct mm_struct *mm) {mmap_read_lock (mm); } -bool rust_helper_mmap_read_trylock (struct mm_struct *mm) +__rust_helper bool rust_helper_mmap_read_trylock(struct mm_struct *mm) {return mmap_read_trylock (mm); } -void rust_helper_mmap_read_unlock (struct mm_struct *mm) +__rust_helper void rust_helper_mmap_read_unlock(struct mm_struct *mm) {mmap_read_unlock (mm); } -struct vm_area_struct *rust_helper_vma_lookup (struct mm_struct *mm, -unsigned long addr) +__rust_helper struct vm_area_struct * +rust_helper_vma_lookup (struct mm_struct *mm,unsigned long addr) {return vma_lookup (mm, addr); } -void rust_helper_vma_end_read (struct vm_area_struct *vma) +__rust_helper void rust_helper_vma_end_read(struct vm_area_struct *vma) {vma_end_read (vma); }rust/helpers/page.c +5
-4@@ -4,23 +4,24 @@#include <linux/highmem.h> #include <linux/mm.h> -struct page *rust_helper_alloc_pages (gfp_t gfp_mask,unsigned int order) +__rust_helper struct page *rust_helper_alloc_pages(gfp_t gfp_mask, +unsigned int order) {return alloc_pages (gfp_mask, order); } -void *rust_helper_kmap_local_page (struct page *page) +__rust_helper void *rust_helper_kmap_local_page(struct page *page) {return kmap_local_page (page); } -void rust_helper_kunmap_local (const void *addr) +__rust_helper void rust_helper_kunmap_local(const void *addr) {kunmap_local (addr); }#ifndef NODE_NOT_IN_PAGE_FLAGS -int rust_helper_page_to_nid (const struct page *page) +__rust_helper int rust_helper_page_to_nid(const struct page *page) {return page_to_nid (page); }rust/helpers/vmalloc.c +1
-1@@ -2,7 +2,7 @@#include <linux/vmalloc.h> -void * __must_check __realloc_size(2) +__rust_helper void *__must_check __realloc_size(2) rust_helper_vrealloc_node_align(const void *p, size_t size, unsigned long align, gfp_t flags, int node) {Signature · 2 lines
-- 2.52.0.351.gbe84eed79e-goog
Lorenzo Stoakes
Reviewed-byRe: [PATCH v2 11/27] rust: mm: add __rust_helper to helpers
Quoted 8 lines · Liam R. Howlett
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>Acked-by Liam R. Howlett <[email protected]>
Seems straightforward enough so:
Quoted 127 lines
Quoted 127 lines
---
Cc: Andrew Morton <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: "Liam R. Howlett" <[email protected]>
Cc: Uladzislau Rezki <[email protected]>
Cc: Vitaly Wool <[email protected]>
Cc: [email protected]--- rust/helpers/mm.c | 20 ++++++++++---------- rust/helpers/page.c | 9 +++++---- rust/helpers/vmalloc.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-)rust/helpers/mm.c +10
-10@@ -3,48 +3,48 @@#include <linux/mm.h> #include <linux/sched/mm.h> -void rust_helper_mmgrab (struct mm_struct *mm) +__rust_helper void rust_helper_mmgrab(struct mm_struct *mm) {mmgrab (mm); } -void rust_helper_mmdrop (struct mm_struct *mm) +__rust_helper void rust_helper_mmdrop(struct mm_struct *mm) {mmdrop (mm); } -void rust_helper_mmget (struct mm_struct *mm) +__rust_helper void rust_helper_mmget(struct mm_struct *mm) {mmget (mm); } -bool rust_helper_mmget_not_zero (struct mm_struct *mm) +__rust_helper bool rust_helper_mmget_not_zero(struct mm_struct *mm) {return mmget_not_zero (mm); } -void rust_helper_mmap_read_lock (struct mm_struct *mm) +__rust_helper void rust_helper_mmap_read_lock(struct mm_struct *mm) {mmap_read_lock (mm); } -bool rust_helper_mmap_read_trylock (struct mm_struct *mm) +__rust_helper bool rust_helper_mmap_read_trylock(struct mm_struct *mm) {return mmap_read_trylock (mm); } -void rust_helper_mmap_read_unlock (struct mm_struct *mm) +__rust_helper void rust_helper_mmap_read_unlock(struct mm_struct *mm) {mmap_read_unlock (mm); } -struct vm_area_struct *rust_helper_vma_lookup (struct mm_struct *mm, -unsigned long addr) +__rust_helper struct vm_area_struct * +rust_helper_vma_lookup (struct mm_struct *mm,unsigned long addr) {return vma_lookup (mm, addr); } -void rust_helper_vma_end_read (struct vm_area_struct *vma) +__rust_helper void rust_helper_vma_end_read(struct vm_area_struct *vma) {vma_end_read (vma); }rust/helpers/page.c +5
-4@@ -4,23 +4,24 @@#include <linux/highmem.h> #include <linux/mm.h> -struct page *rust_helper_alloc_pages (gfp_t gfp_mask,unsigned int order) +__rust_helper struct page *rust_helper_alloc_pages(gfp_t gfp_mask, +unsigned int order) {return alloc_pages (gfp_mask, order); } -void *rust_helper_kmap_local_page (struct page *page) +__rust_helper void *rust_helper_kmap_local_page(struct page *page) {return kmap_local_page (page); } -void rust_helper_kunmap_local (const void *addr) +__rust_helper void rust_helper_kunmap_local(const void *addr) {kunmap_local (addr); }#ifndef NODE_NOT_IN_PAGE_FLAGS -int rust_helper_page_to_nid (const struct page *page) +__rust_helper int rust_helper_page_to_nid(const struct page *page) {return page_to_nid (page); }rust/helpers/vmalloc.c +1
-2@@ -2,7 +2,7 @@#include <linux/vmalloc.h> -void * __must_check __realloc_size(2) +__rust_helper void *__must_check __realloc_size(2) rust_helper_vrealloc_node_align(const void *p, size_t size, unsigned long align, gfp_t flags, int node) { --2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 12/27 rust: of: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Rob Herring <[email protected]>
Cc: [email protected]
--- rust/helpers/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/of.c +1 -1
@@ -2,7 +2,7 @@#include <linux/of.h> -bool rust_helper_is_of_node (const struct fwnode_handle *fwnode) +__rust_helper bool rust_helper_is_of_node(const struct fwnode_handle *fwnode) {return is_of_node (fwnode); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 12/27] rust: of: add __rust_helper to helpers
Quoted 11 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>---
Cc: Rob Herring <[email protected]>
Cc: [email protected]--- rust/helpers/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Alice Ryhl
maintainerPATCH v2 13/27 rust: processor: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: FUJITA Tomonori <[email protected]>
Cc: Andreas Hindborg <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Cc: Daniel Almeida <[email protected]>
--- rust/helpers/processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/processor.c +1 -1
@@ -2,7 +2,7 @@#include <linux/processor.h> -void rust_helper_cpu_relax (void ) +__rust_helper void rust_helper_cpu_relax(void) {cpu_relax (); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: processor: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: a87e6fe8738fabf9881758b79b0db592c057acbd Gitweb: https://git.kernel.org/tip/a87e6fe8738fabf9881758b79b0db592c057acbd Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:26 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:41 +08:00
rust: processor: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/processor.c +1 -1
@@ -2,7 +2,7 @@#include <linux/processor.h> -void rust_helper_cpu_relax (void ) +__rust_helper void rust_helper_cpu_relax(void) {cpu_relax (); }
Alice Ryhl
maintainerPATCH v2 14/27 rust: pwm: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Michal Wilczynski <[email protected]>
Cc: [email protected]
--- rust/helpers/pwm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
rust/helpers/pwm.c +3 -3
@@ -4,17 +4,17 @@#include <linux/pwm.h> -struct device *rust_helper_pwmchip_parent (const struct pwm_chip *chip) +__rust_helper struct device *rust_helper_pwmchip_parent(const struct pwm_chip *chip) {return pwmchip_parent (chip); } -void *rust_helper_pwmchip_get_drvdata (struct pwm_chip *chip) +__rust_helper void *rust_helper_pwmchip_get_drvdata(struct pwm_chip *chip) {return pwmchip_get_drvdata (chip); } -void rust_helper_pwmchip_set_drvdata (struct pwm_chip *chip,void *data) +__rust_helper void rust_helper_pwmchip_set_drvdata(struct pwm_chip *chip, void *data) {pwmchip_set_drvdata (chip, data); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
Quoted 26 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Signed-off-by Alice Ryhl <[email protected]>---
Cc: Michal Wilczynski <[email protected]>
Cc: [email protected]--- rust/helpers/pwm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)rust/helpers/pwm.c +1
-2@@ -4,17 +4,17 @@#include <linux/pwm.h> -struct device *rust_helper_pwmchip_parent (const struct pwm_chip *chip) +__rust_helper struct device *rust_helper_pwmchip_parent(const struct pwm_chip *chip) {return pwmchip_parent (chip); } -void *rust_helper_pwmchip_get_drvdata (struct pwm_chip *chip)
rust/helpers/pwm.c line 20
Quoted 10 lines
rust/helpers/pwm.c +2
-1+__rust_helper void *rust_helper_pwmchip_get_drvdata(struct pwm_chip *chip) {return pwmchip_get_drvdata (chip); } -void rust_helper_pwmchip_set_drvdata (struct pwm_chip *chip,void *data) +__rust_helper void rust_helper_pwmchip_set_drvdata(struct pwm_chip *chip, void *data) {pwmchip_set_drvdata (chip, data); }
Re: [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
In reply to Alice RyhlHello,
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Signed-off-by Alice Ryhl <[email protected]>---
Cc: Michal Wilczynski <[email protected]>
Cc: [email protected]
Applied this patch to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next
as merge window material.
Best regards
Uwe
Alice Ryhl
maintainerPATCH v2 15/27 rust: rbtree: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
--- rust/helpers/rbtree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
rust/helpers/rbtree.c +5 -4
@@ -2,18 +2,19 @@#include <linux/rbtree.h> -void rust_helper_rb_link_node (struct rb_node *node,struct rb_node *parent, -struct rb_node **rb_link) +__rust_helper void rust_helper_rb_link_node(struct rb_node *node, +struct rb_node *parent, +struct rb_node **rb_link) {rb_link_node (node, parent, rb_link); } -struct rb_node *rust_helper_rb_first (const struct rb_root *root) +__rust_helper struct rb_node *rust_helper_rb_first(const struct rb_root *root) {return rb_first (root); } -struct rb_node *rust_helper_rb_last (const struct rb_root *root) +__rust_helper struct rb_node *rust_helper_rb_last(const struct rb_root *root) {return rb_last (root); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 16/27 rust: rcu: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: "Paul E. McKenney" <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: [email protected]
--- rust/helpers/rcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/rcu.c +2 -2
@@ -2,12 +2,12 @@#include <linux/rcupdate.h> -void rust_helper_rcu_read_lock (void ) +__rust_helper void rust_helper_rcu_read_lock(void) {rcu_read_lock (); } -void rust_helper_rcu_read_unlock (void ) +__rust_helper void rust_helper_rcu_read_unlock(void) {rcu_read_unlock (); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 16/27] rust: rcu: add __rust_helper to helpers
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Thanks.
Quoted 28 lines
---
Cc: "Paul E. McKenney" <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: [email protected]--- rust/helpers/rcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)rust/helpers/rcu.c +2
-2@@ -2,12 +2,12 @@#include <linux/rcupdate.h> -void rust_helper_rcu_read_lock (void ) +__rust_helper void rust_helper_rcu_read_lock(void) {rcu_read_lock (); } -void rust_helper_rcu_read_unlock (void ) +__rust_helper void rust_helper_rcu_read_unlock(void) {rcu_read_unlock (); }
[tip: locking/core] rust: rcu: Add __rust_helper to helpers
In reply to Alice RyhlThe following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 5e03edaed373f41e7a3c8617e01891eb680d62aa Gitweb: https://git.kernel.org/tip/5e03edaed373f41e7a3c8617e01891eb680d62aa Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:29 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:42 +08:00
rust: rcu: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/rcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/rcu.c +2 -2
@@ -2,12 +2,12 @@#include <linux/rcupdate.h> -void rust_helper_rcu_read_lock (void ) +__rust_helper void rust_helper_rcu_read_lock(void) {rcu_read_lock (); } -void rust_helper_rcu_read_unlock (void ) +__rust_helper void rust_helper_rcu_read_unlock(void) {rcu_read_unlock (); }
Alice Ryhl
maintainerPATCH v2 17/27 rust: refcount: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Boqun Feng <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Fiona Behrens <[email protected]>
Cc: Benno Lossin <[email protected]>
Cc: Gary Guo <[email protected]>
--- rust/helpers/refcount.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
rust/helpers/refcount.c +5 -5
@@ -2,27 +2,27 @@#include <linux/refcount.h> -refcount_t rust_helper_REFCOUNT_INIT (int n) +__rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n) {return (refcount_t )REFCOUNT_INIT (n); } -void rust_helper_refcount_set (refcount_t *r,int n) +__rust_helper void rust_helper_refcount_set(refcount_t *r, int n) {refcount_set (r, n); } -void rust_helper_refcount_inc (refcount_t *r) +__rust_helper void rust_helper_refcount_inc(refcount_t *r) {refcount_inc (r); } -void rust_helper_refcount_dec (refcount_t *r) +__rust_helper void rust_helper_refcount_dec(refcount_t *r) {refcount_dec (r); } -bool rust_helper_refcount_dec_and_test (refcount_t *r) +__rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r) {return refcount_dec_and_test (r); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: refcount: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 9ba1aaf25ab7dadb910348b6857865e87b4c5689 Gitweb: https://git.kernel.org/tip/9ba1aaf25ab7dadb910348b6857865e87b4c5689 Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:30 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:42 +08:00
rust: refcount: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/refcount.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
rust/helpers/refcount.c +5 -5
@@ -2,27 +2,27 @@#include <linux/refcount.h> -refcount_t rust_helper_REFCOUNT_INIT (int n) +__rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n) {return (refcount_t )REFCOUNT_INIT (n); } -void rust_helper_refcount_set (refcount_t *r,int n) +__rust_helper void rust_helper_refcount_set(refcount_t *r, int n) {refcount_set (r, n); } -void rust_helper_refcount_inc (refcount_t *r) +__rust_helper void rust_helper_refcount_inc(refcount_t *r) {refcount_inc (r); } -void rust_helper_refcount_dec (refcount_t *r) +__rust_helper void rust_helper_refcount_dec(refcount_t *r) {refcount_dec (r); } -bool rust_helper_refcount_dec_and_test (refcount_t *r) +__rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r) {return refcount_dec_and_test (r); }
Alice Ryhl
maintainerPATCH v2 18/27 rust: security: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Paul Moore <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
--- rust/helpers/security.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
rust/helpers/security.c +15 -11
@@ -3,41 +3,45 @@#include <linux/security.h> #ifndef CONFIG_SECURITY -void rust_helper_security_cred_getsecid (const struct cred *c,u32 *secid) +__rust_helper void rust_helper_security_cred_getsecid(const struct cred *c, +u32 *secid) {security_cred_getsecid (c, secid); } -int rust_helper_security_secid_to_secctx (u32 secid,struct lsm_context *cp) +__rust_helper int rust_helper_security_secid_to_secctx(u32 secid, +struct lsm_context *cp) {return security_secid_to_secctx (secid, cp); } -void rust_helper_security_release_secctx (struct lsm_context *cp) +__rust_helper void rust_helper_security_release_secctx(struct lsm_context *cp) {security_release_secctx (cp); } -int rust_helper_security_binder_set_context_mgr (const struct cred *mgr) +__rust_helper int +rust_helper_security_binder_set_context_mgr (const struct cred *mgr) {return security_binder_set_context_mgr (mgr); } -int rust_helper_security_binder_transaction (const struct cred *from, -const struct cred *to) +__rust_helper int +rust_helper_security_binder_transaction (const struct cred *from, +const struct cred *to) {return security_binder_transaction (from, to); } -int rust_helper_security_binder_transfer_binder (const struct cred *from, -const struct cred *to) +__rust_helper int +rust_helper_security_binder_transfer_binder (const struct cred *from, +const struct cred *to) {return security_binder_transfer_binder (from, to); } -int rust_helper_security_binder_transfer_file (const struct cred *from, -const struct cred *to, -const struct file *file) +__rust_helper int rust_helper_security_binder_transfer_file( +const struct cred *from,const struct cred *to,const struct file *file) {return security_binder_transfer_file (from, to, file); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 18/27] rust: security: add __rust_helper to helpers
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 7 lines
---
Cc: Paul Moore <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]--- rust/helpers/security.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
Merged into lsm/dev, thanks.
Signature · 1 line
paul-moore.com
Alice Ryhl
maintainerPATCH v2 19/27 rust: slab: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Vlastimil Babka <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Vitaly Wool <[email protected]>
Cc: Danilo Krummrich <[email protected]>
--- rust/helpers/slab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/helpers/slab.c +2 -2
@@ -2,14 +2,14 @@#include <linux/slab.h> -void * __must_check __realloc_size(2) +__rust_helper void *__must_check __realloc_size(2) rust_helper_krealloc_node_align(const void *objp, size_t new_size, unsigned long align, gfp_t flags, int node) { return krealloc_node_align(objp, new_size, align, flags, node); } -void * __must_check __realloc_size(2) +__rust_helper void *__must_check __realloc_size(2) rust_helper_kvrealloc_node_align(const void *p, size_t size, unsigned long align, gfp_t flags, int node) {
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Since this file contains the helpers for the alloc module, I assume I should take it through the alloc tree? Maybe we should also add it to the alloc entry in maintainers.
Anyways, so far I do not have anything staged in the alloc tree for this cycle, so it would probably be easier if either Andrew or Miguel picks it up directly.
Alice Ryhl
maintainerRe: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Quoted 7 lines · Danilo Krummrich
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 8 lines
Since this file contains the helpers for the alloc module, I assume I should take it through the alloc tree? Maybe we should also add it to the alloc entry in maintainers.
Anyways, so far I do not have anything staged in the alloc tree for this cycle, so it would probably be easier if either Andrew or Miguel picks it up directly.
Acked-by Danilo Krummrich <[email protected]>
Sounds good to me. There is also mm and maple_tree for Andrew Morton.
Alice
Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Quoted 2 lines · Alice Ryhl
Sounds good to me. There is also mm and
maple_treefor Andrew Morton.
Either way sounds good for me -- anyway I will have to pick the bug and err at least.
Cheers,
Miguel
Alice Ryhl
maintainerPATCH v2 20/27 rust: sync: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Mitchell Levy <[email protected]>
Cc: Benno Lossin <[email protected]>
--- rust/helpers/mutex.c | 13 +++++++------ rust/helpers/spinlock.c | 13 +++++++------ rust/helpers/sync.c | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-)
rust/helpers/mutex.c +7 -6
@@ -2,28 +2,29 @@#include <linux/mutex.h> -void rust_helper_mutex_lock (struct mutex *lock) +__rust_helper void rust_helper_mutex_lock(struct mutex *lock) {mutex_lock (lock); } -int rust_helper_mutex_trylock (struct mutex *lock) +__rust_helper int rust_helper_mutex_trylock(struct mutex *lock) {return mutex_trylock (lock); } -void rust_helper___mutex_init (struct mutex *mutex,const char *name, -struct lock_class_key *key) +__rust_helper void rust_helper___mutex_init(struct mutex *mutex, +const char *name, +struct lock_class_key *key) {__mutex_init (mutex, name, key); } -void rust_helper_mutex_assert_is_held (struct mutex *mutex) +__rust_helper void rust_helper_mutex_assert_is_held(struct mutex *mutex) {lockdep_assert_held (mutex); } -void rust_helper_mutex_destroy (struct mutex *lock) +__rust_helper void rust_helper_mutex_destroy(struct mutex *lock) {mutex_destroy (lock); }
rust/helpers/spinlock.c +7 -6
@@ -2,8 +2,9 @@#include <linux/spinlock.h> -void rust_helper___spin_lock_init (spinlock_t *lock,const char *name, -struct lock_class_key *key) +__rust_helper void rust_helper___spin_lock_init(spinlock_t *lock, +const char *name, +struct lock_class_key *key) {#ifdef CONFIG_DEBUG_SPINLOCK # if defined(CONFIG_PREEMPT_RT )
@@ -16,22 +17,22 @@ void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,#endif /* CONFIG_DEBUG_SPINLOCK */ } -void rust_helper_spin_lock (spinlock_t *lock) +__rust_helper void rust_helper_spin_lock(spinlock_t *lock) {spin_lock (lock); } -void rust_helper_spin_unlock (spinlock_t *lock) +__rust_helper void rust_helper_spin_unlock(spinlock_t *lock) {spin_unlock (lock); } -int rust_helper_spin_trylock (spinlock_t *lock) +__rust_helper int rust_helper_spin_trylock(spinlock_t *lock) {return spin_trylock (lock); } -void rust_helper_spin_assert_is_held (spinlock_t *lock) +__rust_helper void rust_helper_spin_assert_is_held(spinlock_t *lock) {lockdep_assert_held (lock); }
rust/helpers/sync.c +2 -2
@@ -2,12 +2,12 @@#include <linux/lockdep.h> -void rust_helper_lockdep_register_key (struct lock_class_key *k) +__rust_helper void rust_helper_lockdep_register_key(struct lock_class_key *k) {lockdep_register_key (k); } -void rust_helper_lockdep_unregister_key (struct lock_class_key *k) +__rust_helper void rust_helper_lockdep_unregister_key(struct lock_class_key *k) {lockdep_unregister_key (k); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: sync: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: d4ad4de929ba27ed241c6ef1098b1687001ced1f Gitweb: https://git.kernel.org/tip/d4ad4de929ba27ed241c6ef1098b1687001ced1f Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:33 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:42 +08:00
rust: sync: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/mutex.c | 13 +++++++------ rust/helpers/spinlock.c | 13 +++++++------ rust/helpers/sync.c | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-)
rust/helpers/mutex.c +7 -6
@@ -2,28 +2,29 @@#include <linux/mutex.h> -void rust_helper_mutex_lock (struct mutex *lock) +__rust_helper void rust_helper_mutex_lock(struct mutex *lock) {mutex_lock (lock); } -int rust_helper_mutex_trylock (struct mutex *lock) +__rust_helper int rust_helper_mutex_trylock(struct mutex *lock) {return mutex_trylock (lock); } -void rust_helper___mutex_init (struct mutex *mutex,const char *name, -struct lock_class_key *key) +__rust_helper void rust_helper___mutex_init(struct mutex *mutex, +const char *name, +struct lock_class_key *key) {__mutex_init (mutex, name, key); } -void rust_helper_mutex_assert_is_held (struct mutex *mutex) +__rust_helper void rust_helper_mutex_assert_is_held(struct mutex *mutex) {lockdep_assert_held (mutex); } -void rust_helper_mutex_destroy (struct mutex *lock) +__rust_helper void rust_helper_mutex_destroy(struct mutex *lock) {mutex_destroy (lock); }
rust/helpers/spinlock.c +7 -6
@@ -2,8 +2,9 @@#include <linux/spinlock.h> -void rust_helper___spin_lock_init (spinlock_t *lock,const char *name, -struct lock_class_key *key) +__rust_helper void rust_helper___spin_lock_init(spinlock_t *lock, +const char *name, +struct lock_class_key *key) {#ifdef CONFIG_DEBUG_SPINLOCK # if defined(CONFIG_PREEMPT_RT )
@@ -16,22 +17,22 @@ void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,#endif /* CONFIG_DEBUG_SPINLOCK */ } -void rust_helper_spin_lock (spinlock_t *lock) +__rust_helper void rust_helper_spin_lock(spinlock_t *lock) {spin_lock (lock); } -void rust_helper_spin_unlock (spinlock_t *lock) +__rust_helper void rust_helper_spin_unlock(spinlock_t *lock) {spin_unlock (lock); } -int rust_helper_spin_trylock (spinlock_t *lock) +__rust_helper int rust_helper_spin_trylock(spinlock_t *lock) {return spin_trylock (lock); } -void rust_helper_spin_assert_is_held (spinlock_t *lock) +__rust_helper void rust_helper_spin_assert_is_held(spinlock_t *lock) {lockdep_assert_held (lock); }
rust/helpers/sync.c +2 -2
@@ -2,12 +2,12 @@#include <linux/lockdep.h> -void rust_helper_lockdep_register_key (struct lock_class_key *k) +__rust_helper void rust_helper_lockdep_register_key(struct lock_class_key *k) {lockdep_register_key (k); } -void rust_helper_lockdep_unregister_key (struct lock_class_key *k) +__rust_helper void rust_helper_lockdep_unregister_key(struct lock_class_key *k) {lockdep_unregister_key (k); }
Alice Ryhl
maintainerPATCH v2 21/27 rust: task: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Boqun Feng <[email protected]>
Cc: FUJITA Tomonori <[email protected]>
--- rust/helpers/signal.c | 2 +- rust/helpers/task.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-)
rust/helpers/signal.c +1 -1
@@ -2,7 +2,7 @@#include <linux/sched/signal.h> -int rust_helper_signal_pending (struct task_struct *t) +__rust_helper int rust_helper_signal_pending(struct task_struct *t) {return signal_pending (t); }
rust/helpers/task.c +12 -12
@@ -3,60 +3,60 @@#include <linux/kernel.h> #include <linux/sched/task.h> -void rust_helper_might_resched (void ) +__rust_helper void rust_helper_might_resched(void) {might_resched (); } -struct task_struct *rust_helper_get_current (void ) +__rust_helper struct task_struct *rust_helper_get_current(void) {return current; } -void rust_helper_get_task_struct (struct task_struct *t) +__rust_helper void rust_helper_get_task_struct(struct task_struct *t) {get_task_struct (t); } -void rust_helper_put_task_struct (struct task_struct *t) +__rust_helper void rust_helper_put_task_struct(struct task_struct *t) {put_task_struct (t); } -kuid_t rust_helper_task_uid (struct task_struct *task) +__rust_helper kuid_t rust_helper_task_uid(struct task_struct *task) {return task_uid (task); } -kuid_t rust_helper_task_euid (struct task_struct *task) +__rust_helper kuid_t rust_helper_task_euid(struct task_struct *task) {return task_euid (task); }#ifndef CONFIG_USER_NS -uid_t rust_helper_from_kuid (struct user_namespace *to,kuid_t uid) +__rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) {return from_kuid (to, uid); }#endif /* CONFIG_USER_NS */ -bool rust_helper_uid_eq (kuid_t left,kuid_t right) +__rust_helper bool rust_helper_uid_eq(kuid_t left, kuid_t right) {return uid_eq (left, right); } -kuid_t rust_helper_current_euid (void ) +__rust_helper kuid_t rust_helper_current_euid(void) {return current_euid (); } -struct user_namespace *rust_helper_current_user_ns (void ) +__rust_helper struct user_namespace *rust_helper_current_user_ns(void) {return current_user_ns (); } -pid_t rust_helper_task_tgid_nr_ns (struct task_struct *tsk, -struct pid_namespace *ns) +__rust_helper pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, +struct pid_namespace *ns) {return task_tgid_nr_ns (tsk, ns); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: task: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 5f1193d55a4311780136044355b1f09e7b5abac7 Gitweb: https://git.kernel.org/tip/5f1193d55a4311780136044355b1f09e7b5abac7 Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:34 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:42 +08:00
rust: task: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/signal.c | 2 +- rust/helpers/task.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-)
rust/helpers/signal.c +1 -1
@@ -2,7 +2,7 @@#include <linux/sched/signal.h> -int rust_helper_signal_pending (struct task_struct *t) +__rust_helper int rust_helper_signal_pending(struct task_struct *t) {return signal_pending (t); }
rust/helpers/task.c +12 -12
@@ -3,60 +3,60 @@#include <linux/kernel.h> #include <linux/sched/task.h> -void rust_helper_might_resched (void ) +__rust_helper void rust_helper_might_resched(void) {might_resched (); } -struct task_struct *rust_helper_get_current (void ) +__rust_helper struct task_struct *rust_helper_get_current(void) {return current; } -void rust_helper_get_task_struct (struct task_struct *t) +__rust_helper void rust_helper_get_task_struct(struct task_struct *t) {get_task_struct (t); } -void rust_helper_put_task_struct (struct task_struct *t) +__rust_helper void rust_helper_put_task_struct(struct task_struct *t) {put_task_struct (t); } -kuid_t rust_helper_task_uid (struct task_struct *task) +__rust_helper kuid_t rust_helper_task_uid(struct task_struct *task) {return task_uid (task); } -kuid_t rust_helper_task_euid (struct task_struct *task) +__rust_helper kuid_t rust_helper_task_euid(struct task_struct *task) {return task_euid (task); }#ifndef CONFIG_USER_NS -uid_t rust_helper_from_kuid (struct user_namespace *to,kuid_t uid) +__rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) {return from_kuid (to, uid); }#endif /* CONFIG_USER_NS */ -bool rust_helper_uid_eq (kuid_t left,kuid_t right) +__rust_helper bool rust_helper_uid_eq(kuid_t left, kuid_t right) {return uid_eq (left, right); } -kuid_t rust_helper_current_euid (void ) +__rust_helper kuid_t rust_helper_current_euid(void) {return current_euid (); } -struct user_namespace *rust_helper_current_user_ns (void ) +__rust_helper struct user_namespace *rust_helper_current_user_ns(void) {return current_user_ns (); } -pid_t rust_helper_task_tgid_nr_ns (struct task_struct *tsk, -struct pid_namespace *ns) +__rust_helper pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, +struct pid_namespace *ns) {return task_tgid_nr_ns (tsk, ns); }
Alice Ryhl
maintainerPATCH v2 22/27 rust: time: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Andreas Hindborg <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: FUJITA Tomonori <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Anna-Maria Behnsen <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Fiona Behrens <[email protected]>
Cc: Gary Guo <[email protected]>
--- rust/helpers/time.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
rust/helpers/time.c +7 -7
@@ -4,37 +4,37 @@#include <linux/ktime.h> #include <linux/timekeeping.h> -void rust_helper_fsleep (unsigned long usecs) +__rust_helper void rust_helper_fsleep(unsigned long usecs) {fsleep (usecs); } -ktime_t rust_helper_ktime_get_real (void ) +__rust_helper ktime_t rust_helper_ktime_get_real(void) {return ktime_get_real (); } -ktime_t rust_helper_ktime_get_boottime (void ) +__rust_helper ktime_t rust_helper_ktime_get_boottime(void) {return ktime_get_boottime (); } -ktime_t rust_helper_ktime_get_clocktai (void ) +__rust_helper ktime_t rust_helper_ktime_get_clocktai(void) {return ktime_get_clocktai (); } -s64 rust_helper_ktime_to_us (const ktime_t kt) +__rust_helper s64 rust_helper_ktime_to_us(const ktime_t kt) {return ktime_to_us (kt); } -s64 rust_helper_ktime_to_ms (const ktime_t kt) +__rust_helper s64 rust_helper_ktime_to_ms(const ktime_t kt) {return ktime_to_ms (kt); } -void rust_helper_udelay (unsigned long usec) +__rust_helper void rust_helper_udelay(unsigned long usec) {udelay (usec); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: time: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 75b6034780e8dc8c71096313534ccb720fa633f9 Gitweb: https://git.kernel.org/tip/75b6034780e8dc8c71096313534ccb720fa633f9 Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:35 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:42 +08:00
rust: time: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/time.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
rust/helpers/time.c +7 -7
@@ -4,37 +4,37 @@#include <linux/ktime.h> #include <linux/timekeeping.h> -void rust_helper_fsleep (unsigned long usecs) +__rust_helper void rust_helper_fsleep(unsigned long usecs) {fsleep (usecs); } -ktime_t rust_helper_ktime_get_real (void ) +__rust_helper ktime_t rust_helper_ktime_get_real(void) {return ktime_get_real (); } -ktime_t rust_helper_ktime_get_boottime (void ) +__rust_helper ktime_t rust_helper_ktime_get_boottime(void) {return ktime_get_boottime (); } -ktime_t rust_helper_ktime_get_clocktai (void ) +__rust_helper ktime_t rust_helper_ktime_get_clocktai(void) {return ktime_get_clocktai (); } -s64 rust_helper_ktime_to_us (const ktime_t kt) +__rust_helper s64 rust_helper_ktime_to_us(const ktime_t kt) {return ktime_to_us (kt); } -s64 rust_helper_ktime_to_ms (const ktime_t kt) +__rust_helper s64 rust_helper_ktime_to_ms(const ktime_t kt) {return ktime_to_ms (kt); } -void rust_helper_udelay (unsigned long usec) +__rust_helper void rust_helper_udelay(unsigned long usec) {udelay (usec); }
Alice Ryhl
maintainerPATCH v2 23/27 rust: uaccess: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Greg Kroah-Hartman <[email protected]>
--- rust/helpers/uaccess.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
rust/helpers/uaccess.c +6 -4
@@ -2,24 +2,26 @@#include <linux/uaccess.h> -unsigned long rust_helper_copy_from_user (void *to,const void __user *from, -unsigned long n) +__rust_helper unsigned long +rust_helper_copy_from_user (void *to,const void __user *from,unsigned long n) {return copy_from_user (to, from, n); } -unsigned long rust_helper_copy_to_user (void __user *to,const void *from, -unsigned long n) +__rust_helper unsigned long +rust_helper_copy_to_user (void __user *to,const void *from,unsigned long n) {return copy_to_user (to, from, n); }#ifdef INLINE_COPY_FROM_USER +__rust_helper unsigned long rust_helper__copy_from_user (void *to,const void __user *from,unsigned long n) {return _inline_copy_from_user (to, from, n); } +__rust_helper unsigned long rust_helper__copy_to_user (void __user *to,const void *from,unsigned long n) {return _inline_copy_to_user (to, from, n);
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 24/27 rust: usb: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: Daniel Almeida <[email protected]>
--- rust/helpers/usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
rust/helpers/usb.c +2 -1
@@ -2,7 +2,8 @@#include <linux/usb.h> -struct usb_device *rust_helper_interface_to_usbdev (struct usb_interface *intf) +__rust_helper struct usb_device * +rust_helper_interface_to_usbdev (struct usb_interface *intf) {return interface_to_usbdev (intf); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 24/27] rust: usb: add __rust_helper to helpers
Quoted 36 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: Daniel Almeida <[email protected]>
---rust/helpers/usb.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)rust/helpers/usb.c +2
-1@@ -2,7 +2,8 @@#include <linux/usb.h> -struct usb_device *rust_helper_interface_to_usbdev (struct usb_interface *intf) +__rust_helper struct usb_device * +rust_helper_interface_to_usbdev (struct usb_interface *intf) {return interface_to_usbdev (intf); }Signature · 2 lines
-- 2.52.0.351.gbe84eed79e-goog
Alice Ryhl
maintainerPATCH v2 25/27 rust: wait: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Anna-Maria Behnsen <[email protected]>
--- rust/helpers/wait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/wait.c +1 -1
@@ -2,7 +2,7 @@#include <linux/wait.h> -void rust_helper_init_wait (struct wait_queue_entry *wq_entry) +__rust_helper void rust_helper_init_wait(struct wait_queue_entry *wq_entry) {init_wait (wq_entry); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
[tip: locking/core] rust: wait: Add __rust_helper to helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 5628f0510a4c64908c5d2f36a676b092e1e5d174 Gitweb: https://git.kernel.org/tip/5628f0510a4c64908c5d2f36a676b092e1e5d174 Author: Alice Ryhl <[email protected]> AuthorDate: Mon, 05 Jan 2026 12:42:38 Committer: Boqun Feng <[email protected]> CommitterDate: Fri, 09 Jan 2026 19:01:42 +08:00
rust: wait: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code.
--- rust/helpers/wait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/helpers/wait.c +1 -1
@@ -2,7 +2,7 @@#include <linux/wait.h> -void rust_helper_init_wait (struct wait_queue_entry *wq_entry) +__rust_helper void rust_helper_init_wait(struct wait_queue_entry *wq_entry) {init_wait (wq_entry); }
Alice Ryhl
maintainerPATCH v2 26/27 rust: workqueue: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Tejun Heo <[email protected]>
Cc: Lai Jiangshan <[email protected]>
--- rust/helpers/workqueue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
rust/helpers/workqueue.c +5 -3
@@ -2,9 +2,11 @@#include <linux/workqueue.h> -void rust_helper_init_work_with_key (struct work_struct *work,work_func_t func, -bool onstack,const char *name, -struct lock_class_key *key) +__rust_helper void rust_helper_init_work_with_key(struct work_struct *work, +work_func_t func, +bool onstack, +const char *name, +struct lock_class_key *key) {__init_work (work, onstack); work->data = (atomic_long_t )WORK_DATA_INIT ();
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 26/27] rust: workqueue: add __rust_helper to helpers
Quoted 5 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Please route through the rust tree.
Thanks.
Signature · 1 line
tejun
Alice Ryhl
maintainerPATCH v2 27/27 rust: xarray: add __rust_helper to helpers
In reply to Alice RyhlThis is needed to inline these helpers into Rust code.
---
Cc: Andrew Morton <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Tamir Duberstein <[email protected]>
Cc: Andreas Hindborg <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- rust/helpers/xarray.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
rust/helpers/xarray.c +5 -5
@@ -2,27 +2,27 @@#include <linux/xarray.h> -int rust_helper_xa_err (void *entry) +__rust_helper int rust_helper_xa_err(void *entry) {return xa_err (entry); } -void rust_helper_xa_init_flags (struct xarray *xa,gfp_t flags) +__rust_helper void rust_helper_xa_init_flags(struct xarray *xa, gfp_t flags) {return xa_init_flags (xa, flags); } -int rust_helper_xa_trylock (struct xarray *xa) +__rust_helper int rust_helper_xa_trylock(struct xarray *xa) {return xa_trylock (xa); } -void rust_helper_xa_lock (struct xarray *xa) +__rust_helper void rust_helper_xa_lock(struct xarray *xa) {return xa_lock (xa); } -void rust_helper_xa_unlock (struct xarray *xa) +__rust_helper void rust_helper_xa_unlock(struct xarray *xa) {return xa_unlock (xa); }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 27/27] rust: xarray: add __rust_helper to helpers
Quoted 6 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Reviewed-by Boqun Feng <[email protected]>Reviewed-by Gary Guo <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 52 lines
---
Cc: Andrew Morton <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Tamir Duberstein <[email protected]>
Cc: Andreas Hindborg <[email protected]>
Cc: [email protected]
Cc: [email protected]--- rust/helpers/xarray.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)rust/helpers/xarray.c +5
-6@@ -2,27 +2,27 @@#include <linux/xarray.h> -int rust_helper_xa_err (void *entry) +__rust_helper int rust_helper_xa_err(void *entry) {return xa_err (entry); } -void rust_helper_xa_init_flags (struct xarray *xa,gfp_t flags) +__rust_helper void rust_helper_xa_init_flags(struct xarray *xa, gfp_t flags) {return xa_init_flags (xa, flags); } -int rust_helper_xa_trylock (struct xarray *xa) +__rust_helper int rust_helper_xa_trylock(struct xarray *xa) {return xa_trylock (xa); } -void rust_helper_xa_lock (struct xarray *xa) +__rust_helper void rust_helper_xa_lock(struct xarray *xa) {return xa_lock (xa); } -void rust_helper_xa_unlock (struct xarray *xa) +__rust_helper void rust_helper_xa_unlock(struct xarray *xa) {return xa_unlock (xa); } --2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 27/27] rust: xarray: add __rust_helper to helpers
In reply to Alice RyhlQuoted 3 lines · Alice Ryhl
This is needed to inline these helpers into Rust code.
Applied, thanks!
[27/27] rust: xarray: add __rust_helper to helpers
commit: c455f19bbe6104debd980bb15515faf716bd81b8
Best regards,
Signature · 1 line
Andreas Hindborg <[email protected]>
Boqun Feng
AppliedQuoted 5 lines · Alice Ryhl
This patch series adds
__rust_helperto every single rust helper. The patches do not depend on each other, so maintainers please go ahead and pick up any patches relevant to your subsystem! Or provide your Acked-by so that Miguel can pick them up.
I queued the following into rust-sync:
rust: barrier: add __rust_helper to helpers
rust: blk: add __rust_helper to helpers
rust: completion: add __rust_helper to helpers
rust: cpu: add __rust_helper to helpers
rust: processor: add __rust_helper to helpers
rust: rcu: add __rust_helper to helpers
rust: refcount: add __rust_helper to helpers
rust: sync: add __rust_helper to helpers
rust: task: add __rust_helper to helpers
rust: time: add __rust_helper to helpers
rust: wait: add __rust_helper to helpers
Thanks!
Regards,
Boqun
Quoted 3 lines
These changes were generated by adding
__rust_helperand running ClangFormat. Unrelated formatting changes were removed manually.
[...]
Miguel Ojeda
AppliedQuoted 10 lines · Alice Ryhl
rust: bug: add
__rust_helperto helpers
rust: err: add__rust_helperto helpers
rust:maple_tree: add__rust_helperto helpers
rust: mm: add__rust_helperto helpers
rust: of: add__rust_helperto helpers
rust: rbtree: add__rust_helperto helpers
rust: slab: add__rust_helperto helpers
rust: uaccess: add__rust_helperto helpers
rust: workqueue: add__rust_helperto helpers
Applied these to rust-next -- thanks everyone!
If someone did not intend for me to take it even if the Acked-by is there (e.g. perhaps Andrew wanted to pick those nevertheless?), then please shout.
With this, and if I didn't miss any message (plus looking at linux-next where I see Greg picked usb), then only clk and jump_label remain (plus any new incoming one).
Let's see if we can get them done next cycle then.
Cheers,
Miguel
Miguel Ojeda
AppliedQuoted 3 lines · Alice Ryhl
rust: clk: add
__rust_helperto helpers
rust:jump_label: add__rust_helperto helpers
Applied these to rust-next -- thanks everyone!
With these, the series is complete.
Cheers,
Miguel