]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: do not call GETPC() in check_ret_from_m_mode()
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Mon, 14 Jul 2025 13:37:39 +0000 (10:37 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 30 Jul 2025 17:59:31 +0000 (20:59 +0300)
commit093997ee905531424d1b9ad5c653600ca1d7c7a5
tree5ec2ae4e0e88ecdaa83054aa648653da57732be9
parentd1baf44157e4fc52da104a8d25cc0e7ba15cf449
target/riscv: do not call GETPC() in check_ret_from_m_mode()

GETPC() should always be called from the top level helper, e.g. the
first helper that is called by the translation code. We stopped doing
that in commit 3157a553ec, and then we introduced problems when
unwinding the exceptions being thrown by helper_mret(), as reported by
[1].

Call GETPC() at the top level helper and pass the value along.

[1] https://gitlab.com/qemu-project/qemu/-/issues/3020

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Fixes: 3157a553ec ("target/riscv: Add Smrnmi mnret instruction")
Closes: https://gitlab.com/qemu-project/qemu/-/issues/3020
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250714133739.1248296-1-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 16aa7771afeac422dcf7be2833d5426da6b814fa)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/riscv/op_helper.c