Skip to content

Commit bdda3b9

Browse files
committed
x86/apic: Move no_ipi_broadcast() out of 32bit
For the upcoming shorthand support for all APIC incarnations the command line option needs to be available for 64 bit as well. While at it, rename the control variable, make it static and mark it __ro_after_init. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent bd82dba commit bdda3b9

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed

arch/x86/kernel/apic/ipi.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@
55

66
#include "local.h"
77

8+
#ifdef CONFIG_SMP
9+
#ifdef CONFIG_HOTPLUG_CPU
10+
#define DEFAULT_SEND_IPI (1)
11+
#else
12+
#define DEFAULT_SEND_IPI (0)
13+
#endif
14+
15+
static int apic_ipi_shorthand_off __ro_after_init = DEFAULT_SEND_IPI;
16+
17+
static __init int apic_ipi_shorthand(char *str)
18+
{
19+
get_option(&str, &apic_ipi_shorthand_off);
20+
return 1;
21+
}
22+
__setup("no_ipi_broadcast=", apic_ipi_shorthand);
23+
24+
static int __init print_ipi_mode(void)
25+
{
26+
pr_info("IPI shorthand broadcast: %s\n",
27+
apic_ipi_shorthand_off ? "disabled" : "enabled");
28+
return 0;
29+
}
30+
late_initcall(print_ipi_mode);
31+
#endif
32+
833
static inline int __prepare_ICR2(unsigned int mask)
934
{
1035
return SET_APIC_DEST_FIELD(mask);
@@ -203,7 +228,7 @@ void default_send_IPI_allbutself(int vector)
203228
if (num_online_cpus() < 2)
204229
return;
205230

206-
if (no_broadcast || vector == NMI_VECTOR) {
231+
if (apic_ipi_shorthand_off || vector == NMI_VECTOR) {
207232
apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
208233
} else {
209234
__default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
@@ -212,7 +237,7 @@ void default_send_IPI_allbutself(int vector)
212237

213238
void default_send_IPI_all(int vector)
214239
{
215-
if (no_broadcast || vector == NMI_VECTOR) {
240+
if (apic_ipi_shorthand_off || vector == NMI_VECTOR) {
216241
apic->send_IPI_mask(cpu_online_mask, vector);
217242
} else {
218243
__default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);

arch/x86/kernel/apic/local.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ void default_send_IPI_single_phys(int cpu, int vector);
5151
void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector);
5252
void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask, int vector);
5353

54-
extern int no_broadcast;
55-
5654
#ifdef CONFIG_X86_32
5755
void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector);
5856
void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask, int vector);

arch/x86/kernel/apic/probe_32.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,6 @@
1515

1616
#include "local.h"
1717

18-
#ifdef CONFIG_HOTPLUG_CPU
19-
#define DEFAULT_SEND_IPI (1)
20-
#else
21-
#define DEFAULT_SEND_IPI (0)
22-
#endif
23-
24-
int no_broadcast = DEFAULT_SEND_IPI;
25-
26-
static __init int no_ipi_broadcast(char *str)
27-
{
28-
get_option(&str, &no_broadcast);
29-
pr_info("Using %s mode\n",
30-
no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
31-
return 1;
32-
}
33-
__setup("no_ipi_broadcast=", no_ipi_broadcast);
34-
35-
static int __init print_ipi_mode(void)
36-
{
37-
pr_info("Using IPI %s mode\n",
38-
no_broadcast ? "No-Shortcut" : "Shortcut");
39-
return 0;
40-
}
41-
late_initcall(print_ipi_mode);
42-
4318
static int default_x86_32_early_logical_apicid(int cpu)
4419
{
4520
return 1 << cpu;

0 commit comments

Comments
 (0)