From: Andrew Jones <ajones@ventanamicro.com>
To: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: qemu-devel@nongnu.org,
Alistair Francis <alistair.francis@wdc.com>,
Bin Meng <bin.meng@windriver.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
qemu-riscv@nongnu.org
Subject: Re: [PATCH 1/2] target/riscv: fence.i: update decode pattern
Date: Fri, 12 Aug 2022 16:01:03 +0200 [thread overview]
Message-ID: <20220812140103.3lbh45oidiw2fhsf@kamzik> (raw)
In-Reply-To: <20220812131304.1674484-1-philipp.tomsich@vrull.eu>
Please use a cover-letter for multi-patch patch series.
On Fri, Aug 12, 2022 at 03:13:03PM +0200, Philipp Tomsich wrote:
> The RISC-V specification specifies imm12, rs1 and rd to be all-zeros,
> so we can't ignore these bits when decoding into fence.i.
>
> Update the decode pattern to reflect the specification.
I got hung-up on this for a bit since there isn't any "must-be-0" fields,
only ignored fields, but the next patch gives a clue which helped me make
sense of this. The encoding of these instructions with ignored fields set
to anything except zero gets into reserved instruction territory, and QEMU
may legally raise an illegal-instruction in that case, which this patch
will start doing. It'd be nice to have a bit more text in this commit
message to make that clear.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
> ---
>
> target/riscv/insn32.decode | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode
> index 014127d066..089128c3dc 100644
> --- a/target/riscv/insn32.decode
> +++ b/target/riscv/insn32.decode
> @@ -151,7 +151,7 @@ sra 0100000 ..... ..... 101 ..... 0110011 @r
> or 0000000 ..... ..... 110 ..... 0110011 @r
> and 0000000 ..... ..... 111 ..... 0110011 @r
> fence ---- pred:4 succ:4 ----- 000 ----- 0001111
> -fence_i ---- ---- ---- ----- 001 ----- 0001111
> +fence_i 000000000000 00000 001 00000 0001111
^ need two more spaces here to line up with fence.
> csrrw ............ ..... 001 ..... 1110011 @csr
> csrrs ............ ..... 010 ..... 1110011 @csr
> csrrc ............ ..... 011 ..... 1110011 @csr
> --
> 2.34.1
>
>
Thanks,
drew
next prev parent reply other threads:[~2022-08-12 14:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 13:13 [PATCH 1/2] target/riscv: fence.i: update decode pattern Philipp Tomsich
2022-08-12 13:13 ` [PATCH 2/2] target/riscv: fence: reconcile with specification Philipp Tomsich
2022-08-12 13:21 ` Peter Maydell
2022-08-12 14:17 ` Philipp Tomsich
2022-09-08 9:24 ` Alistair Francis
2022-09-08 9:28 ` Philipp Tomsich
2022-08-12 14:03 ` Andrew Jones
2022-08-12 14:01 ` Andrew Jones [this message]
2022-08-12 14:09 ` [PATCH 1/2] target/riscv: fence.i: update decode pattern Philipp Tomsich
2022-08-12 14:18 ` Peter Maydell
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=20220812140103.3lbh45oidiw2fhsf@kamzik \
--to=ajones@ventanamicro.com \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=palmer@dabbelt.com \
--cc=philipp.tomsich@vrull.eu \
--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).