Skip to content

Commit

Permalink
x86/apic: Move IPI inlines into ipi.c
Browse files Browse the repository at this point in the history
No point in having them in an header file.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20190722105219.252225936@linutronix.de
  • Loading branch information
Thomas Gleixner committed Jul 25, 2019
1 parent cc8bf19 commit cdc86c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
19 changes: 0 additions & 19 deletions arch/x86/include/asm/ipi.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,8 @@ extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
extern void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
int vector);

/* Avoid include hell */
#define NMI_VECTOR 0x02

extern int no_broadcast;

static inline void __default_local_send_IPI_allbutself(int vector)
{
if (no_broadcast || vector == NMI_VECTOR)
apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
else
__default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical);
}

static inline void __default_local_send_IPI_all(int vector)
{
if (no_broadcast || vector == NMI_VECTOR)
apic->send_IPI_mask(cpu_online_mask, vector);
else
__default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical);
}

#ifdef CONFIG_X86_32
extern void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
int vector);
Expand Down
16 changes: 13 additions & 3 deletions arch/x86/kernel/apic/ipi.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,25 @@ void default_send_IPI_allbutself(int vector)
* if there are no other CPUs in the system then we get an APIC send
* error if we try to broadcast, thus avoid sending IPIs in this case.
*/
if (!(num_online_cpus() > 1))
if (num_online_cpus() < 2)
return;

__default_local_send_IPI_allbutself(vector);
if (no_broadcast || vector == NMI_VECTOR) {
apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
} else {
__default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector,
apic->dest_logical);
}
}

void default_send_IPI_all(int vector)
{
__default_local_send_IPI_all(vector);
if (no_broadcast || vector == NMI_VECTOR) {
apic->send_IPI_mask(cpu_online_mask, vector);
} else {
__default_send_IPI_shortcut(APIC_DEST_ALLINC, vector,
apic->dest_logical);
}
}

void default_send_IPI_self(int vector)
Expand Down

0 comments on commit cdc86c9

Please sign in to comment.