Hello,
Perhaps I need to drop this patch from this patch-set as it is ARM specific.
I pulled this from RFC V2 of Virtual CPU Hotplug Support on ARMv8 and is
not required by other architectures trying to implement Virtual CPU Hotplug
Support.

https://lore.kernel.org/qemu-devel/20230926103654.34424-2-salil.me...@huawei.com/

I will retain the Reviewed-by's collected here in the RFC V3 patch-set.

Sorry, for the noise.

Thanks
Salil.

> From: Salil Mehta <salil.me...@huawei.com>
> Sent: Monday, October 9, 2023 9:36 PM
> To: qemu-devel@nongnu.org; qemu-...@nongnu.org
> Cc: Salil Mehta <salil.me...@huawei.com>; m...@kernel.org; jean-
> phili...@linaro.org; Jonathan Cameron <jonathan.came...@huawei.com>;
> lpieral...@kernel.org; peter.mayd...@linaro.org;
> richard.hender...@linaro.org; imamm...@redhat.com; andrew.jo...@linux.dev;
> da...@redhat.com; phi...@linaro.org; eric.au...@redhat.com;
> oliver.up...@linux.dev; pbonz...@redhat.com; m...@redhat.com;
> w...@kernel.org; gs...@redhat.com; raf...@kernel.org;
> alex.ben...@linaro.org; li...@armlinux.org.uk;
> dar...@os.amperecomputing.com; il...@os.amperecomputing.com;
> vis...@os.amperecomputing.com; karl.heub...@oracle.com;
> miguel.l...@oracle.com; salil.me...@opnsrc.net; zhukeqian
> <zhukeqi...@huawei.com>; wangxiongfeng (C) <wangxiongfe...@huawei.com>;
> wangyanan (Y) <wangyana...@huawei.com>; jiakern...@gmail.com;
> maob...@loongson.cn; lixiang...@loongson.cn; Linuxarm <linux...@huawei.com>
> Subject: [PATCH V4 10/10] target/arm/kvm: Write CPU state back to KVM on
> reset
> 
> From: Jean-Philippe Brucker <jean-phili...@linaro.org>
> 
> When a KVM vCPU is reset following a PSCI CPU_ON call, its power state
> is not synchronized with KVM at the moment. Because the vCPU is not
> marked dirty, we miss the call to kvm_arch_put_registers() that writes
> to KVM's MP_STATE. Force mp_state synchronization.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-phili...@linaro.org>
> Signed-off-by: Salil Mehta <salil.me...@huawei.com>
> Reviewed-by: Alex Bennée <alex.ben...@linaro.org>
> Reviewed-by: Gavin Shan <gs...@redhat.com>
> ---
>  target/arm/kvm.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/target/arm/kvm.c b/target/arm/kvm.c
> index b66b936a95..8cb70b9e7c 100644
> --- a/target/arm/kvm.c
> +++ b/target/arm/kvm.c
> @@ -642,11 +642,12 @@ void kvm_arm_cpu_post_load(ARMCPU *cpu)
>  void kvm_arm_reset_vcpu(ARMCPU *cpu)
>  {
>      int ret;
> +    CPUState *cs = CPU(cpu);
> 
>      /* Re-init VCPU so that all registers are set to
>       * their respective reset values.
>       */
> -    ret = kvm_arm_vcpu_init(CPU(cpu));
> +    ret = kvm_arm_vcpu_init(cs);
>      if (ret < 0) {
>          fprintf(stderr, "kvm_arm_vcpu_init failed: %s\n", strerror(-ret));
>          abort();
> @@ -663,6 +664,11 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu)
>       * for the same reason we do so in kvm_arch_get_registers().
>       */
>      write_list_to_cpustate(cpu);
> +    /*
> +     * Ensure we call kvm_arch_put_registers(). The vCPU isn't marked
> dirty if
> +     * it was parked in KVM and is now booting from a PSCI CPU_ON call.
> +     */
> +    cs->vcpu_dirty = true;
>  }
> 
>  /*
> --
> 2.34.1

Reply via email to