[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 05/10] arm/hvf: Add a WFI handler
From: |
Alexander Graf |
Subject: |
Re: [PATCH v11 05/10] arm/hvf: Add a WFI handler |
Date: |
Thu, 16 Sep 2021 17:02:39 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 16.09.21 06:49, Philippe Mathieu-Daudé wrote:
> On 9/15/21 8:10 PM, Alexander Graf wrote:
>> From: Peter Collingbourne <pcc@google.com>
>>
>> Sleep on WFI until the VTIMER is due but allow ourselves to be woken
>> up on IPI.
>>
>> In this implementation IPI is blocked on the CPU thread at startup and
>> pselect() is used to atomically unblock the signal and begin sleeping.
>> The signal is sent unconditionally so there's no need to worry about
>> races between actually sleeping and the "we think we're sleeping"
>> state. It may lead to an extra wakeup but that's better than missing
>> it entirely.
>>
>> Signed-off-by: Peter Collingbourne <pcc@google.com>
>> [agraf: Remove unused 'set' variable, always advance PC on WFX trap,
>> support vm stop / continue operations and cntv offsets]
>> Signed-off-by: Alexander Graf <agraf@csgraf.de>
>> Acked-by: Roman Bolshakov <r.bolshakov@yadro.com>
>> Reviewed-by: Sergio Lopez <slp@redhat.com>
>>
>> ---
>> diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
>> index 8fe008dab5..49f265cc08 100644
>> --- a/target/arm/hvf/hvf.c
>> +++ b/target/arm/hvf/hvf.c
>> @@ -2,6 +2,7 @@
>> * QEMU Hypervisor.framework support for Apple Silicon
>>
>> * Copyright 2020 Alexander Graf <agraf@csgraf.de>
>> + * Copyright 2020 Google LLC
>> *
>> * This work is licensed under the terms of the GNU GPL, version 2 or later.
>> * See the COPYING file in the top-level directory.
>> @@ -490,6 +491,7 @@ int hvf_arch_init_vcpu(CPUState *cpu)
>>
>> void hvf_kick_vcpu_thread(CPUState *cpu)
>> {
>> + cpus_kick_thread(cpu);
> Doesn't this belong to the previous patch?
Until this patch, we're never running outside guest context on the vCPU
thread, so hv_vcpus_exit() is enough to kick us out :).
Thanks a lot for the review!
Alex
- [PATCH v11 01/10] arm: Move PMC register definitions to cpu.h, (continued)
- [PATCH v11 05/10] arm/hvf: Add a WFI handler, Alexander Graf, 2021/09/15
- [PATCH v11 06/10] hvf: arm: Implement -cpu host, Alexander Graf, 2021/09/15
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Peter Maydell, 2021/09/16
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Alexander Graf, 2021/09/16
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Peter Maydell, 2021/09/16
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Ard Biesheuvel, 2021/09/16
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Peter Maydell, 2021/09/16
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Ard Biesheuvel, 2021/09/22
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Peter Maydell, 2021/09/22
- Re: [PATCH v11 06/10] hvf: arm: Implement -cpu host, Ard Biesheuvel, 2021/09/22