From: Gary Guo <gary@garyguo.net>
To: Conor Dooley <conor@kernel.org>
Cc: linux-riscv@lists.infradead.org,
"Conor Dooley" <conor.dooley@microchip.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v3 1/1] RISC-V: enable building 64-bit kernels with rust support
Date: Wed, 17 Apr 2024 15:00:01 +0100 [thread overview]
Message-ID: <20240417150001.37e48479@eugeo> (raw)
In-Reply-To: <20240409-silencer-book-ce1320f06aab@spud>
On Tue, 9 Apr 2024 18:25:16 +0100
Conor Dooley <conor@kernel.org> wrote:
> From: Miguel Ojeda <ojeda@kernel.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@garyguo.net>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> Co-developed-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Conor Dooley <conor.dooley@microchip.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(+)
next prev parent reply other threads:[~2024-04-17 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 17:25 [PATCH v3 0/1] RISC-V: enable rust Conor Dooley
2024-04-09 17:25 ` [PATCH v3 1/1] RISC-V: enable building 64-bit kernels with rust support Conor Dooley
2024-04-17 14:00 ` Gary Guo [this message]
2024-04-10 13:22 ` [PATCH v3 0/1] RISC-V: enable rust Björn Töpel
2024-04-10 14:20 ` patchwork-bot+linux-riscv
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=20240417150001.37e48479@eugeo \
--to=gary@garyguo.net \
--cc=alex.gaynor@gmail.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).