Skip to content

Commit 43931d3

Browse files
committed
x86/apic/x2apic: Implement IPI shorthands support
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. Implement shorthand support for x2apic. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 2510d09 commit 43931d3

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

arch/x86/kernel/apic/local.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ unsigned int x2apic_get_apic_id(unsigned long id);
2323
u32 x2apic_set_apic_id(unsigned int id);
2424
int x2apic_phys_pkg_id(int initial_apicid, int index_msb);
2525
void x2apic_send_IPI_self(int vector);
26+
void __x2apic_send_IPI_shorthand(int vector, u32 which);
2627

2728
/* IPI */
2829

arch/x86/kernel/apic/x2apic_cluster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
8282

8383
static void x2apic_send_IPI_allbutself(int vector)
8484
{
85-
__x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLBUT);
85+
__x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLBUT);
8686
}
8787

8888
static void x2apic_send_IPI_all(int vector)
8989
{
90-
__x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC);
90+
__x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLINC);
9191
}
9292

9393
static u32 x2apic_calc_apicid(unsigned int cpu)

arch/x86/kernel/apic/x2apic_phys.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ static void
7575

7676
static void x2apic_send_IPI_allbutself(int vector)
7777
{
78-
__x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLBUT);
78+
__x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLBUT);
7979
}
8080

8181
static void x2apic_send_IPI_all(int vector)
8282
{
83-
__x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC);
83+
__x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLINC);
8484
}
8585

8686
static void init_x2apic_ldr(void)
@@ -112,6 +112,14 @@ void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
112112
native_x2apic_icr_write(cfg, apicid);
113113
}
114114

115+
void __x2apic_send_IPI_shorthand(int vector, u32 which)
116+
{
117+
unsigned long cfg = __prepare_ICR(which, vector, 0);
118+
119+
x2apic_wrmsr_fence();
120+
native_x2apic_icr_write(cfg, 0);
121+
}
122+
115123
unsigned int x2apic_get_apic_id(unsigned long id)
116124
{
117125
return id;

0 commit comments

Comments
 (0)