Skip to content

Commit 553f809

Browse files
ming1rafaeljw
authored andcommitted
arm, kvm: fix double lock on cpu_add_remove_lock
Commit 8146875 (arm, kvm: Fix CPU hotplug callback registration) holds the lock before calling the two functions: kvm_vgic_hyp_init() kvm_timer_hyp_init() and both the two functions are calling register_cpu_notifier() to register cpu notifier, so cause double lock on cpu_add_remove_lock. Considered that both two functions are only called inside kvm_arch_init() with holding cpu_add_remove_lock, so simply use __register_cpu_notifier() to fix the problem. Fixes: 8146875 (arm, kvm: Fix CPU hotplug callback registration) Signed-off-by: Ming Lei <tom.leiming@gmail.com> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 467a9e1 commit 553f809

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎virt/kvm/arm/arch_timer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ int kvm_timer_hyp_init(void)
277277

278278
host_vtimer_irq = ppi;
279279

280-
err = register_cpu_notifier(&kvm_timer_cpu_nb);
280+
err = __register_cpu_notifier(&kvm_timer_cpu_nb);
281281
if (err) {
282282
kvm_err("Cannot register timer CPU notifier\n");
283283
goto out_free;

‎virt/kvm/arm/vgic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ int kvm_vgic_hyp_init(void)
14961496
goto out;
14971497
}
14981498

1499-
ret = register_cpu_notifier(&vgic_cpu_nb);
1499+
ret = __register_cpu_notifier(&vgic_cpu_nb);
15001500
if (ret) {
15011501
kvm_err("Cannot register vgic CPU notifier\n");
15021502
goto out_free_irq;

0 commit comments

Comments
 (0)