lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240809191601.3d15e3af.gary@garyguo.net>
Date: Fri, 9 Aug 2024 19:16:01 +0100
From: Gary Guo <gary@...yguo.net>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, Masami Hiramatsu
 <mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf
 <jpoimboe@...nel.org>, Jason Baron <jbaron@...mai.com>, Ard Biesheuvel
 <ardb@...nel.org>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor
 <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Boqun
 Feng <boqun.feng@...il.com>, "Björn Roy Baron"
 <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>, Andreas
 Hindborg <a.hindborg@...sung.com>, linux-trace-kernel@...r.kernel.org,
 rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org, Arnd Bergmann
 <arnd@...db.de>, linux-arch@...r.kernel.org, Thomas Gleixner
 <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
 <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
 "H. Peter Anvin" <hpa@...or.com>, Sean Christopherson <seanjc@...gle.com>,
 Uros Bizjak <ubizjak@...il.com>, Catalin Marinas <catalin.marinas@....com>,
 Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>, Oliver Upton
 <oliver.upton@...ux.dev>, Mark Rutland <mark.rutland@....com>, Ryan Roberts
 <ryan.roberts@....com>, Fuad Tabba <tabba@...gle.com>,
 linux-arm-kernel@...ts.infradead.org, Paul Walmsley
 <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, Albert Ou
 <aou@...s.berkeley.edu>, Anup Patel <apatel@...tanamicro.com>, Andrew Jones
 <ajones@...tanamicro.com>, Alexandre Ghiti <alexghiti@...osinc.com>, Conor
 Dooley <conor.dooley@...rochip.com>, Samuel Holland
 <samuel.holland@...ive.com>, linux-riscv@...ts.infradead.org, Huacai Chen
 <chenhuacai@...nel.org>, WANG Xuerui <kernel@...0n.name>, Bibo Mao
 <maobibo@...ngson.cn>, Tiezhu Yang <yangtiezhu@...ngson.cn>, Andrew Morton
 <akpm@...ux-foundation.org>, Tianrui Zhao <zhaotianrui@...ngson.cn>,
 loongarch@...ts.linux.dev
Subject: Re: [PATCH v6 1/5] rust: add generic static_key_false

On Thu, 08 Aug 2024 17:23:37 +0000
Alice Ryhl <aliceryhl@...gle.com> 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.
> 
> This patch only provides a generic implementation without code patching
> (matching the one used when CONFIG_JUMP_LABEL is disabled). Later
> patches add support for inline asm implementations that use runtime
> patching.
> 
> When CONFIG_JUMP_LABEL is unset, `static_key_count` is a static inline
> function, so a Rust helper is defined for `static_key_count` in this
> case. If Rust is compiled with LTO, this call should get inlined. The
> helper can be eliminated once we have the necessary inline asm to make
> atomic operations from Rust.
> 
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
> ---
>  rust/bindings/bindings_helper.h       |  1 +
>  rust/helpers.c                        |  9 +++++++++
>  rust/kernel/arch_static_branch_asm.rs |  1 +
>  rust/kernel/jump_label.rs             | 29 +++++++++++++++++++++++++++++
>  rust/kernel/lib.rs                    |  1 +
>  5 files changed, 41 insertions(+)
> 
> diff --git a/rust/kernel/arch_static_branch_asm.rs b/rust/kernel/arch_static_branch_asm.rs
> new file mode 100644
> index 000000000000..958f1f130455
> --- /dev/null
> +++ b/rust/kernel/arch_static_branch_asm.rs
> @@ -0,0 +1 @@
> +::kernel::concat_literals!("1: jmp " "{l_yes}" " # objtool NOPs this \n\t" ".pushsection __jump_table,  \"aw\" \n\t" " " ".balign 8" " " "\n\t" ".long 1b - . \n\t" ".long " "{l_yes}" "- . \n\t" " " ".quad" " " " " "{symb} + {off} + {branch}" " - . \n\t" ".popsection \n\t")


I believe this file is included by mistake, given it's added to
gitignore in patch 5.

Best,
Gary

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ