Skip to content

Commit 2510d09

Browse files
committed
x86/apic/flat64: Remove the IPI shorthand decision logic
All callers of apic->send_IPI_all() and apic->send_IPI_allbutself() contain the decision logic for shorthand invocation already and invoke send_IPI_mask() if the prereqisites are not satisfied. Remove the now redundant decision logic in the APIC code and the duplicate helper in probe_64.c. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent dea9786 commit 2510d09

File tree

3 files changed

+6
-54
lines changed

3 files changed

+6
-54
lines changed

arch/x86/include/asm/apic.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,6 @@ static inline unsigned default_get_apic_id(unsigned long x)
468468
#define TRAMPOLINE_PHYS_LOW 0x467
469469
#define TRAMPOLINE_PHYS_HIGH 0x469
470470

471-
#ifdef CONFIG_X86_64
472-
extern void apic_send_IPI_self(int vector);
473-
#endif
474-
475471
extern void generic_bigsmp_probe(void);
476472

477473
#ifdef CONFIG_X86_LOCAL_APIC

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +76,6 @@ flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector)
7676
_flat_send_IPI_mask(mask, vector);
7777
}
7878

79-
static void flat_send_IPI_allbutself(int vector)
80-
{
81-
int cpu = smp_processor_id();
82-
83-
if (IS_ENABLED(CONFIG_HOTPLUG_CPU) || vector == NMI_VECTOR) {
84-
if (!cpumask_equal(cpu_online_mask, cpumask_of(cpu))) {
85-
unsigned long mask = cpumask_bits(cpu_online_mask)[0];
86-
87-
if (cpu < BITS_PER_LONG)
88-
__clear_bit(cpu, &mask);
89-
90-
_flat_send_IPI_mask(mask, vector);
91-
}
92-
} else if (num_online_cpus() > 1) {
93-
__default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
94-
}
95-
}
96-
97-
static void flat_send_IPI_all(int vector)
98-
{
99-
if (vector == NMI_VECTOR) {
100-
flat_send_IPI_mask(cpu_online_mask, vector);
101-
} else {
102-
__default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);
103-
}
104-
}
105-
10679
static unsigned int flat_get_apic_id(unsigned long x)
10780
{
10881
return (x >> 24) & 0xFF;
@@ -164,9 +137,9 @@ static struct apic apic_flat __ro_after_init = {
164137
.send_IPI = default_send_IPI_single,
165138
.send_IPI_mask = flat_send_IPI_mask,
166139
.send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself,
167-
.send_IPI_allbutself = flat_send_IPI_allbutself,
168-
.send_IPI_all = flat_send_IPI_all,
169-
.send_IPI_self = apic_send_IPI_self,
140+
.send_IPI_allbutself = default_send_IPI_allbutself,
141+
.send_IPI_all = default_send_IPI_all,
142+
.send_IPI_self = default_send_IPI_self,
170143

171144
.inquire_remote_apic = default_inquire_remote_apic,
172145

@@ -216,16 +189,6 @@ static void physflat_init_apic_ldr(void)
216189
*/
217190
}
218191

219-
static void physflat_send_IPI_allbutself(int vector)
220-
{
221-
default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
222-
}
223-
224-
static void physflat_send_IPI_all(int vector)
225-
{
226-
default_send_IPI_mask_sequence_phys(cpu_online_mask, vector);
227-
}
228-
229192
static int physflat_probe(void)
230193
{
231194
if (apic == &apic_physflat || num_possible_cpus() > 8 ||
@@ -267,9 +230,9 @@ static struct apic apic_physflat __ro_after_init = {
267230
.send_IPI = default_send_IPI_single_phys,
268231
.send_IPI_mask = default_send_IPI_mask_sequence_phys,
269232
.send_IPI_mask_allbutself = default_send_IPI_mask_allbutself_phys,
270-
.send_IPI_allbutself = physflat_send_IPI_allbutself,
271-
.send_IPI_all = physflat_send_IPI_all,
272-
.send_IPI_self = apic_send_IPI_self,
233+
.send_IPI_allbutself = default_send_IPI_allbutself,
234+
.send_IPI_all = default_send_IPI_all,
235+
.send_IPI_self = default_send_IPI_self,
273236

274237
.inquire_remote_apic = default_inquire_remote_apic,
275238

arch/x86/kernel/apic/probe_64.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ void __init default_setup_apic_routing(void)
3636
x86_platform.apic_post_init();
3737
}
3838

39-
/* Same for both flat and physical. */
40-
41-
void apic_send_IPI_self(int vector)
42-
{
43-
__default_send_IPI_shortcut(APIC_DEST_SELF, vector);
44-
}
45-
4639
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
4740
{
4841
struct apic **drv;

0 commit comments

Comments
 (0)