All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: "FUJITA Tomonori" <fujita.tomonori@gmail.com>
Cc: <linux-kernel@vger.kernel.org>,  <rust-for-linux@vger.kernel.org>,
	<x86@kernel.org>,  <linux-riscv@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	 <loongarch@lists.linux.dev>, <tglx@linutronix.de>,
	 <mingo@redhat.com>,  <bp@alien8.de>,
	<dave.hansen@linux.intel.com>,  <peterz@infradead.org>,
	 <hpa@zytor.com>, <paul.walmsley@sifive.com>,
	 <palmer@dabbelt.com>, <aou@eecs.berkeley.edu>,
	 <catalin.marinas@arm.com>,  <will@kernel.org>,
	<chenhuacai@kernel.org>,  <kernel@xen0n.name>,
	<tangyouling@loongson.cn>,  <hejinyang@loongson.cn>,
	<yangtiezhu@loongson.cn>,  <ojeda@kernel.org>,
	 <alex.gaynor@gmail.com>, <boqun.feng@gmail.com>,
	 <gary@garyguo.net>,  <bjorn3_gh@protonmail.com>,
	<benno.lossin@proton.me>,  <aliceryhl@google.com>,
	 <tmgross@umich.edu>
Subject: Re: [PATCH v3 0/5] rust: Add bug/warn abstractions
Date: Wed, 26 Feb 2025 20:39:45 +0100	[thread overview]
Message-ID: <8734g0v6ke.fsf@kernel.org> (raw)
In-Reply-To: <20250213135759.190006-1-fujita.tomonori@gmail.com> (FUJITA Tomonori's message of "Thu, 13 Feb 2025 22:57:54 +0900")


Hi Fujita,

"FUJITA Tomonori" <fujita.tomonori@gmail.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/



WARNING: multiple messages have this Message-ID (diff)
From: Andreas Hindborg <a.hindborg@kernel.org>
To: "FUJITA Tomonori" <fujita.tomonori@gmail.com>
Cc: <linux-kernel@vger.kernel.org>,  <rust-for-linux@vger.kernel.org>,
	<x86@kernel.org>,  <linux-riscv@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	 <loongarch@lists.linux.dev>, <tglx@linutronix.de>,
	 <mingo@redhat.com>,  <bp@alien8.de>,
	<dave.hansen@linux.intel.com>,  <peterz@infradead.org>,
	 <hpa@zytor.com>, <paul.walmsley@sifive.com>,
	 <palmer@dabbelt.com>, <aou@eecs.berkeley.edu>,
	 <catalin.marinas@arm.com>,  <will@kernel.org>,
	<chenhuacai@kernel.org>,  <kernel@xen0n.name>,
	<tangyouling@loongson.cn>,  <hejinyang@loongson.cn>,
	<yangtiezhu@loongson.cn>,  <ojeda@kernel.org>,
	 <alex.gaynor@gmail.com>, <boqun.feng@gmail.com>,
	 <gary@garyguo.net>,  <bjorn3_gh@protonmail.com>,
	<benno.lossin@proton.me>,  <aliceryhl@google.com>,
	 <tmgross@umich.edu>
Subject: Re: [PATCH v3 0/5] rust: Add bug/warn abstractions
Date: Wed, 26 Feb 2025 20:39:45 +0100	[thread overview]
Message-ID: <8734g0v6ke.fsf@kernel.org> (raw)
In-Reply-To: <20250213135759.190006-1-fujita.tomonori@gmail.com> (FUJITA Tomonori's message of "Thu, 13 Feb 2025 22:57:54 +0900")


Hi Fujita,

"FUJITA Tomonori" <fujita.tomonori@gmail.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/


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2025-02-26 19:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <yy_ESUuchCjlaGIJHzCPAcP_d9ucSD0CGXaoZNNkY7BmN5Ch1J8avsA9QpKO5LkTjlGpu99jl8NrFl5NFSQXuw==@protonmail.internalid>
2025-02-13 13:57 ` [PATCH v3 0/5] rust: Add bug/warn abstractions FUJITA Tomonori
2025-02-13 13:57   ` FUJITA Tomonori
2025-02-13 13:57   ` [PATCH v3 1/5] x86/bug: Add ARCH_WARN_ASM macro for BUG/WARN asm code sharing with Rust FUJITA Tomonori
2025-02-13 13:57     ` FUJITA Tomonori
2025-02-13 13:57   ` [PATCH v3 2/5] riscv/bug: " FUJITA Tomonori
2025-02-13 13:57     ` FUJITA Tomonori
2025-02-28 10:13     ` Alexandre Ghiti
2025-02-28 10:13       ` Alexandre Ghiti
2025-02-13 13:57   ` [PATCH v3 3/5] arm64/bug: " FUJITA Tomonori
2025-02-13 13:57     ` FUJITA Tomonori
2025-02-26 19:27     ` Catalin Marinas
2025-02-26 19:27       ` Catalin Marinas
2025-02-27  7:01       ` FUJITA Tomonori
2025-02-27  7:01         ` FUJITA Tomonori
2025-02-13 13:57   ` [PATCH v3 4/5] loongarch/bug: " FUJITA Tomonori
2025-02-13 13:57     ` FUJITA Tomonori
2025-02-13 13:57   ` [PATCH v3 5/5] rust: Add warn_on and warn_on_once FUJITA Tomonori
2025-02-13 13:57     ` FUJITA Tomonori
2025-03-03 13:33     ` Alice Ryhl
2025-03-03 13:33       ` Alice Ryhl
2025-03-05  5:13       ` FUJITA Tomonori
2025-03-05  5:13         ` FUJITA Tomonori
2025-03-05  8:42     ` Alice Ryhl
2025-03-05  8:42       ` Alice Ryhl
2025-03-05 10:24       ` FUJITA Tomonori
2025-03-05 10:24         ` FUJITA Tomonori
2025-03-05 10:36         ` Alice Ryhl
2025-03-05 10:36           ` Alice Ryhl
2025-02-26 19:39   ` Andreas Hindborg [this message]
2025-02-26 19:39     ` [PATCH v3 0/5] rust: Add bug/warn abstractions Andreas Hindborg
2025-02-27  6:54     ` FUJITA Tomonori
2025-02-27  6:54       ` FUJITA Tomonori
2025-02-27  8:28       ` Andreas Hindborg
2025-02-27  8:28         ` Andreas Hindborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734g0v6ke.fsf@kernel.org \
    --to=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=hejinyang@loongson.cn \
    --cc=hpa@zytor.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tangyouling@loongson.cn \
    --cc=tglx@linutronix.de \
    --cc=tmgross@umich.edu \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.