> On 3 Sep 2025, at 14.34, Richard Henderson <richard.henderson@linaro.org> wrote:
>
> On 9/3/25 12:06, Philippe Mathieu-Daudé wrote:
>> Since hvf_wfi() calls hv_vcpu_get_sys_reg(), which
>> must run on a vCPU, it also must. Mention it.
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> target/arm/hvf/hvf.c | 1 +
>> 1 file changed, 1 insertion(+)
>> diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
>> index d87a41bcc53..05fc591b523 100644
>> --- a/target/arm/hvf/hvf.c
>> +++ b/target/arm/hvf/hvf.c
>> @@ -1836,6 +1836,7 @@ static void hvf_wait_for_ipi(CPUState *cpu, struct timespec *ts)
>> bql_lock();
>> }
>> +/* Must be called by the owning thread */
>> static void hvf_wfi(CPUState *cpu)
>> {
>> ARMCPU *arm_cpu = ARM_CPU(cpu);
>
> How can it not? Are all these separate patches and annotations helpful?
>
> r~
It's just part of Apple's API. It's documented here:
https://developer.apple.com/documentation/hypervisor/hv_vcpu_get_sys_reg(_:_:_:)?language=objc
If they are not called in the right CPU context, they'll return an
error. I find it helpful to have it annotated here.