mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
KVM/arm/arm64/vgic-new: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Anna-Maria Gleixner <[email protected]> Cc: Andre Przywara <[email protected]> Cc: Christoffer Dall <[email protected]> Cc: Eric Auger <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Radim Krcmar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
31487f8328
commit
15d7e3d349
2 changed files with 10 additions and 22 deletions
|
|
@ -353,32 +353,19 @@ out:
|
|||
|
||||
/* GENERIC PROBE */
|
||||
|
||||
static void vgic_init_maintenance_interrupt(void *info)
|
||||
static int vgic_init_cpu_starting(unsigned int cpu)
|
||||
{
|
||||
enable_percpu_irq(kvm_vgic_global_state.maint_irq, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vgic_cpu_notify(struct notifier_block *self,
|
||||
unsigned long action, void *cpu)
|
||||
|
||||
static int vgic_init_cpu_dying(unsigned int cpu)
|
||||
{
|
||||
switch (action) {
|
||||
case CPU_STARTING:
|
||||
case CPU_STARTING_FROZEN:
|
||||
vgic_init_maintenance_interrupt(NULL);
|
||||
break;
|
||||
case CPU_DYING:
|
||||
case CPU_DYING_FROZEN:
|
||||
disable_percpu_irq(kvm_vgic_global_state.maint_irq);
|
||||
break;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
disable_percpu_irq(kvm_vgic_global_state.maint_irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct notifier_block vgic_cpu_nb = {
|
||||
.notifier_call = vgic_cpu_notify,
|
||||
};
|
||||
|
||||
static irqreturn_t vgic_maintenance_handler(int irq, void *data)
|
||||
{
|
||||
/*
|
||||
|
|
@ -434,14 +421,14 @@ int kvm_vgic_hyp_init(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = __register_cpu_notifier(&vgic_cpu_nb);
|
||||
ret = cpuhp_setup_state(CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
|
||||
"AP_KVM_ARM_VGIC_INIT_STARTING",
|
||||
vgic_init_cpu_starting, vgic_init_cpu_dying);
|
||||
if (ret) {
|
||||
kvm_err("Cannot register vgic CPU notifier\n");
|
||||
goto out_free_irq;
|
||||
}
|
||||
|
||||
on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);
|
||||
|
||||
kvm_info("vgic interrupt IRQ%d\n", kvm_vgic_global_state.maint_irq);
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue