From: Richard Henderson <richard.henderson@linaro.org>
To: Weiwei Li <liweiwei@iscas.ac.cn>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Cc: palmer@dabbelt.com, alistair.francis@wdc.com,
bin.meng@windriver.com, dbarboza@ventanamicro.com,
zhiwei_liu@linux.alibaba.com, wangjunqiang@iscas.ac.cn,
lazyparser@gmail.com
Subject: Re: [PATCH v2 2/2] target/riscv: Legalize MPP value in write_mstatus
Date: Thu, 6 Apr 2023 12:28:44 -0700 [thread overview]
Message-ID: <07e4dd2f-0eac-0415-be4d-bed9cfe2fbe8@linaro.org> (raw)
In-Reply-To: <20230406072555.21927-3-liweiwei@iscas.ac.cn>
On 4/6/23 00:25, Weiwei Li wrote:
> void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv)
> {
> - if (newpriv > PRV_M) {
> + if (newpriv > PRV_M || newpriv == PRV_H) {
> g_assert_not_reached();
> }
Nit: if (test) { assert_not_reached } -> assert(!test).
which emits a more helpful error message before abort.
r~
next prev parent reply other threads:[~2023-04-06 19:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 7:25 [PATCH v2 0/2] target/riscv: Fix mstatus.MPP related support Weiwei Li
2023-04-06 7:25 ` [PATCH v2 1/2] target/riscv: Fix the mstatus.MPP value after executing MRET Weiwei Li
2023-04-06 7:25 ` [PATCH v2 2/2] target/riscv: Legalize MPP value in write_mstatus Weiwei Li
2023-04-06 19:28 ` Richard Henderson [this message]
2023-04-07 1:16 ` liweiwei
2023-04-06 19:33 ` Richard Henderson
2023-04-07 1:24 ` liweiwei
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=07e4dd2f-0eac-0415-be4d-bed9cfe2fbe8@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=dbarboza@ventanamicro.com \
--cc=lazyparser@gmail.com \
--cc=liweiwei@iscas.ac.cn \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=wangjunqiang@iscas.ac.cn \
--cc=zhiwei_liu@linux.alibaba.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).