On 3/12/25 20:45, Richard Henderson wrote:
> Semihosting is not enabled for user-only.
> Avoid the test for that case.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/xtensa/translate.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
> index 4f02cefde3..d13d05878e 100644
> --- a/target/xtensa/translate.c
> +++ b/target/xtensa/translate.c
> @@ -2241,13 +2241,16 @@ static uint32_t test_exceptions_simcall(DisasContext *dc,
> const OpcodeArg arg[],
> const uint32_t par[])
> {
> - bool is_semi = semihosting_enabled(dc->cring != 0);
> -#ifdef CONFIG_USER_ONLY
> - bool ill = true;
> -#else
> + bool ill = true, is_semi = false;
> +
> +#ifndef CONFIG_USER_ONLY
> /* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
> - bool ill = dc->config->hw_version <= 250002 && !is_semi;
> + ill = dc->config->hw_version <= 250002 && !is_semi;
> #endif
> +#ifdef CONFIG_SEMIHOSTING
> + is_semi = semihosting_enabled(dc->cring != 0);
> +#endif
> +
> if (ill || !is_semi) {
> qemu_log_mask(LOG_GUEST_ERROR, "SIMCALL but semihosting is disabled\n");
> }
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>