[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240417150001.37e48479@eugeo>
Date: Wed, 17 Apr 2024 15:00:01 +0100
From: Gary Guo <gary@...yguo.net>
To: Conor Dooley <conor@...nel.org>
Cc: linux-riscv@...ts.infradead.org, Conor Dooley
<conor.dooley@...rochip.com>, 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>, Jonathan Corbet <corbet@....net>, Paul Walmsley
<paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, Nathan
Chancellor <nathan@...nel.org>, Nick Desaulniers <ndesaulniers@...gle.com>,
rust-for-linux@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v3 1/1] RISC-V: enable building 64-bit kernels with rust
support
On Tue, 9 Apr 2024 18:25:16 +0100
Conor Dooley <conor@...nel.org> wrote:
> From: Miguel Ojeda <ojeda@...nel.org>
>
> The rust modules work on 64-bit RISC-V, with no twiddling required.
> Select HAVE_RUST and provide the required flags to kbuild so that the
> modules can be used. The Makefile and Kconfig changes are lifted from
> work done by Miguel in the Rust-for-Linux tree, hence his authorship.
> Following the rabbit hole, the Makefile changes originated in a script,
> created based on config files originally added by Gary, hence his
> co-authorship.
Thanks for sending the patch!
> 32-bit is broken in core rust code, so support is limited to 64-bit:
> ld.lld: error: undefined symbol: __udivdi3
I wouldn't call the core rust code broken :)
The missing symbol here should be easily stubbed by changing the
redirect-intrinsics in rust/Makefile and adding a stub in
compiler_builtins.rs. Although we probably instead of panicking, want
to redirect the division to kernel division routine (IIRC the division
is used for formatting integers, which is a legit use of division).
>
> As 64-bit RISC-V is now supported, add it to the arch support table.
>
> Co-developed-by: Gary Guo <gary@...yguo.net>
> Signed-off-by: Gary Guo <gary@...yguo.net>
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
> Co-developed-by: Conor Dooley <conor.dooley@...rochip.com>
> Signed-off-by: Conor Dooley <conor.dooley@...rochip.com>
> ---
> Documentation/rust/arch-support.rst | 1 +
> arch/riscv/Kconfig | 1 +
> arch/riscv/Makefile | 7 +++++++
> scripts/generate_rust_target.rs | 6 ++++++
> 4 files changed, 15 insertions(+)
Powered by blists - more mailing lists