From: Philippe Mathieu-Daudé Date: Tue, 28 Oct 2025 05:42:05 +0000 (+0100) Subject: target/arm/hvf/hvf: Document $pc adjustment in HVF & SMC X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31e1b9823056f4d1d95b5a76029411954aaaf2af;p=thirdparty%2Fqemu.git target/arm/hvf/hvf: Document $pc adjustment in HVF & SMC Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index f31b6e54ee..805fe75e6b 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1936,6 +1936,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcpu_exit_exception_t *excp) case EC_AA64_HVC: cpu_synchronize_state(cpu); if (arm_is_psci_call(arm_cpu, EXCP_HVC)) { + /* Do NOT advance $pc for HVC */ if (!hvf_handle_psci_call(cpu)) { trace_hvf_unknown_hvc(env->pc, env->xregs[0]); /* SMCCC 1.3 section 5.2 says every unknown SMCCC call returns -1 */ @@ -1949,6 +1950,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcpu_exit_exception_t *excp) case EC_AA64_SMC: cpu_synchronize_state(cpu); if (arm_is_psci_call(arm_cpu, EXCP_SMC)) { + /* Secure Monitor Call exception, we need to advance $pc */ advance_pc = true; if (!hvf_handle_psci_call(cpu)) {