[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 01/21] hw/riscv: Use misa_mxl instead of misa_mxl_max
From: |
Andrew Jones |
Subject: |
Re: [PATCH v3 01/21] hw/riscv: Use misa_mxl instead of misa_mxl_max |
Date: |
Tue, 23 Jan 2024 09:20:18 +0100 |
On Mon, Jan 22, 2024 at 02:55:50PM +0000, Alex Bennée wrote:
> From: Akihiko Odaki <akihiko.odaki@daynix.com>
>
> The effective MXL value matters when booting.
I'd prefer this commit message get some elaboration. riscv_is_32bit()
is used in a variety of contexts, some where it should be reporting
the max misa.mxl. However, when used for booting an S-mode kernel it
should indeed report the effective mxl. I think we're fine with the
change, though, because at init and on reset the effective mxl is set
to the max mxl, so, in those contexts, where riscv_is_32bit() should
be reporting the max, it does.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Message-Id: <20240103173349.398526-23-alex.bennee@linaro.org>
> Message-Id: <20231213-riscv-v7-1-a760156a337f@daynix.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> hw/riscv/boot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
> index 0ffca05189f..bc67c0bd189 100644
> --- a/hw/riscv/boot.c
> +++ b/hw/riscv/boot.c
> @@ -36,7 +36,7 @@
>
> bool riscv_is_32bit(RISCVHartArrayState *harts)
> {
> - return harts->harts[0].env.misa_mxl_max == MXL_RV32;
> + return harts->harts[0].env.misa_mxl == MXL_RV32;
> }
Assuming everyone agrees with what I've written above, then maybe we
should write something similar in a comment above this function.
Thanks,
drew
[PATCH v3 04/21] target/riscv: Validate misa_mxl_max only once, Alex Bennée, 2024/01/22
[PATCH v3 06/21] target/ppc: Use GDBFeature for dynamic XML, Alex Bennée, 2024/01/22
[PATCH v3 05/21] target/arm: Use GDBFeature for dynamic XML, Alex Bennée, 2024/01/22
[PATCH v3 07/21] target/riscv: Use GDBFeature for dynamic XML, Alex Bennée, 2024/01/22
[PATCH v3 08/21] gdbstub: Use GDBFeature for gdb_register_coprocessor, Alex Bennée, 2024/01/22
[PATCH v3 11/21] gdbstub: Simplify XML lookup, Alex Bennée, 2024/01/22