mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target/arm: ensure PSCI register updates are flushed
When we handle a host call we report state back to the caller via registers. Set vcpu_dirty to indicate QEMU is currently the reference and hoist the flush_cpu_state() and make the call unconditional. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3228 Tested-by: Christian Stussak <christian.stussak@imaginary.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20251209092459.1058313-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
@@ -1942,6 +1942,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcpu_exit_exception_t *excp)
|
||||
/* SMCCC 1.3 section 5.2 says every unknown SMCCC call returns -1 */
|
||||
env->xregs[0] = -1;
|
||||
}
|
||||
cpu->vcpu_dirty = true;
|
||||
} else {
|
||||
trace_hvf_unknown_hvc(env->pc, env->xregs[0]);
|
||||
hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1);
|
||||
@@ -1958,6 +1959,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcpu_exit_exception_t *excp)
|
||||
/* SMCCC 1.3 section 5.2 says every unknown SMCCC call returns -1 */
|
||||
env->xregs[0] = -1;
|
||||
}
|
||||
cpu->vcpu_dirty = true;
|
||||
} else {
|
||||
trace_hvf_unknown_smc(env->xregs[0]);
|
||||
hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1);
|
||||
@@ -1980,10 +1982,12 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcpu_exit_exception_t *excp)
|
||||
error_report("0x%llx: unhandled exception ec=0x%x", env->pc, ec);
|
||||
}
|
||||
|
||||
/* flush any changed cpu state back to HVF */
|
||||
flush_cpu_state(cpu);
|
||||
|
||||
if (advance_pc) {
|
||||
uint64_t pc;
|
||||
|
||||
flush_cpu_state(cpu);
|
||||
|
||||
r = hv_vcpu_get_reg(cpu->accel->fd, HV_REG_PC, &pc);
|
||||
assert_hvf_ok(r);
|
||||
|
||||
Reference in New Issue
Block a user