[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8734g0v6ke.fsf@kernel.org>
Date: Wed, 26 Feb 2025 20:39:45 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: "FUJITA Tomonori" <fujita.tomonori@...il.com>
Cc: <linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>,
<x86@...nel.org>, <linux-riscv@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>, <loongarch@...ts.linux.dev>,
<tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>, <peterz@...radead.org>, <hpa@...or.com>,
<paul.walmsley@...ive.com>, <palmer@...belt.com>,
<aou@...s.berkeley.edu>, <catalin.marinas@....com>, <will@...nel.org>,
<chenhuacai@...nel.org>, <kernel@...0n.name>,
<tangyouling@...ngson.cn>, <hejinyang@...ngson.cn>,
<yangtiezhu@...ngson.cn>, <ojeda@...nel.org>, <alex.gaynor@...il.com>,
<boqun.feng@...il.com>, <gary@...yguo.net>, <bjorn3_gh@...tonmail.com>,
<benno.lossin@...ton.me>, <aliceryhl@...gle.com>, <tmgross@...ch.edu>
Subject: Re: [PATCH v3 0/5] rust: Add bug/warn abstractions
Hi Fujita,
"FUJITA Tomonori" <fujita.tomonori@...il.com> writes:
> This patchset adds warn_on and warn_on_once macros with the bug/warn
> abstraction.
>
> Wrapping C's BUG/WARN macros does not work well for x86, RISC-V,
> ARM64, and LoongArch. Rust code needs to directly execute the same
> assembly code used on the C side. To avoid duplicating the assembly
> code, this approach mirrors what the static branch code does: it
> generates the assembly code for Rust using the C preprocessor at
> compile time.
>
> The 1st to 4th patches export the BUG/WARN assembly code for Rust on
> each architecture, with no functional changes on the C side. The
> changes for x86 and RISC-V are straightforward. However, the ARM64 and
> LoongArch assembly code are designed differently; they are used by
> both C inline assembly and assembly code. As a result, sharing this
> code with Rust is complicated.
>
> The last patch adds the bug abstraction with warn_on and warn_on_once
> implementations.
>
> This has been tested on x86, ARM64, and RISC-V (QEMU), with only a
> compile test performed for LoongArch.
>
> The assembly code can be used for both BUG and WARN, but currently
> only supports warn_on and warn_on_once. I will work on the remaining
> functionality after this abstraction is merged.
>
How does this series compare/overlap with [1] ?
Best regards,
Andreas Hindborg
[1] https://lore.kernel.org/all/20241126-pr_once_macros-v4-0-410b8ca9643e@tuta.io/
Powered by blists - more mailing lists