From: Claudio Fontana <cfont...@suse.de> the exception code needs some adjustment before being exposed to KVM-only builds. We need to call arm_rebuild_hflags only when TCG is enabled, or we will error out.
The direct call to helper_rebuild_hflags_a64(env, new_el) will not be possible when extracting out to common code, it seems safe to replace it with a call to arm_rebuild_hflags, since the write to pstate is already done. Signed-off-by: Claudio Fontana <cfont...@suse.de> Signed-off-by: Fabiano Rosas <faro...@suse.de> --- target/arm/helper.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index bea1ef242a..a536d77611 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1131,7 +1131,9 @@ static void take_aarch32_exception(CPUARMState *env, int new_mode, env->regs[14] = env->regs[15] + offset; } env->regs[15] = newpc; - arm_rebuild_hflags(env); + if (tcg_enabled()) { + arm_rebuild_hflags(env); + } } static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs) @@ -1687,7 +1689,11 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs) pstate_write(env, PSTATE_DAIF | new_mode); env->aarch64 = true; aarch64_restore_sp(env, new_el); - helper_rebuild_hflags_a64(env, new_el); + + if (tcg_enabled()) { + /* pstate already written, so we can use arm_rebuild_hflags here */ + arm_rebuild_hflags(env); + } env->pc = addr; -- 2.35.3