From: Alice Ryhl <alice@ryhl.io>
To: Boqun Feng <boqun.feng@gmail.com>, Andrew Lunn <andrew@lunn.ch>
Cc: Jamie Cunliffe <Jamie.Cunliffe@arm.com>,
linux-arm-kernel@lists.infradead.org,
rust-for-linux@vger.kernel.org, Miguel Ojeda <ojeda@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
steve.capper@arm.com, Asahi Lina <lina@asahilina.net>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-clk@vger.kernel.org
Subject: Re: [PATCH v4 2/2] arm64: rust: Enable Rust support for AArch64
Date: Sat, 21 Oct 2023 14:50:39 +0200 [thread overview]
Message-ID: <7bd5d863-0cee-49ef-8d53-f41f8bc8a904@ryhl.io> (raw)
In-Reply-To: <ZTLH5o0GlFBYsAHq@boqun-archlinux>
On 10/20/23 20:33, Boqun Feng wrote:
> On Fri, Oct 20, 2023 at 07:21:08PM +0200, Andrew Lunn wrote:
>>> +``arm64`` Maintained Little Endian only.
>>
>> This question is just out of curiosity, not the patchset itself.
>>
>> What is missing to make big endian work?
>>
>
> FWIW, I tried the following:
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 8784284988e5..b697c2d7da68 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -227,7 +227,7 @@ config ARM64
> select HAVE_FUNCTION_ARG_ACCESS_API
> select MMU_GATHER_RCU_TABLE_FREE
> select HAVE_RSEQ
> - select HAVE_RUST if CPU_LITTLE_ENDIAN
> + select HAVE_RUST
> select HAVE_STACKPROTECTOR
> select HAVE_SYSCALL_TRACEPOINTS
> select HAVE_KPROBES
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 4562a8173e90..4621f1e00e06 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -41,7 +41,11 @@ KBUILD_CFLAGS += -mgeneral-regs-only \
> KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
> KBUILD_AFLAGS += $(compat_vdso)
>
> +ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
> +KBUILD_RUSTFLAGS += --target aarch64_be-unknown-linux-gnu -C target-feature="-neon"
> +else
> KBUILD_RUSTFLAGS += --target aarch64-unknown-none -C target-feature="-neon"
> +endif
>
> KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
> KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
>
> and ran the following kunit command (it will run a few tests in a qemu
> emulated VM):
>
> ./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch arm64 --kconfig_add CONFIG_RUST=y --kconfig_add CONFIG_CPU_BIG_ENDIAN=y
>
> The kernel was built successfully, and all Rust related tests passed.
>
> Of course this doesn't mean a lot, we still need people with deep
> Rust compiler knowledge to confirm whether the support is completed or
> not. But I think if people want to do experiments, the tool is there.
For what it's worth, I have some experience with big endian Rust in
userspace, and it generally works without issues. I would expect that it
doesn't need any special support beyond setting the target architecture
properly.
Alice
next prev parent reply other threads:[~2023-10-21 12:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231020155056.3495121-1-Jamie.Cunliffe@arm.com>
[not found] ` <20231020155056.3495121-3-Jamie.Cunliffe@arm.com>
[not found] ` <3cc3b66d-7190-477c-af04-a5d06a0d50fe@lunn.ch>
2023-10-20 18:33 ` [PATCH v4 2/2] arm64: rust: Enable Rust support for AArch64 Boqun Feng
2023-10-20 18:47 ` Andrew Lunn
2023-10-21 12:50 ` Alice Ryhl [this message]
2023-10-21 13:41 ` Miguel Ojeda
2023-10-21 16:03 ` Andrew Lunn
2023-10-22 12:57 ` Miguel Ojeda
2023-10-24 0:57 ` Stephen Boyd
2023-10-25 23:55 ` Boqun Feng
2023-11-01 15:04 ` Linus Walleij
2023-10-24 14:17 Pratham Patel
2023-10-24 15:19 ` Miguel Ojeda
2023-10-25 2:01 ` Pratham Patel
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=7bd5d863-0cee-49ef-8d53-f41f8bc8a904@ryhl.io \
--to=alice@ryhl.io \
--cc=Jamie.Cunliffe@arm.com \
--cc=andrew@lunn.ch \
--cc=boqun.feng@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=lina@asahilina.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=steve.capper@arm.com \
--cc=will@kernel.org \
/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