CPUHP_AP_MIPS_GIC_TIMER_STARTING,
CPUHP_AP_KVM_STARTING,
CPUHP_AP_KVM_ARM_VGIC_STARTING,
+ CPUHP_AP_KVM_ARM_TIMER_STARTING,
CPUHP_AP_LEDTRIG_STARTING,
CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE,
return (u64)-1;
}
-static int kvm_timer_cpu_notify(struct notifier_block *self,
- unsigned long action, void *cpu)
+static int kvm_timer_starting_cpu(unsigned int cpu)
{
- switch (action) {
- case CPU_STARTING:
- case CPU_STARTING_FROZEN:
- kvm_timer_init_interrupt(NULL);
- break;
- case CPU_DYING:
- case CPU_DYING_FROZEN:
- disable_percpu_irq(host_vtimer_irq);
- break;
- }
-
- return NOTIFY_OK;
+ kvm_timer_init_interrupt(NULL);
+ return 0;
}
-static struct notifier_block kvm_timer_cpu_nb = {
- .notifier_call = kvm_timer_cpu_notify,
-};
+static int kvm_timer_dying_cpu(unsigned int cpu)
+{
+ disable_percpu_irq(host_vtimer_irq);
+ return 0;
+}
int kvm_timer_hyp_init(void)
{
goto out;
}
- err = __register_cpu_notifier(&kvm_timer_cpu_nb);
- if (err) {
- kvm_err("Cannot register timer CPU notifier\n");
- goto out_free;
- }
-
wqueue = create_singlethread_workqueue("kvm_arch_timer");
if (!wqueue) {
err = -ENOMEM;
}
kvm_info("virtual timer IRQ%d\n", host_vtimer_irq);
- on_each_cpu(kvm_timer_init_interrupt, NULL, 1);
+ cpuhp_setup_state(CPUHP_AP_KVM_ARM_TIMER_STARTING,
+ "AP_KVM_ARM_TIMER_STARTING", kvm_timer_starting_cpu,
+ kvm_timer_dying_cpu);
goto out;
out_free:
free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus());