[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after r

From: Heyi Guo
Subject: Re: [Qemu-arm] [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop
Date: Wed, 13 Mar 2019 09:50:38 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

Hi Richard,

On 2019/3/12 22:59, Richard Henderson wrote:
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.
I don't quite understand. Do you mean the handler will be deactivated after one 
trigger? Or something else?

I suppose the state change handler will take effect for the whole VM life time, 
so I believed one handler for one VM is enough, in whichever vCPU 
initialization it is created. I also tested several times for one VM, and 
fortunately the rough code worked.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]