[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/10] hvf: arm: Mark CPU as dirty on reset
From: |
Roman Bolshakov |
Subject: |
Re: [PATCH v3 05/10] hvf: arm: Mark CPU as dirty on reset |
Date: |
Thu, 3 Dec 2020 04:52:18 +0300 |
On Wed, Dec 02, 2020 at 08:04:03PM +0100, Alexander Graf wrote:
> When clearing internal state of a CPU, we should also make sure that HVF
> knows about it and can push the new values down to vcpu state.
>
I'm sorry if I'm asking something dumb. But isn't
cpu_synchronize_all_post_reset() is supposed to push QEMU state into HVF
(or any other accel) after reset?
For x86 it used to work:
static void do_hvf_cpu_synchronize_post_reset(CPUState *cpu,
run_on_cpu_data arg)
{
hvf_put_registers(cpu);
cpu->vcpu_dirty = false;
}
Thanks,
Roman
> Make sure that with HVF enabled, we tell it that it should synchronize
> CPU state on next entry after a reset.
>
> This fixes PSCI handling, because now newly pushed state such as X0 and
> PC on remote CPU enablement also get pushed into HVF.
>
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> ---
> target/arm/arm-powerctl.c | 1 +
> target/arm/cpu.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
> index b75f813b40..a49a5b32e6 100644
> --- a/target/arm/arm-powerctl.c
> +++ b/target/arm/arm-powerctl.c
> @@ -15,6 +15,7 @@
> #include "arm-powerctl.h"
> #include "qemu/log.h"
> #include "qemu/main-loop.h"
> +#include "sysemu/hw_accel.h"
>
> #ifndef DEBUG_ARM_POWERCTL
> #define DEBUG_ARM_POWERCTL 0
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index db6f7c34ed..9a501ea4bd 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -411,6 +411,8 @@ static void arm_cpu_reset(DeviceState *dev)
> #ifndef CONFIG_USER_ONLY
> if (kvm_enabled()) {
> kvm_arm_reset_vcpu(cpu);
> + } else if (hvf_enabled()) {
> + s->vcpu_dirty = true;
> }
> #endif
>
> --
> 2.24.3 (Apple Git-128)
>
- [PATCH v3 00/10] hvf: Implement Apple Silicon Support, Alexander Graf, 2020/12/02
- [PATCH v3 01/10] hvf: Add hypervisor entitlement to output binaries, Alexander Graf, 2020/12/02
- [PATCH v3 02/10] hvf: Move common code out, Alexander Graf, 2020/12/02
- [PATCH v3 03/10] hvf: Introduce hvf vcpu struct, Alexander Graf, 2020/12/02
- [PATCH v3 04/10] arm: Set PSCI to 0.2 for HVF, Alexander Graf, 2020/12/02
- [PATCH v3 05/10] hvf: arm: Mark CPU as dirty on reset, Alexander Graf, 2020/12/02
- Re: [PATCH v3 05/10] hvf: arm: Mark CPU as dirty on reset,
Roman Bolshakov <=
[PATCH v3 08/10] arm/hvf: Add a WFI handler, Alexander Graf, 2020/12/02
[PATCH v3 07/10] arm: Add Hypervisor.framework build target, Alexander Graf, 2020/12/02
[PATCH v3 10/10] hvf: arm: Implement -cpu host, Alexander Graf, 2020/12/02