From: Alistair Francis <alistair23@gmail.com>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
Alistair Francis <Alistair.Francis@wdc.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] RISC-V: Ignore the S and U letters when formatting ISA strings
Date: Wed, 14 Aug 2019 11:27:08 -0700 [thread overview]
Message-ID: <CAKmqyKMJr=4-2VKKd9cE6LLts_y0OnDjm3v0sosgaZ+achxpGQ@mail.gmail.com> (raw)
In-Reply-To: <20190813225307.5792-1-palmer@sifive.com>
On Tue, Aug 13, 2019 at 3:54 PM Palmer Dabbelt <palmer@sifive.com> wrote:
>
> The ISA strings we're providing from QEMU aren't actually legal RISC-V
> ISA strings, as both S and U cannot exist as single-letter extensions
> and must instead be multi-letter strings. We're still using the ISA
> strings inside QEMU to track the availiable extensions, so this patch
> just strips out the S and U extensions when formatting ISA strings.
>
> This boots Linux on top of 4.1-rc3, which no longer has the U extension
> in /proc/cpuinfo.
>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
It looks like you are using tabs in here, once they are removed:
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/cpu.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index f8d07bd20ad7..a67c54c738ba 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -501,7 +501,23 @@ char *riscv_isa_string(RISCVCPU *cpu)
> char *p = isa_str + snprintf(isa_str, maxlen, "rv%d", TARGET_LONG_BITS);
> for (i = 0; i < sizeof(riscv_exts); i++) {
> if (cpu->env.misa & RV(riscv_exts[i])) {
> - *p++ = qemu_tolower(riscv_exts[i]);
> + char lower = qemu_tolower(riscv_exts[i]);
> + switch (lower) {
> + case 's':
> + case 'u':
> + /*
> + * The 's' and 'u' letters shouldn't show up in ISA strings as
> + * they're not extensions, but they should show up in MISA.
> + * Since we use these letters interally as a pseudo ISA string
> + * to set MISA it's easier to just strip them out when
> + * formatting the ISA string.
> + */
> + break;
> +
> + default:
> + *p++ = lower;
> + break;
> + }
> }
> }
> *p = '\0';
> --
> 2.21.0
>
>
prev parent reply other threads:[~2019-08-14 18:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 22:53 [Qemu-devel] [PATCH v2] RISC-V: Ignore the S and U letters when formatting ISA strings Palmer Dabbelt
2019-08-13 23:09 ` no-reply
2019-08-14 18:27 ` Alistair Francis [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='CAKmqyKMJr=4-2VKKd9cE6LLts_y0OnDjm3v0sosgaZ+achxpGQ@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=Alistair.Francis@wdc.com \
--cc=palmer@sifive.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).