On 3/12/19 12:57 AM, Heyi Guo wrote:
>  int kvm_arm_vcpu_init(CPUState *cs)
>  {
>      ARMCPU *cpu = ARM_CPU(cs);
>      struct kvm_vcpu_init init;
>  
> +    /*
> +     * Only add change state handler for arch timer once, for KVM will help 
> to
> +     * synchronize virtual timer of all VCPUs.
> +     */
> +    static bool arch_timer_change_state_handler_added;
> +
> +
> +    if (!arch_timer_change_state_handler_added) {
> +        qemu_add_vm_change_state_handler(arch_timer_change_state_handler, 
> cs);
> +        arch_timer_change_state_handler_added = true;
> +    }

Which means that this will not trigger for the second time that you pause the
vm.  You need to key this off of something else, like cpu id 0.


r~

Reply via email to