[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid
From: |
Alistair Francis |
Subject: |
Re: [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid |
Date: |
Mon, 16 Jan 2023 13:46:19 +1000 |
On Tue, Jan 10, 2023 at 1:28 AM Bin Meng <bmeng@tinylab.org> wrote:
>
> env->mhartid is currently casted to long before printed, which drops
> the high 32-bit for rv64 on 32-bit host. Use TARGET_FMT_lx instead.
>
> Signed-off-by: Bin Meng <bmeng@tinylab.org>
Thanks!
Applied to riscv-to-apply.next
Alistair
> ---
>
> target/riscv/cpu.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index cc75ca7667..a5ed6d3f63 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -660,9 +660,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error
> **errp)
> (env->priv_ver < isa_edata_arr[i].min_version)) {
> isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
> #ifndef CONFIG_USER_ONLY
> - warn_report("disabling %s extension for hart 0x%lx because "
> - "privilege spec version does not match",
> - isa_edata_arr[i].name, (unsigned long)env->mhartid);
> + warn_report("disabling %s extension for hart 0x" TARGET_FMT_lx
> + " because privilege spec version does not match",
> + isa_edata_arr[i].name, env->mhartid);
> #else
> warn_report("disabling %s extension because "
> "privilege spec version does not match",
> --
> 2.34.1
>
>