mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-02 06:51:53 -06:00
target/riscv: Set opcode to env->bins for illegal/virtual instruction fault
decode_save_opc() will not work for generate_exception(), since 0 is passed to riscv_raise_exception() as pc in helper_raise_exception(), and bins will not be restored in this case. Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20230330034636.44585-1-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
77dff6509c
commit
22c2f87ab2
1 changed files with 2 additions and 0 deletions
|
@ -20,6 +20,8 @@
|
||||||
static bool check_access(DisasContext *ctx)
|
static bool check_access(DisasContext *ctx)
|
||||||
{
|
{
|
||||||
if (!ctx->hlsx) {
|
if (!ctx->hlsx) {
|
||||||
|
tcg_gen_st_i32(tcg_constant_i32(ctx->opcode), cpu_env,
|
||||||
|
offsetof(CPURISCVState, bins));
|
||||||
if (ctx->virt_enabled) {
|
if (ctx->virt_enabled) {
|
||||||
generate_exception(ctx, RISCV_EXCP_VIRT_INSTRUCTION_FAULT);
|
generate_exception(ctx, RISCV_EXCP_VIRT_INSTRUCTION_FAULT);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue