* [PATCH v2 01/27] rust: barrier: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: barrier: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 02/27] rust: blk: add " Alice Ryhl
` (28 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Peter Zijlstra,
Elle Rhumsaa
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Elle Rhumsaa <elle@weathered-steel.dev>
---
rust/helpers/barrier.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/helpers/barrier.c b/rust/helpers/barrier.c
index cdf28ce8e5116728c97e24893cf12ef41578d3ac..fed8853745c83639c32f79335e40b9494db11e98 100644
--- a/rust/helpers/barrier.c
+++ b/rust/helpers/barrier.c
@@ -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();
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: barrier: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 01/27] rust: barrier: add __rust_helper to helpers Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:14
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-1-51da5f454a67@google.com
---
rust/helpers/barrier.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/helpers/barrier.c b/rust/helpers/barrier.c
index cdf28ce..fed8853 100644
--- a/rust/helpers/barrier.c
+++ b/rust/helpers/barrier.c
@@ -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();
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 02/27] rust: blk: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 01/27] rust: barrier: add __rust_helper to helpers Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-07 10:53 ` Andreas Hindborg
2026-01-13 10:49 ` [tip: locking/core] rust: blk: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 03/27] rust: bug: add " Alice Ryhl
` (27 subsequent siblings)
29 siblings, 2 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Andreas Hindborg,
linux-block
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: linux-block@vger.kernel.org
---
rust/helpers/blk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/blk.c b/rust/helpers/blk.c
index cc9f4e6a2d2346eb2814104cce706755ba135e06..20c512e46a7a5fd126d092a5b9f8742a1deac9ff 100644
--- a/rust/helpers/blk.c
+++ b/rust/helpers/blk.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 02/27] rust: blk: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 02/27] rust: blk: add " Alice Ryhl
@ 2026-01-07 10:53 ` Andreas Hindborg
2026-01-13 10:49 ` [tip: locking/core] rust: blk: Add " tip-bot2 for Alice Ryhl
1 sibling, 0 replies; 65+ messages in thread
From: Andreas Hindborg @ 2026-01-07 10:53 UTC (permalink / raw)
To: Alice Ryhl, rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, linux-block
Alice Ryhl <aliceryhl@google.com> writes:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Best regards,
Andreas Hindborg
^ permalink raw reply [flat|nested] 65+ messages in thread
* [tip: locking/core] rust: blk: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 02/27] rust: blk: add " Alice Ryhl
2026-01-07 10:53 ` Andreas Hindborg
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
1 sibling, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:15
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-2-51da5f454a67@google.com
---
rust/helpers/blk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/blk.c b/rust/helpers/blk.c
index cc9f4e6..20c512e 100644
--- a/rust/helpers/blk.c
+++ b/rust/helpers/blk.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 03/27] rust: bug: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 01/27] rust: barrier: add __rust_helper to helpers Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 02/27] rust: blk: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 04/27] rust: clk: " Alice Ryhl
` (26 subsequent siblings)
29 siblings, 0 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, FUJITA Tomonori,
Miguel Ojeda
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
---
rust/helpers/bug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/bug.c b/rust/helpers/bug.c
index a62c96f507d1c16cacc462199e390857b8afec28..b51e607725785f540dc46156630ca848dd0de491 100644
--- a/rust/helpers/bug.c
+++ b/rust/helpers/bug.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [PATCH v2 04/27] rust: clk: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (2 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 03/27] rust: bug: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-02-07 2:14 ` Stephen Boyd
2026-01-05 12:42 ` [PATCH v2 05/27] rust: completion: " Alice Ryhl
` (25 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Michael Turquette,
Stephen Boyd, linux-clk
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
---
rust/helpers/clk.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/rust/helpers/clk.c b/rust/helpers/clk.c
index 6d04372c9f3bbc4355c86eda5b1ebd7576d26442..15fd7e469cddf2e10d9e996c5055c7afb219e68c 100644
--- a/rust/helpers/clk.c
+++ b/rust/helpers/clk.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [PATCH v2 05/27] rust: completion: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (3 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 04/27] rust: clk: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: completion: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 06/27] rust: cpu: add " Alice Ryhl
` (24 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Benno Lossin,
Danilo Krummrich, Miguel Ojeda
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Benno Lossin <lossin@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
---
rust/helpers/completion.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/completion.c b/rust/helpers/completion.c
index b2443262a2aed30db0084efa00b140d4d5929bf0..0126767cc3bebd56db706048b8bc07c6788de5e2 100644
--- a/rust/helpers/completion.c
+++ b/rust/helpers/completion.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: completion: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 05/27] rust: completion: " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:18
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-5-51da5f454a67@google.com
---
rust/helpers/completion.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/completion.c b/rust/helpers/completion.c
index b244326..0126767 100644
--- a/rust/helpers/completion.c
+++ b/rust/helpers/completion.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 06/27] rust: cpu: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (4 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 05/27] rust: completion: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: cpu: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 07/27] rust: cred: add " Alice Ryhl
` (23 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Thomas Gleixner,
Peter Zijlstra
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
---
rust/helpers/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/cpu.c b/rust/helpers/cpu.c
index 824e0adb19d4c988a6d5974f3ed94e6708dd534f..5759349b2c88b483f445ea03ed92d174e16b5959 100644
--- a/rust/helpers/cpu.c
+++ b/rust/helpers/cpu.c
@@ -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();
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: cpu: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 06/27] rust: cpu: add " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:19
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-6-51da5f454a67@google.com
---
rust/helpers/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/cpu.c b/rust/helpers/cpu.c
index 824e0ad..5759349 100644
--- a/rust/helpers/cpu.c
+++ b/rust/helpers/cpu.c
@@ -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();
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (5 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 06/27] rust: cpu: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-07 1:25 ` Paul Moore
2026-01-05 12:42 ` [PATCH v2 08/27] rust: err: " Alice Ryhl
` (22 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Paul Moore,
Serge Hallyn, linux-security-module
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <sergeh@kernel.org>
Cc: linux-security-module@vger.kernel.org
---
rust/helpers/cred.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/cred.c b/rust/helpers/cred.c
index fde7ae20cdd19f04ac5f28808586c65de6b72f09..a56a7b7536232733dcdc640f09f8f2537e69d75e 100644
--- a/rust/helpers/cred.c
+++ b/rust/helpers/cred.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 07/27] rust: cred: add " Alice Ryhl
@ 2026-01-07 1:25 ` Paul Moore
2026-01-07 1:29 ` Paul Moore
0 siblings, 1 reply; 65+ messages in thread
From: Paul Moore @ 2026-01-07 1:25 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo, Serge Hallyn,
linux-security-module
On Mon, Jan 5, 2026 at 7:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: Serge Hallyn <sergeh@kernel.org>
> Cc: linux-security-module@vger.kernel.org
> ---
> rust/helpers/cred.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Paul Moore <paul@paul-moore.com>
--
paul-moore.com
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
2026-01-07 1:25 ` Paul Moore
@ 2026-01-07 1:29 ` Paul Moore
2026-01-07 6:53 ` Alice Ryhl
0 siblings, 1 reply; 65+ messages in thread
From: Paul Moore @ 2026-01-07 1:29 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo, Serge Hallyn,
linux-security-module
On Tue, Jan 6, 2026 at 8:25 PM Paul Moore <paul@paul-moore.com> wrote:
>
> On Mon, Jan 5, 2026 at 7:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > This is needed to inline these helpers into Rust code.
> >
> > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > Reviewed-by: Gary Guo <gary@garyguo.net>
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> > ---
> > Cc: Paul Moore <paul@paul-moore.com>
> > Cc: Serge Hallyn <sergeh@kernel.org>
> > Cc: linux-security-module@vger.kernel.org
> > ---
> > rust/helpers/cred.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Paul Moore <paul@paul-moore.com>
Ooops, sorry, I just saw that these were okay to merge into the
various subsystem trees. Merged into lsm/dev, thanks.
--
paul-moore.com
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
2026-01-07 1:29 ` Paul Moore
@ 2026-01-07 6:53 ` Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-07 6:53 UTC (permalink / raw)
To: Paul Moore
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo, Serge Hallyn,
linux-security-module
On Wed, Jan 7, 2026 at 2:29 AM Paul Moore <paul@paul-moore.com> wrote:
>
> On Tue, Jan 6, 2026 at 8:25 PM Paul Moore <paul@paul-moore.com> wrote:
> >
> > On Mon, Jan 5, 2026 at 7:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
> > >
> > > This is needed to inline these helpers into Rust code.
> > >
> > > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > > Reviewed-by: Gary Guo <gary@garyguo.net>
> > > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> > > ---
> > > Cc: Paul Moore <paul@paul-moore.com>
> > > Cc: Serge Hallyn <sergeh@kernel.org>
> > > Cc: linux-security-module@vger.kernel.org
> > > ---
> > > rust/helpers/cred.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Acked-by: Paul Moore <paul@paul-moore.com>
>
> Ooops, sorry, I just saw that these were okay to merge into the
> various subsystem trees. Merged into lsm/dev, thanks.
Thanks!
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 08/27] rust: err: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (6 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 07/27] rust: cred: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 09/27] rust: jump_label: " Alice Ryhl
` (21 subsequent siblings)
29 siblings, 0 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux; +Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
rust/helpers/build_bug.c | 2 +-
rust/helpers/err.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c
index 44e5794880373e5b4c3e9de5677d8e03ccd4a2be..14dbc55bb539589fd822ac8777b3fdaccfee7897 100644
--- a/rust/helpers/build_bug.c
+++ b/rust/helpers/build_bug.c
@@ -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);
}
diff --git a/rust/helpers/err.c b/rust/helpers/err.c
index 544c7cb8663283edbe202318e5bca870708546f3..2872158e379383d592af687991115a0d223c3898 100644
--- a/rust/helpers/err.c
+++ b/rust/helpers/err.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (7 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 08/27] rust: err: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-02-10 17:54 ` Miguel Ojeda
2026-01-05 12:42 ` [PATCH v2 10/27] rust: maple_tree: " Alice Ryhl
` (20 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Peter Zijlstra,
Josh Poimboeuf, Jason Baron, Steven Rostedt, Ard Biesheuvel
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
---
rust/helpers/jump_label.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/jump_label.c b/rust/helpers/jump_label.c
index fc1f1e0df08e79c0f06ac46cb6729a08deb7bd41..7ca384e73121820d882fde645a80cf718e6d9fbd 100644
--- a/rust/helpers/jump_label.c
+++ b/rust/helpers/jump_label.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 09/27] rust: jump_label: " Alice Ryhl
@ 2026-02-10 17:54 ` Miguel Ojeda
2026-02-10 20:26 ` Peter Zijlstra
0 siblings, 1 reply; 65+ messages in thread
From: Miguel Ojeda @ 2026-02-10 17:54 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Peter Zijlstra, Josh Poimboeuf, Jason Baron, Steven Rostedt,
Ard Biesheuvel
On Mon, Jan 5, 2026 at 2:08 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> Cc: Jason Baron <jbaron@akamai.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ard Biesheuvel <ardb@kernel.org>
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
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
2026-02-10 17:54 ` Miguel Ojeda
@ 2026-02-10 20:26 ` Peter Zijlstra
2026-02-10 23:11 ` Miguel Ojeda
0 siblings, 1 reply; 65+ messages in thread
From: Peter Zijlstra @ 2026-02-10 20:26 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Alice Ryhl, rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Josh Poimboeuf, Jason Baron, Steven Rostedt, Ard Biesheuvel
On Tue, Feb 10, 2026 at 06:54:59PM +0100, Miguel Ojeda wrote:
> On Mon, Jan 5, 2026 at 2:08 PM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > This is needed to inline these helpers into Rust code.
> >
> > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > Reviewed-by: Gary Guo <gary@garyguo.net>
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> > ---
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> > Cc: Jason Baron <jbaron@akamai.com>
> > Cc: Steven Rostedt <rostedt@goodmis.org>
> > Cc: Ard Biesheuvel <ardb@kernel.org>
>
> 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
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
I think Alison poked me on this, but cracks and all :/ Feel free to take
through rust tree.
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 09/27] rust: jump_label: add __rust_helper to helpers
2026-02-10 20:26 ` Peter Zijlstra
@ 2026-02-10 23:11 ` Miguel Ojeda
0 siblings, 0 replies; 65+ messages in thread
From: Miguel Ojeda @ 2026-02-10 23:11 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Alice Ryhl, rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Josh Poimboeuf, Jason Baron, Steven Rostedt, Ard Biesheuvel
On Tue, Feb 10, 2026 at 11:52 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> Sure
>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> I think Alison poked me on this, but cracks and all :/ Feel free to take
> through rust tree.
Thanks, will do!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 10/27] rust: maple_tree: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (8 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 09/27] rust: jump_label: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 15:09 ` Liam R. Howlett
2026-01-05 12:42 ` [PATCH v2 11/27] rust: mm: " Alice Ryhl
` (19 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Andrew Ballance, Gary Guo,
Andrew Morton, Liam R. Howlett, maple-tree, linux-mm
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Acked-by: Andrew Ballance <andrewjballance@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: maple-tree@lists.infradead.org
Cc: linux-mm@kvack.org
---
rust/helpers/maple_tree.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rust/helpers/maple_tree.c b/rust/helpers/maple_tree.c
index 1dd9ac84a13feed53c0ed5eec6805517081d0673..5586486a76e0de60969af1510b4b0428392920e6 100644
--- a/rust/helpers/maple_tree.c
+++ b/rust/helpers/maple_tree.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 10/27] rust: maple_tree: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 10/27] rust: maple_tree: " Alice Ryhl
@ 2026-01-05 15:09 ` Liam R. Howlett
0 siblings, 0 replies; 65+ messages in thread
From: Liam R. Howlett @ 2026-01-05 15:09 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Andrew Ballance,
Gary Guo, Andrew Morton, maple-tree, linux-mm
* Alice Ryhl <aliceryhl@google.com> [260105 07:42]:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Acked-by: Andrew Ballance <andrewjballance@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> ---
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
> Cc: Andrew Ballance <andrewjballance@gmail.com>
> Cc: maple-tree@lists.infradead.org
> Cc: linux-mm@kvack.org
> ---
> rust/helpers/maple_tree.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/rust/helpers/maple_tree.c b/rust/helpers/maple_tree.c
> index 1dd9ac84a13feed53c0ed5eec6805517081d0673..5586486a76e0de60969af1510b4b0428392920e6 100644
> --- a/rust/helpers/maple_tree.c
> +++ b/rust/helpers/maple_tree.c
> @@ -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);
> }
>
> --
> 2.52.0.351.gbe84eed79e-goog
>
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 11/27] rust: mm: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (9 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 10/27] rust: maple_tree: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 15:10 ` Liam R. Howlett
2026-01-05 12:42 ` [PATCH v2 12/27] rust: of: " Alice Ryhl
` (18 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Andrew Morton,
Lorenzo Stoakes, Liam R. Howlett, Uladzislau Rezki, Vitaly Wool,
linux-mm
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.se>
Cc: linux-mm@kvack.org
---
rust/helpers/mm.c | 20 ++++++++++----------
rust/helpers/page.c | 9 +++++----
rust/helpers/vmalloc.c | 2 +-
3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/rust/helpers/mm.c b/rust/helpers/mm.c
index 81b510c96fd2692dcb7ab4705f790bd3a41a630e..b5540997bd20d4398e2838956ed70b2fb61c5661 100644
--- a/rust/helpers/mm.c
+++ b/rust/helpers/mm.c
@@ -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);
}
diff --git a/rust/helpers/page.c b/rust/helpers/page.c
index 7144de5a61dbdb3006a668961cd1b09440e74908..f8463fbed2a2670ddfd4c23dc922b46b0913c3a2 100644
--- a/rust/helpers/page.c
+++ b/rust/helpers/page.c
@@ -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);
}
diff --git a/rust/helpers/vmalloc.c b/rust/helpers/vmalloc.c
index 7d7f7336b3d2f5a32e6a2b6cf8407da37775cfd9..326b030487a2b2199283b64b3b427e57cf5fb14a 100644
--- a/rust/helpers/vmalloc.c
+++ b/rust/helpers/vmalloc.c
@@ -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
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 11/27] rust: mm: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 11/27] rust: mm: " Alice Ryhl
@ 2026-01-05 15:10 ` Liam R. Howlett
2026-01-05 15:22 ` Lorenzo Stoakes
0 siblings, 1 reply; 65+ messages in thread
From: Liam R. Howlett @ 2026-01-05 15:10 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo, Andrew Morton,
Lorenzo Stoakes, Uladzislau Rezki, Vitaly Wool, linux-mm
* Alice Ryhl <aliceryhl@google.com> [260105 07:42]:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> ---
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
> Cc: Uladzislau Rezki <urezki@gmail.com>
> Cc: Vitaly Wool <vitaly.wool@konsulko.se>
> Cc: linux-mm@kvack.org
> ---
> rust/helpers/mm.c | 20 ++++++++++----------
> rust/helpers/page.c | 9 +++++----
> rust/helpers/vmalloc.c | 2 +-
> 3 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/rust/helpers/mm.c b/rust/helpers/mm.c
> index 81b510c96fd2692dcb7ab4705f790bd3a41a630e..b5540997bd20d4398e2838956ed70b2fb61c5661 100644
> --- a/rust/helpers/mm.c
> +++ b/rust/helpers/mm.c
> @@ -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);
> }
> diff --git a/rust/helpers/page.c b/rust/helpers/page.c
> index 7144de5a61dbdb3006a668961cd1b09440e74908..f8463fbed2a2670ddfd4c23dc922b46b0913c3a2 100644
> --- a/rust/helpers/page.c
> +++ b/rust/helpers/page.c
> @@ -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);
> }
> diff --git a/rust/helpers/vmalloc.c b/rust/helpers/vmalloc.c
> index 7d7f7336b3d2f5a32e6a2b6cf8407da37775cfd9..326b030487a2b2199283b64b3b427e57cf5fb14a 100644
> --- a/rust/helpers/vmalloc.c
> +++ b/rust/helpers/vmalloc.c
> @@ -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
>
^ permalink raw reply [flat|nested] 65+ messages in thread* Re: [PATCH v2 11/27] rust: mm: add __rust_helper to helpers
2026-01-05 15:10 ` Liam R. Howlett
@ 2026-01-05 15:22 ` Lorenzo Stoakes
0 siblings, 0 replies; 65+ messages in thread
From: Lorenzo Stoakes @ 2026-01-05 15:22 UTC (permalink / raw)
To: Liam R. Howlett, Alice Ryhl, rust-for-linux, linux-kernel,
Boqun Feng, Gary Guo, Andrew Morton, Uladzislau Rezki,
Vitaly Wool, linux-mm
On Mon, Jan 05, 2026 at 10:10:03AM -0500, Liam R. Howlett wrote:
> * Alice Ryhl <aliceryhl@google.com> [260105 07:42]:
> > This is needed to inline these helpers into Rust code.
> >
> > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > Reviewed-by: Gary Guo <gary@garyguo.net>
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>
> Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Seems straightforward enough so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
>
> > ---
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
> > Cc: Uladzislau Rezki <urezki@gmail.com>
> > Cc: Vitaly Wool <vitaly.wool@konsulko.se>
> > Cc: linux-mm@kvack.org
> > ---
> > rust/helpers/mm.c | 20 ++++++++++----------
> > rust/helpers/page.c | 9 +++++----
> > rust/helpers/vmalloc.c | 2 +-
> > 3 files changed, 16 insertions(+), 15 deletions(-)
> >
> > diff --git a/rust/helpers/mm.c b/rust/helpers/mm.c
> > index 81b510c96fd2692dcb7ab4705f790bd3a41a630e..b5540997bd20d4398e2838956ed70b2fb61c5661 100644
> > --- a/rust/helpers/mm.c
> > +++ b/rust/helpers/mm.c
> > @@ -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);
> > }
> > diff --git a/rust/helpers/page.c b/rust/helpers/page.c
> > index 7144de5a61dbdb3006a668961cd1b09440e74908..f8463fbed2a2670ddfd4c23dc922b46b0913c3a2 100644
> > --- a/rust/helpers/page.c
> > +++ b/rust/helpers/page.c
> > @@ -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);
> > }
> > diff --git a/rust/helpers/vmalloc.c b/rust/helpers/vmalloc.c
> > index 7d7f7336b3d2f5a32e6a2b6cf8407da37775cfd9..326b030487a2b2199283b64b3b427e57cf5fb14a 100644
> > --- a/rust/helpers/vmalloc.c
> > +++ b/rust/helpers/vmalloc.c
> > @@ -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
> >
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 12/27] rust: of: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (10 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 11/27] rust: mm: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-12 16:26 ` Rob Herring
2026-01-05 12:42 ` [PATCH v2 13/27] rust: processor: " Alice Ryhl
` (17 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Rob Herring,
devicetree
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
---
rust/helpers/of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/of.c b/rust/helpers/of.c
index 86b51167c913f96b626e55adb51bdac2a9f04f56..8f62ca69e8ba54098343dcef77f5e82e5a3bf497 100644
--- a/rust/helpers/of.c
+++ b/rust/helpers/of.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 12/27] rust: of: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 12/27] rust: of: " Alice Ryhl
@ 2026-01-12 16:26 ` Rob Herring
0 siblings, 0 replies; 65+ messages in thread
From: Rob Herring @ 2026-01-12 16:26 UTC (permalink / raw)
To: Alice Ryhl; +Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo, devicetree
On Mon, Jan 05, 2026 at 12:42:25PM +0000, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
> ---
> rust/helpers/of.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 13/27] rust: processor: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (11 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 12/27] rust: of: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: processor: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 14/27] rust: pwm: add " Alice Ryhl
` (16 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, FUJITA Tomonori,
Andreas Hindborg, Miguel Ojeda, Daniel Almeida
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Daniel Almeida <daniel.almeida@collabora.com>
---
rust/helpers/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/processor.c b/rust/helpers/processor.c
index d41355e14d6eb593beb018b5709118afe855c852..76fadbb647c5592db4526569fb1ed6b04ed17e87 100644
--- a/rust/helpers/processor.c
+++ b/rust/helpers/processor.c
@@ -2,7 +2,7 @@
#include <linux/processor.h>
-void rust_helper_cpu_relax(void)
+__rust_helper void rust_helper_cpu_relax(void)
{
cpu_relax();
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: processor: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 13/27] rust: processor: " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:26
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-13-51da5f454a67@google.com
---
rust/helpers/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/processor.c b/rust/helpers/processor.c
index d41355e..76fadbb 100644
--- a/rust/helpers/processor.c
+++ b/rust/helpers/processor.c
@@ -2,7 +2,7 @@
#include <linux/processor.h>
-void rust_helper_cpu_relax(void)
+__rust_helper void rust_helper_cpu_relax(void)
{
cpu_relax();
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (12 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 13/27] rust: processor: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 17:09 ` Michal Wilczynski
2026-01-20 18:02 ` Uwe Kleine-König
2026-01-05 12:42 ` [PATCH v2 15/27] rust: rbtree: " Alice Ryhl
` (15 subsequent siblings)
29 siblings, 2 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux; +Cc: linux-kernel, Alice Ryhl, Michal Wilczynski, linux-pwm
This is needed to inline these helpers into Rust code.
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: linux-pwm@vger.kernel.org
---
rust/helpers/pwm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/helpers/pwm.c b/rust/helpers/pwm.c
index d75c588863685d3990b525bb1b84aa4bc35ac397..eb24d2ea8e748364f3e17dccbb6a92fd7f2514c0 100644
--- a/rust/helpers/pwm.c
+++ b/rust/helpers/pwm.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 14/27] rust: pwm: add " Alice Ryhl
@ 2026-01-05 17:09 ` Michal Wilczynski
2026-01-20 18:02 ` Uwe Kleine-König
1 sibling, 0 replies; 65+ messages in thread
From: Michal Wilczynski @ 2026-01-05 17:09 UTC (permalink / raw)
To: Alice Ryhl, rust-for-linux; +Cc: linux-kernel, linux-pwm
On 1/5/26 13:42, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Michal Wilczynski <m.wilczynski@samsung.com>
> Cc: linux-pwm@vger.kernel.org
> ---
> rust/helpers/pwm.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/rust/helpers/pwm.c b/rust/helpers/pwm.c
> index d75c588863685d3990b525bb1b84aa4bc35ac397..eb24d2ea8e748364f3e17dccbb6a92fd7f2514c0 100644
> --- a/rust/helpers/pwm.c
> +++ b/rust/helpers/pwm.c
> @@ -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);
> }
>
Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>
^ permalink raw reply [flat|nested] 65+ messages in thread* Re: [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 14/27] rust: pwm: add " Alice Ryhl
2026-01-05 17:09 ` Michal Wilczynski
@ 2026-01-20 18:02 ` Uwe Kleine-König
1 sibling, 0 replies; 65+ messages in thread
From: Uwe Kleine-König @ 2026-01-20 18:02 UTC (permalink / raw)
To: Alice Ryhl; +Cc: rust-for-linux, linux-kernel, Michal Wilczynski, linux-pwm
[-- Attachment #1: Type: text/plain, Size: 432 bytes --]
Hello,
On Mon, Jan 05, 2026 at 12:42:27PM +0000, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Michal Wilczynski <m.wilczynski@samsung.com>
> Cc: linux-pwm@vger.kernel.org
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 15/27] rust: rbtree: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (13 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 14/27] rust: pwm: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 16/27] rust: rcu: " Alice Ryhl
` (14 subsequent siblings)
29 siblings, 0 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux; +Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
rust/helpers/rbtree.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/rust/helpers/rbtree.c b/rust/helpers/rbtree.c
index 2a0eabbb41603b0200e051ac5c091a870bd7346c..a85defb22ff7c6d5104a503f4456294bfc2b4756 100644
--- a/rust/helpers/rbtree.c
+++ b/rust/helpers/rbtree.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [PATCH v2 16/27] rust: rcu: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (14 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 15/27] rust: rbtree: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 15:26 ` Joel Fernandes
2026-01-13 10:49 ` [tip: locking/core] rust: rcu: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 17/27] rust: refcount: add " Alice Ryhl
` (13 subsequent siblings)
29 siblings, 2 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Paul E. McKenney,
rcu
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: rcu@vger.kernel.org
---
rust/helpers/rcu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/rcu.c b/rust/helpers/rcu.c
index f1cec6583513497e996f74835ca2c6c3f4a8c954..481274c058577276e20093a1014fc49f4a40421b 100644
--- a/rust/helpers/rcu.c
+++ b/rust/helpers/rcu.c
@@ -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();
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 16/27] rust: rcu: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 16/27] rust: rcu: " Alice Ryhl
@ 2026-01-05 15:26 ` Joel Fernandes
2026-01-13 10:49 ` [tip: locking/core] rust: rcu: Add " tip-bot2 for Alice Ryhl
1 sibling, 0 replies; 65+ messages in thread
From: Joel Fernandes @ 2026-01-05 15:26 UTC (permalink / raw)
To: Alice Ryhl, rust-for-linux
Cc: linux-kernel, Boqun Feng, Gary Guo, Paul E. McKenney, rcu
On 1/5/2026 7:42 AM, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Joel Fernandes (NVIDIA) <joel@joelfernandes.org>
Thanks.
> ---
> Cc: "Paul E. McKenney" <paulmck@kernel.org>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Cc: rcu@vger.kernel.org
> ---
> rust/helpers/rcu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rust/helpers/rcu.c b/rust/helpers/rcu.c
> index f1cec6583513497e996f74835ca2c6c3f4a8c954..481274c058577276e20093a1014fc49f4a40421b 100644
> --- a/rust/helpers/rcu.c
> +++ b/rust/helpers/rcu.c
> @@ -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();
> }
>
^ permalink raw reply [flat|nested] 65+ messages in thread* [tip: locking/core] rust: rcu: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 16/27] rust: rcu: " Alice Ryhl
2026-01-05 15:26 ` Joel Fernandes
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
1 sibling, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits
Cc: Boqun Feng, Gary Guo, Alice Ryhl, Joel Fernandes (NVIDIA), x86,
linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:29
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Joel Fernandes (NVIDIA) <joel@joelfernandes.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-16-51da5f454a67@google.com
---
rust/helpers/rcu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/rcu.c b/rust/helpers/rcu.c
index f1cec65..481274c 100644
--- a/rust/helpers/rcu.c
+++ b/rust/helpers/rcu.c
@@ -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();
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 17/27] rust: refcount: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (15 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 16/27] rust: rcu: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: refcount: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 18/27] rust: security: add " Alice Ryhl
` (12 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Will Deacon,
Peter Zijlstra, Fiona Behrens, Benno Lossin
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Fiona Behrens <me@kloenk.dev>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Gary Guo <gary@garyguo.net>
---
rust/helpers/refcount.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c
index d175898ad7b81ee9da3d9d125764db02e837da52..36334a674ee42eb46792210903a0e3cf9debd9a1 100644
--- a/rust/helpers/refcount.c
+++ b/rust/helpers/refcount.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: refcount: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 17/27] rust: refcount: add " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:30
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-17-51da5f454a67@google.com
---
rust/helpers/refcount.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c
index d175898..36334a6 100644
--- a/rust/helpers/refcount.c
+++ b/rust/helpers/refcount.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 18/27] rust: security: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (16 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 17/27] rust: refcount: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-07 1:29 ` Paul Moore
2026-01-05 12:42 ` [PATCH v2 19/27] rust: slab: " Alice Ryhl
` (11 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Paul Moore,
Greg Kroah-Hartman, linux-security-module
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Paul Moore <paul@paul-moore.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-security-module@vger.kernel.org
---
rust/helpers/security.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/rust/helpers/security.c b/rust/helpers/security.c
index ca22da09548dfed95a83168ed09263e75cf08fd2..8d0a25fcf931ac6540a986aa10187c345614fc9e 100644
--- a/rust/helpers/security.c
+++ b/rust/helpers/security.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 18/27] rust: security: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 18/27] rust: security: add " Alice Ryhl
@ 2026-01-07 1:29 ` Paul Moore
0 siblings, 0 replies; 65+ messages in thread
From: Paul Moore @ 2026-01-07 1:29 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Greg Kroah-Hartman, linux-security-module
On Mon, Jan 5, 2026 at 7:43 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-security-module@vger.kernel.org
> ---
> rust/helpers/security.c | 26 +++++++++++++++-----------
> 1 file changed, 15 insertions(+), 11 deletions(-)
Merged into lsm/dev, thanks.
--
paul-moore.com
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (17 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 18/27] rust: security: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 12:56 ` Danilo Krummrich
2026-01-05 12:42 ` [PATCH v2 20/27] rust: sync: " Alice Ryhl
` (10 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Vlastimil Babka,
Andrew Morton, Christoph Lameter, David Rientjes, Vitaly Wool,
Danilo Krummrich
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@gentwo.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.se>
Cc: Danilo Krummrich <dakr@kernel.org>
---
rust/helpers/slab.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/helpers/slab.c b/rust/helpers/slab.c
index 7fac958907b0a7cbb28ef3a8a56e0cc10d39288f..9279f082467d896381e34c4333492a92d626da2e 100644
--- a/rust/helpers/slab.c
+++ b/rust/helpers/slab.c
@@ -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)
{
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 19/27] rust: slab: " Alice Ryhl
@ 2026-01-05 12:56 ` Danilo Krummrich
2026-01-05 13:06 ` Alice Ryhl
0 siblings, 1 reply; 65+ messages in thread
From: Danilo Krummrich @ 2026-01-05 12:56 UTC (permalink / raw)
To: Alice Ryhl, Andrew Morton, Miguel Ojeda
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Vlastimil Babka, Christoph Lameter, David Rientjes, Vitaly Wool
On Mon Jan 5, 2026 at 1:42 PM CET, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
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 <dakr@kernel.org>
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
2026-01-05 12:56 ` Danilo Krummrich
@ 2026-01-05 13:06 ` Alice Ryhl
2026-01-05 17:04 ` Miguel Ojeda
0 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 13:06 UTC (permalink / raw)
To: Danilo Krummrich, Andrew Morton
Cc: Miguel Ojeda, rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Vlastimil Babka, Christoph Lameter, David Rientjes, Vitaly Wool
On Mon, Jan 05, 2026 at 01:56:05PM +0100, Danilo Krummrich wrote:
> On Mon Jan 5, 2026 at 1:42 PM CET, Alice Ryhl wrote:
> > This is needed to inline these helpers into Rust code.
> >
> > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > Reviewed-by: Gary Guo <gary@garyguo.net>
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>
> 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 <dakr@kernel.org>
Sounds good to me. There is also mm and maple_tree for Andrew Morton.
Alice
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
2026-01-05 13:06 ` Alice Ryhl
@ 2026-01-05 17:04 ` Miguel Ojeda
0 siblings, 0 replies; 65+ messages in thread
From: Miguel Ojeda @ 2026-01-05 17:04 UTC (permalink / raw)
To: Alice Ryhl
Cc: Danilo Krummrich, Andrew Morton, Miguel Ojeda, rust-for-linux,
linux-kernel, Boqun Feng, Gary Guo, Vlastimil Babka,
Christoph Lameter, David Rientjes, Vitaly Wool
On Mon, Jan 5, 2026 at 2:06 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> Sounds good to me. There is also mm and maple_tree for Andrew Morton.
Either way sounds good for me -- anyway I will have to pick the `bug`
and `err` at least.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 20/27] rust: sync: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (18 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 19/27] rust: slab: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: sync: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 21/27] rust: task: add " Alice Ryhl
` (9 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Peter Zijlstra,
Ingo Molnar, Will Deacon, Waiman Long, Mitchell Levy,
Benno Lossin
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Mitchell Levy <levymitchell0@gmail.com>
Cc: Benno Lossin <lossin@kernel.org>
---
rust/helpers/mutex.c | 13 +++++++------
rust/helpers/spinlock.c | 13 +++++++------
rust/helpers/sync.c | 4 ++--
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c
index e487819125f0dfe0741601205e8f84d322c973d5..1b07d6e64299d509bc3ce1af99b19aa97b721fc6 100644
--- a/rust/helpers/mutex.c
+++ b/rust/helpers/mutex.c
@@ -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);
}
diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
index 42c4bf01a23e4003ea82c65b16bc8f495ad37750..4d13062cf253e67894aaa9ba968ff381db2c651e 100644
--- a/rust/helpers/spinlock.c
+++ b/rust/helpers/spinlock.c
@@ -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);
}
diff --git a/rust/helpers/sync.c b/rust/helpers/sync.c
index ff7e68b4881011ce0aa9beb2df14bf0ffd147337..82d6aff73b04f0ab1030bb5170e40ed6ccac41c0 100644
--- a/rust/helpers/sync.c
+++ b/rust/helpers/sync.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: sync: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 20/27] rust: sync: " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:33
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-20-51da5f454a67@google.com
---
rust/helpers/mutex.c | 13 +++++++------
rust/helpers/spinlock.c | 13 +++++++------
rust/helpers/sync.c | 4 ++--
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c
index e487819..1b07d6e 100644
--- a/rust/helpers/mutex.c
+++ b/rust/helpers/mutex.c
@@ -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);
}
diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
index 42c4bf0..4d13062 100644
--- a/rust/helpers/spinlock.c
+++ b/rust/helpers/spinlock.c
@@ -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);
}
diff --git a/rust/helpers/sync.c b/rust/helpers/sync.c
index ff7e68b..82d6aff 100644
--- a/rust/helpers/sync.c
+++ b/rust/helpers/sync.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 21/27] rust: task: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (19 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 20/27] rust: sync: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: task: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 22/27] rust: time: add " Alice Ryhl
` (8 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, FUJITA Tomonori
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
rust/helpers/signal.c | 2 +-
rust/helpers/task.c | 24 ++++++++++++------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
index 1a6bbe9438e281cd8b61141a390cea042949e7bd..85111186cf3d77508fefac9407c87c5f000d15cf 100644
--- a/rust/helpers/signal.c
+++ b/rust/helpers/signal.c
@@ -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);
}
diff --git a/rust/helpers/task.c b/rust/helpers/task.c
index 2c85bbc2727efedf5eb61fe496cd80598fafcdd1..c0e1a06ede78c0b0641707b52a82725543e2c02c 100644
--- a/rust/helpers/task.c
+++ b/rust/helpers/task.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: task: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 21/27] rust: task: add " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:34
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-21-51da5f454a67@google.com
---
rust/helpers/signal.c | 2 +-
rust/helpers/task.c | 24 ++++++++++++------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
index 1a6bbe9..8511118 100644
--- a/rust/helpers/signal.c
+++ b/rust/helpers/signal.c
@@ -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);
}
diff --git a/rust/helpers/task.c b/rust/helpers/task.c
index 2c85bbc..c0e1a06 100644
--- a/rust/helpers/task.c
+++ b/rust/helpers/task.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 22/27] rust: time: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (20 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 21/27] rust: task: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: time: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 23/27] rust: uaccess: add " Alice Ryhl
` (7 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Andreas Hindborg,
FUJITA Tomonori, Frederic Weisbecker, Lyude Paul, Thomas Gleixner,
Anna-Maria Behnsen, John Stultz, Stephen Boyd, Fiona Behrens
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: John Stultz <jstultz@google.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Fiona Behrens <me@kloenk.dev>
Cc: Gary Guo <gary@garyguo.net>
---
rust/helpers/time.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/rust/helpers/time.c b/rust/helpers/time.c
index 67a36ccc3ec48379bc5983e58b1567947c5dcace..32f4959704939c0691bca03bad48b95becf21d10 100644
--- a/rust/helpers/time.c
+++ b/rust/helpers/time.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: time: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 22/27] rust: time: add " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:35
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-22-51da5f454a67@google.com
---
rust/helpers/time.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/rust/helpers/time.c b/rust/helpers/time.c
index 67a36cc..32f4959 100644
--- a/rust/helpers/time.c
+++ b/rust/helpers/time.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 23/27] rust: uaccess: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (21 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 22/27] rust: time: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 24/27] rust: usb: " Alice Ryhl
` (6 subsequent siblings)
29 siblings, 0 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo,
Greg Kroah-Hartman
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
rust/helpers/uaccess.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/rust/helpers/uaccess.c b/rust/helpers/uaccess.c
index 4629b2d15529abf20d02352d587808b621749c61..d9625b9ee04669777e01af05034af35218557050 100644
--- a/rust/helpers/uaccess.c
+++ b/rust/helpers/uaccess.c
@@ -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);
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [PATCH v2 24/27] rust: usb: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (22 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 23/27] rust: uaccess: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 13:40 ` Daniel Almeida
2026-01-05 12:42 ` [PATCH v2 25/27] rust: wait: " Alice Ryhl
` (5 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo,
Greg Kroah-Hartman, linux-usb, Daniel Almeida
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: Daniel Almeida <daniel.almeida@collabora.com>
---
rust/helpers/usb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rust/helpers/usb.c b/rust/helpers/usb.c
index fb2aad0cbf4d26ac7fb1a3f176ee7a1d30800f92..eff1cf7be3c2d10b7e9248252d354eb8a4fd4c94 100644
--- a/rust/helpers/usb.c
+++ b/rust/helpers/usb.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 24/27] rust: usb: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 24/27] rust: usb: " Alice Ryhl
@ 2026-01-05 13:40 ` Daniel Almeida
0 siblings, 0 replies; 65+ messages in thread
From: Daniel Almeida @ 2026-01-05 13:40 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Greg Kroah-Hartman, linux-usb
> On 5 Jan 2026, at 09:42, Alice Ryhl <aliceryhl@google.com> wrote:
>
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: Daniel Almeida <daniel.almeida@collabora.com>
> ---
> rust/helpers/usb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/rust/helpers/usb.c b/rust/helpers/usb.c
> index fb2aad0cbf4d26ac7fb1a3f176ee7a1d30800f92..eff1cf7be3c2d10b7e9248252d354eb8a4fd4c94 100644
> --- a/rust/helpers/usb.c
> +++ b/rust/helpers/usb.c
> @@ -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);
> }
>
> --
> 2.52.0.351.gbe84eed79e-goog
>
>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH v2 25/27] rust: wait: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (23 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 24/27] rust: usb: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-13 10:49 ` [tip: locking/core] rust: wait: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 26/27] rust: workqueue: add " Alice Ryhl
` (4 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Peter Zijlstra,
Ingo Molnar, Thomas Gleixner, Anna-Maria Behnsen
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
---
rust/helpers/wait.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/wait.c b/rust/helpers/wait.c
index ae48e33d9da3b0a780722b79b89d8d766efae17b..2dde1e4517809d20d09cb9a355f8005fcb160d4a 100644
--- a/rust/helpers/wait.c
+++ b/rust/helpers/wait.c
@@ -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);
}
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [tip: locking/core] rust: wait: Add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 25/27] rust: wait: " Alice Ryhl
@ 2026-01-13 10:49 ` tip-bot2 for Alice Ryhl
0 siblings, 0 replies; 65+ messages in thread
From: tip-bot2 for Alice Ryhl @ 2026-01-13 10:49 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Boqun Feng, Gary Guo, Alice Ryhl, x86, linux-kernel
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 <aliceryhl@google.com>
AuthorDate: Mon, 05 Jan 2026 12:42:38
Committer: Boqun Feng <boqun.feng@gmail.com>
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.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-25-51da5f454a67@google.com
---
rust/helpers/wait.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/helpers/wait.c b/rust/helpers/wait.c
index ae48e33..2dde1e4 100644
--- a/rust/helpers/wait.c
+++ b/rust/helpers/wait.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH v2 26/27] rust: workqueue: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (24 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 25/27] rust: wait: " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-12 18:06 ` Tejun Heo
2026-01-05 12:42 ` [PATCH v2 27/27] rust: xarray: " Alice Ryhl
` (3 subsequent siblings)
29 siblings, 1 reply; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Tejun Heo,
Lai Jiangshan
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Tejun Heo <tj@kernel.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
---
rust/helpers/workqueue.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
index b2b82753509bf5dbd0f4ddebb96a95a51e5976b1..ce1c3a5b215028cc04e2f4a7d9c9c60931792e07 100644
--- a/rust/helpers/workqueue.c
+++ b/rust/helpers/workqueue.c
@@ -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();
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply related [flat|nested] 65+ messages in thread* [PATCH v2 27/27] rust: xarray: add __rust_helper to helpers
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (25 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 26/27] rust: workqueue: add " Alice Ryhl
@ 2026-01-05 12:42 ` Alice Ryhl
2026-01-05 15:26 ` Tamir Duberstein
2026-01-15 9:02 ` Andreas Hindborg
2026-01-05 15:41 ` [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Boqun Feng
` (2 subsequent siblings)
29 siblings, 2 replies; 65+ messages in thread
From: Alice Ryhl @ 2026-01-05 12:42 UTC (permalink / raw)
To: rust-for-linux
Cc: linux-kernel, Alice Ryhl, Boqun Feng, Gary Guo, Andrew Morton,
Matthew Wilcox, Tamir Duberstein, Andreas Hindborg, linux-fsdevel,
linux-mm
This is needed to inline these helpers into Rust code.
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Tamir Duberstein <tamird@gmail.com>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-mm@kvack.org
---
rust/helpers/xarray.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/rust/helpers/xarray.c b/rust/helpers/xarray.c
index 60b299f11451d2c4a75e50e25dec4dac13f143f4..08979b3043410ff89d2adc0b2597825115c5100f 100644
--- a/rust/helpers/xarray.c
+++ b/rust/helpers/xarray.c
@@ -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
^ permalink raw reply related [flat|nested] 65+ messages in thread* Re: [PATCH v2 27/27] rust: xarray: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 27/27] rust: xarray: " Alice Ryhl
@ 2026-01-05 15:26 ` Tamir Duberstein
2026-01-15 9:02 ` Andreas Hindborg
1 sibling, 0 replies; 65+ messages in thread
From: Tamir Duberstein @ 2026-01-05 15:26 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo, Andrew Morton,
Matthew Wilcox, Andreas Hindborg, linux-fsdevel, linux-mm
On Mon, Jan 5, 2026 at 7:43 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Tamir Duberstein <tamird@gmail.com>
> ---
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Tamir Duberstein <tamird@gmail.com>
> Cc: Andreas Hindborg <a.hindborg@kernel.org>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-mm@kvack.org
> ---
> rust/helpers/xarray.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/rust/helpers/xarray.c b/rust/helpers/xarray.c
> index 60b299f11451d2c4a75e50e25dec4dac13f143f4..08979b3043410ff89d2adc0b2597825115c5100f 100644
> --- a/rust/helpers/xarray.c
> +++ b/rust/helpers/xarray.c
> @@ -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
>
^ permalink raw reply [flat|nested] 65+ messages in thread* Re: [PATCH v2 27/27] rust: xarray: add __rust_helper to helpers
2026-01-05 12:42 ` [PATCH v2 27/27] rust: xarray: " Alice Ryhl
2026-01-05 15:26 ` Tamir Duberstein
@ 2026-01-15 9:02 ` Andreas Hindborg
1 sibling, 0 replies; 65+ messages in thread
From: Andreas Hindborg @ 2026-01-15 9:02 UTC (permalink / raw)
To: rust-for-linux, Alice Ryhl
Cc: linux-kernel, Boqun Feng, Gary Guo, Andrew Morton, Matthew Wilcox,
Tamir Duberstein, linux-fsdevel, linux-mm
On Mon, 05 Jan 2026 12:42:40 +0000, Alice Ryhl wrote:
> 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,
--
Andreas Hindborg <a.hindborg@kernel.org>
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (26 preceding siblings ...)
2026-01-05 12:42 ` [PATCH v2 27/27] rust: xarray: " Alice Ryhl
@ 2026-01-05 15:41 ` Boqun Feng
2026-01-26 5:08 ` Miguel Ojeda
2026-03-10 10:56 ` Miguel Ojeda
29 siblings, 0 replies; 65+ messages in thread
From: Boqun Feng @ 2026-01-05 15:41 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Gary Guo, Peter Zijlstra,
Elle Rhumsaa, Andreas Hindborg, linux-block, FUJITA Tomonori,
Miguel Ojeda, Michael Turquette, Stephen Boyd, linux-clk,
Benno Lossin, Danilo Krummrich, Thomas Gleixner, Paul Moore,
Serge Hallyn, linux-security-module, Josh Poimboeuf, Jason Baron,
Steven Rostedt, Ard Biesheuvel, Andrew Ballance, Andrew Morton,
Liam R. Howlett, maple-tree, linux-mm, Lorenzo Stoakes,
Uladzislau Rezki, Vitaly Wool, Rob Herring, devicetree,
Daniel Almeida, Michal Wilczynski, linux-pwm, Paul E. McKenney,
rcu, Will Deacon, Fiona Behrens, Greg Kroah-Hartman,
Vlastimil Babka, Christoph Lameter, David Rientjes, Ingo Molnar,
Waiman Long, Mitchell Levy, Frederic Weisbecker, Lyude Paul,
Anna-Maria Behnsen, John Stultz, linux-usb, Tejun Heo,
Lai Jiangshan, Matthew Wilcox, Tamir Duberstein, linux-fsdevel
On Mon, Jan 05, 2026 at 12:42:13PM +0000, Alice Ryhl wrote:
> 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.
>
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
> These changes were generated by adding __rust_helper and running
> ClangFormat. Unrelated formatting changes were removed manually.
>
[...]
^ permalink raw reply [flat|nested] 65+ messages in thread* Re: [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (27 preceding siblings ...)
2026-01-05 15:41 ` [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Boqun Feng
@ 2026-01-26 5:08 ` Miguel Ojeda
2026-03-10 10:56 ` Miguel Ojeda
29 siblings, 0 replies; 65+ messages in thread
From: Miguel Ojeda @ 2026-01-26 5:08 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Peter Zijlstra, Elle Rhumsaa, Andreas Hindborg, linux-block,
FUJITA Tomonori, Miguel Ojeda, Michael Turquette, Stephen Boyd,
linux-clk, Benno Lossin, Danilo Krummrich, Thomas Gleixner,
Paul Moore, Serge Hallyn, linux-security-module, Josh Poimboeuf,
Jason Baron, Steven Rostedt, Ard Biesheuvel, Andrew Ballance,
Andrew Morton, Liam R. Howlett, maple-tree, linux-mm,
Lorenzo Stoakes, Uladzislau Rezki, Vitaly Wool, Rob Herring,
devicetree, Daniel Almeida, Michal Wilczynski, linux-pwm,
Paul E. McKenney, rcu, Will Deacon, Fiona Behrens,
Greg Kroah-Hartman, Vlastimil Babka, Christoph Lameter,
David Rientjes, Ingo Molnar, Waiman Long, Mitchell Levy,
Frederic Weisbecker, Lyude Paul, Anna-Maria Behnsen, John Stultz,
linux-usb, Tejun Heo, Lai Jiangshan, Matthew Wilcox,
Tamir Duberstein, linux-fsdevel
On Mon, Jan 5, 2026 at 1:42 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> rust: bug: add __rust_helper to helpers
> rust: err: 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: rbtree: add __rust_helper to helpers
> rust: slab: add __rust_helper to helpers
> rust: uaccess: add __rust_helper to helpers
> rust: workqueue: add __rust_helper to 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
^ permalink raw reply [flat|nested] 65+ messages in thread* Re: [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
` (28 preceding siblings ...)
2026-01-26 5:08 ` Miguel Ojeda
@ 2026-03-10 10:56 ` Miguel Ojeda
29 siblings, 0 replies; 65+ messages in thread
From: Miguel Ojeda @ 2026-03-10 10:56 UTC (permalink / raw)
To: Alice Ryhl
Cc: rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
Peter Zijlstra, Elle Rhumsaa, Andreas Hindborg, linux-block,
FUJITA Tomonori, Miguel Ojeda, Michael Turquette, Stephen Boyd,
linux-clk, Benno Lossin, Danilo Krummrich, Thomas Gleixner,
Paul Moore, Serge Hallyn, linux-security-module, Josh Poimboeuf,
Jason Baron, Steven Rostedt, Ard Biesheuvel, Andrew Ballance,
Andrew Morton, Liam R. Howlett, maple-tree, linux-mm,
Lorenzo Stoakes, Uladzislau Rezki, Vitaly Wool, Rob Herring,
devicetree, Daniel Almeida, Michal Wilczynski, linux-pwm,
Paul E. McKenney, rcu, Will Deacon, Fiona Behrens,
Greg Kroah-Hartman, Vlastimil Babka, Christoph Lameter,
David Rientjes, Ingo Molnar, Waiman Long, Mitchell Levy,
Frederic Weisbecker, Lyude Paul, Anna-Maria Behnsen, John Stultz,
linux-usb, Tejun Heo, Lai Jiangshan, Matthew Wilcox,
Tamir Duberstein, linux-fsdevel
On Mon, Jan 5, 2026 at 1:42 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> rust: clk: add __rust_helper to helpers
> rust: jump_label: add __rust_helper to helpers
Applied these to `rust-next` -- thanks everyone!
With these, the series is complete.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 65+ messages in thread