summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2019-07-22 21:47:23 +0300
committerThomas Gleixner <tglx@linutronix.de>2019-07-25 17:12:00 +0300
commit22ca7ee933a39f542ff6f81fc64f8036eff56519 (patch)
treeeb53bd053af83574b3c3f9424b8fe0385a1df4c2 /arch/x86/kernel/apic
parent6a1cb5f5c6413222b8532722562dd1edb5fdfd38 (diff)
downloadlinux-22ca7ee933a39f542ff6f81fc64f8036eff56519.tar.xz
x86/apic: Provide and use helper for send_IPI_allbutself()
To support IPI shorthands wrap invocations of apic->send_IPI_allbutself() in a helper function, so the static key controlling the shorthand mode is only in one place. Fixup all callers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20190722105220.492691679@linutronix.de
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/ipi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c
index 5bd8a001a887..f53de3e0145e 100644
--- a/arch/x86/kernel/apic/ipi.c
+++ b/arch/x86/kernel/apic/ipi.c
@@ -50,6 +50,18 @@ void apic_smt_update(void)
static_branch_enable(&apic_use_ipi_shorthand);
}
}
+
+void apic_send_IPI_allbutself(unsigned int vector)
+{
+ if (num_online_cpus() < 2)
+ return;
+
+ if (static_branch_likely(&apic_use_ipi_shorthand))
+ apic->send_IPI_allbutself(vector);
+ else
+ apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
#endif /* CONFIG_SMP */
static inline int __prepare_ICR2(unsigned int mask)