]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Fix target address to update badaddr
authorWeiwei Li <liweiwei@iscas.ac.cn>
Fri, 26 May 2023 07:21:18 +0000 (15:21 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 13 Jun 2023 07:32:32 +0000 (17:32 +1000)
commitbfc4f9e351e77c69fe21315815bc5db8ef7c22df
tree2023e53011434950733e70d878a6a45df45a0766
parent3bd87176eeb3dee494ccaac56d9f77160c87bb9f
target/riscv: Fix target address to update badaddr

Compute the target address before storing it into badaddr
when mis-aligned exception is triggered.
Use a target_pc temp to store the target address to avoid
the confusing operation that udpate target address into
cpu_pc before misalign check, then update it into badaddr
and restore cpu_pc to current pc if exception is triggered.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230526072124.298466-2-liweiwei@iscas.ac.cn>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/insn_trans/trans_rvi.c.inc
target/riscv/insn_trans/trans_rvzce.c.inc
target/riscv/translate.c