From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Bin Meng" <bmeng@tinylab.org>,
"Alistair Francis" <Alistair.Francis@wdc.com>,
qemu-devel@nongnu.org, qemu-riscv@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid
Date: Mon, 9 Jan 2023 08:04:07 -0800 [thread overview]
Message-ID: <8d60f5b9-9fa9-2c21-d72e-609bfbaecf39@linaro.org> (raw)
In-Reply-To: <6e3de50d-38d9-b5ba-dac4-91352be8b96b@linaro.org>
On 1/9/23 07:47, Philippe Mathieu-Daudé wrote:
> On 9/1/23 16:26, Bin Meng 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.
>
> Oh, a 32-bit host user!
>
>> Signed-off-by: Bin Meng <bmeng@tinylab.org>
>> ---
>>
>> 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);
>
> Could we cast it to vaddr instead? I'm trying to remove target_[u]long
> from hw/ and restrict it to the target/ directory. Per "exec/cpu-common.h":
This isn't in hw/, it's in target/. And no, it's a target-width register.
r~
next prev parent reply other threads:[~2023-01-09 16:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 15:26 [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid Bin Meng
2023-01-09 15:47 ` Philippe Mathieu-Daudé
2023-01-09 15:53 ` Bin Meng
2023-01-09 16:04 ` Richard Henderson [this message]
2023-01-16 3:14 ` Alistair Francis
2023-01-16 3:46 ` Alistair Francis
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=8d60f5b9-9fa9-2c21-d72e-609bfbaecf39@linaro.org \
--to=richard.henderson@linaro.org \
--cc=Alistair.Francis@wdc.com \
--cc=alex.bennee@linaro.org \
--cc=bmeng@tinylab.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=thuth@redhat.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).