From: Thomas Huth <thuth@redhat.com>
To: Djordje Todorovic <Djordje.Todorovic@htecgroup.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>,
"cfu@mips.com" <cfu@mips.com>, "mst@redhat.com" <mst@redhat.com>,
"marcel.apfelbaum@gmail.com" <marcel.apfelbaum@gmail.com>,
"dbarboza@ventanamicro.com" <dbarboza@ventanamicro.com>,
"philmd@linaro.org" <philmd@linaro.org>,
"alistair23@gmail.com" <alistair23@gmail.com>
Subject: Re: [PATCH v5 1/7] target/riscv: Add big-endian CPU property
Date: Wed, 25 Mar 2026 11:47:40 +0100 [thread overview]
Message-ID: <93b00f05-0c59-4c53-bee6-0f0b874a7b28@redhat.com> (raw)
In-Reply-To: <20260324164007.549397-2-djordje.todorovic@htecgroup.com>
On 24/03/2026 17.40, Djordje Todorovic wrote:
> Add a "big-endian" boolean property to the RISC-V CPU configuration,
> defaulting to false (little-endian). This property allows machine
> models to configure individual HARTs for big-endian data operation.
>
> The RISC-V ISA supports big-endian data accesses via the mstatus
> SBE/MBE/UBE bits, while instructions remain always little-endian.
> This property provides the configuration interface; subsequent
> patches will connect it to the CPU state and translation logic.
>
> Signed-off-by: Djordje Todorovic <djordje.todorovic@htecgroup.com>
> ---
> target/riscv/cpu.c | 1 +
> target/riscv/cpu_cfg_fields.h.inc | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index e56470a374..4537305dfe 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -2641,6 +2641,7 @@ RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[] = {
>
> static const Property riscv_cpu_properties[] = {
> DEFINE_PROP_BOOL("debug", RISCVCPU, cfg.debug, true),
> + DEFINE_PROP_BOOL("big-endian", RISCVCPU, cfg.big_endian, false),
Note that there is also a DEFINE_PROP_ENDIAN available ... not sure whether
it's a better fit here, though. Maybe mention in the patch description why
BOOL is better than ENDIAN here?
Thomas
next prev parent reply other threads:[~2026-03-25 10:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 16:40 [PATCH v5 0/7] Add RISC-V big-endian target support Djordje Todorovic
2026-03-24 16:40 ` [PATCH v5 2/7] target/riscv: Set endianness MSTATUS bits at CPU reset Djordje Todorovic
2026-03-24 16:40 ` [PATCH v5 1/7] target/riscv: Add big-endian CPU property Djordje Todorovic
2026-03-25 7:26 ` Chao Liu
2026-03-25 10:47 ` Thomas Huth [this message]
2026-03-24 16:40 ` [PATCH v5 3/7] target/riscv: Implement runtime data endianness via MSTATUS bits Djordje Todorovic
2026-03-24 16:40 ` [PATCH v5 4/7] hw/riscv: Make boot code endianness-aware at runtime Djordje Todorovic
2026-03-24 16:40 ` [PATCH v5 5/7] target/riscv: Fix page table walk endianness for big-endian harts Djordje Todorovic
2026-03-24 16:40 ` [PATCH v5 7/7] target/riscv: Add test for RISC-V BE Djordje Todorovic
2026-03-25 10:51 ` Thomas Huth
2026-03-24 16:40 ` [PATCH v5 6/7] target/riscv: Support runtime endianness in virtio via sysemu callback Djordje Todorovic
2026-03-25 3:58 ` [PATCH v5 0/7] Add RISC-V big-endian target support Chao Liu
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=93b00f05-0c59-4c53-bee6-0f0b874a7b28@redhat.com \
--to=thuth@redhat.com \
--cc=Djordje.Todorovic@htecgroup.com \
--cc=alistair23@gmail.com \
--cc=cfu@mips.com \
--cc=dbarboza@ventanamicro.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.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