Thread (5 messages) 5 messages, 2 authors, 2024-06-21

Re: [PATCH v2 1/2] rust: add static_key_false

From: Conor Dooley <conor@kernel.org>
Date: 2024-06-12 15:03:32
Also in: lkml, rust-for-linux

On Mon, Jun 10, 2024 at 02:01:04PM +0000, Alice Ryhl wrote:
Add just enough support for static key so that we can use it from
tracepoints. Tracepoints rely on `static_key_false` even though it is
deprecated, so we add the same functionality to Rust.

It is not possible to use the existing C implementation of
arch_static_branch because it passes the argument `key` to inline
assembly as an 'i' parameter, so any attempt to add a C helper for this
function will fail to compile because the value of `key` must be known
at compile-time.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
+#[cfg(target_arch = "x86_64")]
+#[cfg(target_arch = "aarch64")]
This patch breaks the build on riscv (and I assume loongarch):

error[E0432]: unresolved import `_static_key_false`
--> /stuff/linux/rust/kernel/static_key.rs:87:10
|
87 | pub use {_static_key_false, static_key_false};
|          ^^^^^^^^^^^^^^^^^ no external crate `_static_key_false`

Cheers,
Conor.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help