aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/genx2apic_uv_x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/genx2apic_uv_x.c')
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 711f11c30b06..1ef99be18488 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -18,6 +18,7 @@
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/bootmem.h> 19#include <linux/bootmem.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/hardirq.h>
21#include <asm/smp.h> 22#include <asm/smp.h>
22#include <asm/ipi.h> 23#include <asm/ipi.h>
23#include <asm/genapic.h> 24#include <asm/genapic.h>
@@ -134,9 +135,19 @@ static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask)
134 return BAD_APICID; 135 return BAD_APICID;
135} 136}
136 137
138static unsigned int uv_read_apic_id(void)
139{
140 unsigned int id;
141
142 WARN_ON(preemptible() && num_online_cpus() > 1);
143 id = apic_read(APIC_ID) | __get_cpu_var(x2apic_extra_bits);
144
145 return id;
146}
147
137static unsigned int phys_pkg_id(int index_msb) 148static unsigned int phys_pkg_id(int index_msb)
138{ 149{
139 return GET_APIC_ID(read_apic_id()) >> index_msb; 150 return uv_read_apic_id() >> index_msb;
140} 151}
141 152
142#ifdef ZZZ /* Needs x2apic patch */ 153#ifdef ZZZ /* Needs x2apic patch */
@@ -159,6 +170,7 @@ struct genapic apic_x2apic_uv_x = {
159 /* ZZZ.send_IPI_self = uv_send_IPI_self, */ 170 /* ZZZ.send_IPI_self = uv_send_IPI_self, */
160 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, 171 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid,
161 .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */ 172 .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */
173 .read_apic_id = uv_read_apic_id,
162}; 174};
163 175
164static __cpuinit void set_x2apic_extra_bits(int pnode) 176static __cpuinit void set_x2apic_extra_bits(int pnode)