From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Alistair Francis <Alistair.Francis@wdc.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Joelle van Dyne <j@getutm.app>,
qemu-riscv@nongnu.org
Subject: Re: [PATCH] tcg/riscv: Fix potential bug in clobbered call register set
Date: Mon, 27 Sep 2021 09:10:57 -0400 [thread overview]
Message-ID: <ad47668c-ff03-401c-bf68-15b91b56d4ce@linaro.org> (raw)
In-Reply-To: <ab6303d3-f009-a992-5b5a-3606b9db3a02@amsat.org>
On 9/27/21 1:36 AM, Philippe Mathieu-Daudé wrote:
>> There are not 64 registers, so this is incorrect.
>
> Currently there are 32 registers, but I was looking at this draft:
> https://five-embeddev.com/riscv-v-spec/draft/v-spec.html#_vector_registers
> "The vector extension adds 32 architectural vector registers, v0-v31
> to the base scalar RISC-V ISA."
> If this were to be implemented (and available on the host), wouldn't
> we have 64 registers?
Sure. But there are *lots* of changes required before that happens, and certainly you
shouldn't be assuming what the ABI is now.
> Eventually this line would be easier to review as:
>
> tcg_target_call_clobber_regs = MAKE_64BIT_MASK(0, TCG_TARGET_NB_REGS);
Would it? Or would it be eaier to review with
tcg_target_call_clobber_regs = 0;
followed by a set of each register that is call clobbered.
Why are you assuming that it's safer to list unknown registers as call-clobbered? IF
ANYTHING, it might be safer to assume that all new registers are caller saved.
But as a general principal, I also don't like register masks containing set bits outside
the range of the mask.
r~
prev parent reply other threads:[~2021-09-27 13:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 21:39 [PATCH] tcg/riscv: Fix potential bug in clobbered call register set Philippe Mathieu-Daudé
2021-09-26 23:06 ` Richard Henderson
2021-09-27 5:36 ` Philippe Mathieu-Daudé
2021-09-27 13:10 ` Richard Henderson [this message]
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=ad47668c-ff03-401c-bf68-15b91b56d4ce@linaro.org \
--to=richard.henderson@linaro.org \
--cc=Alistair.Francis@wdc.com \
--cc=f4bug@amsat.org \
--cc=j@getutm.app \
--cc=palmer@dabbelt.com \
--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;
as well as URLs for NNTP newsgroup(s).