Skip to content

Commit 8e77554

Browse files
Christoph HellwigKAGA-KOKO
authored andcommitted
x86/platform/uv: Simplify uv_send_IPI_one()
Merge two helpers only used by uv_send_IPI_one() into the main function. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Not-acked-by: Dimitri Sivanich <[email protected]> Cc: Russ Anderson <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8263b05 commit 8e77554

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

arch/x86/include/asm/uv/uv_hub.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -837,26 +837,6 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
837837
}
838838

839839
extern unsigned int uv_apicid_hibits;
840-
static unsigned long uv_hub_ipi_value(int apicid, int vector, int mode)
841-
{
842-
apicid |= uv_apicid_hibits;
843-
return (1UL << UVH_IPI_INT_SEND_SHFT) |
844-
((apicid) << UVH_IPI_INT_APIC_ID_SHFT) |
845-
(mode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
846-
(vector << UVH_IPI_INT_VECTOR_SHFT);
847-
}
848-
849-
static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
850-
{
851-
unsigned long val;
852-
unsigned long dmode = dest_Fixed;
853-
854-
if (vector == NMI_VECTOR)
855-
dmode = dest_NMI;
856-
857-
val = uv_hub_ipi_value(apicid, vector, dmode);
858-
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
859-
}
860840

861841
/*
862842
* Get the minimum revision number of the hub chips within the partition.

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,21 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
588588

589589
static void uv_send_IPI_one(int cpu, int vector)
590590
{
591-
unsigned long apicid;
592-
int pnode;
591+
unsigned long apicid = per_cpu(x86_cpu_to_apicid, cpu);
592+
int pnode = uv_apicid_to_pnode(apicid);
593+
unsigned long dmode, val;
594+
595+
if (vector == NMI_VECTOR)
596+
dmode = dest_NMI;
597+
else
598+
dmode = dest_Fixed;
593599

594-
apicid = per_cpu(x86_cpu_to_apicid, cpu);
595-
pnode = uv_apicid_to_pnode(apicid);
596-
uv_hub_send_ipi(pnode, apicid, vector);
600+
val = (1UL << UVH_IPI_INT_SEND_SHFT) |
601+
((apicid | uv_apicid_hibits) << UVH_IPI_INT_APIC_ID_SHFT) |
602+
(dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
603+
(vector << UVH_IPI_INT_VECTOR_SHFT);
604+
605+
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
597606
}
598607

599608
static void uv_send_IPI_mask(const struct cpumask *mask, int vector)

0 commit comments

Comments
 (0)