aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apic_64.c5
-rw-r--r--arch/x86/kernel/genapic_64.c11
-rw-r--r--arch/x86/kernel/genapic_flat_64.c14
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c14
4 files changed, 31 insertions, 13 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 1e3d32e27c14..9dd4ee4735f5 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -1096,6 +1096,11 @@ void __cpuinit generic_processor_info(int apicid, int version)
1096 cpu_set(cpu, cpu_present_map); 1096 cpu_set(cpu, cpu_present_map);
1097} 1097}
1098 1098
1099int hard_smp_processor_id(void)
1100{
1101 return read_apic_id();
1102}
1103
1099/* 1104/*
1100 * Power management 1105 * Power management
1101 */ 1106 */
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index 1fa8be5bd217..7414871751a7 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -79,17 +79,6 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
79 return 0; 79 return 0;
80} 80}
81 81
82unsigned int read_apic_id(void)
83{
84 unsigned int id;
85
86 WARN_ON(preemptible() && num_online_cpus() > 1);
87 id = apic_read(APIC_ID);
88 if (uv_system_type >= UV_X2APIC)
89 id |= __get_cpu_var(x2apic_extra_bits);
90 return id;
91}
92
93enum uv_system_type get_uv_system_type(void) 82enum uv_system_type get_uv_system_type(void)
94{ 83{
95 return uv_system_type; 84 return uv_system_type;
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 1a9c68845ee8..400ed8df8b4e 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -15,9 +15,11 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/ctype.h> 16#include <linux/ctype.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/hardirq.h>
18#include <asm/smp.h> 19#include <asm/smp.h>
19#include <asm/ipi.h> 20#include <asm/ipi.h>
20#include <asm/genapic.h> 21#include <asm/genapic.h>
22#include <mach_apicdef.h>
21 23
22static cpumask_t flat_target_cpus(void) 24static cpumask_t flat_target_cpus(void)
23{ 25{
@@ -95,9 +97,17 @@ static void flat_send_IPI_all(int vector)
95 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); 97 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
96} 98}
97 99
100static unsigned int read_xapic_id(void)
101{
102 unsigned int id;
103
104 id = GET_XAPIC_ID(apic_read(APIC_ID));
105 return id;
106}
107
98static int flat_apic_id_registered(void) 108static int flat_apic_id_registered(void)
99{ 109{
100 return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map); 110 return physid_isset(read_xapic_id(), phys_cpu_present_map);
101} 111}
102 112
103static unsigned int flat_cpu_mask_to_apicid(cpumask_t cpumask) 113static unsigned int flat_cpu_mask_to_apicid(cpumask_t cpumask)
@@ -123,6 +133,7 @@ struct genapic apic_flat = {
123 .send_IPI_mask = flat_send_IPI_mask, 133 .send_IPI_mask = flat_send_IPI_mask,
124 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, 134 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
125 .phys_pkg_id = phys_pkg_id, 135 .phys_pkg_id = phys_pkg_id,
136 .read_apic_id = read_xapic_id,
126}; 137};
127 138
128/* 139/*
@@ -187,4 +198,5 @@ struct genapic apic_physflat = {
187 .send_IPI_mask = physflat_send_IPI_mask, 198 .send_IPI_mask = physflat_send_IPI_mask,
188 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, 199 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
189 .phys_pkg_id = phys_pkg_id, 200 .phys_pkg_id = phys_pkg_id,
201 .read_apic_id = read_xapic_id,
190}; 202};
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)