aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-30 07:38:40 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-04-30 07:38:45 -0400
commitd00aa4e7d0129983fc4389c85e15a066eb4e69a9 (patch)
tree424089981ed740aa2366e6c5956927e3855de33c /arch/s390/kernel
parentedf2209692769d3e461c0351553098bc017c2caf (diff)
[S390] Add topology_core_siblings to topology.h
This exposes the core siblings to user space via sysfs. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r--arch/s390/kernel/topology.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 12b39b3d9c38..0becefcf19b9 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -66,6 +66,8 @@ static struct timer_list topology_timer;
66static void set_topology_timer(void); 66static void set_topology_timer(void);
67static DECLARE_WORK(topology_work, topology_work_fn); 67static DECLARE_WORK(topology_work, topology_work_fn);
68 68
69cpumask_t cpu_core_map[NR_CPUS];
70
69cpumask_t cpu_coregroup_map(unsigned int cpu) 71cpumask_t cpu_coregroup_map(unsigned int cpu)
70{ 72{
71 struct core_info *core = &core_info; 73 struct core_info *core = &core_info;
@@ -199,6 +201,14 @@ int topology_set_cpu_management(int fc)
199 return rc; 201 return rc;
200} 202}
201 203
204static void update_cpu_core_map(void)
205{
206 int cpu;
207
208 for_each_present_cpu(cpu)
209 cpu_core_map[cpu] = cpu_coregroup_map(cpu);
210}
211
202void arch_update_cpu_topology(void) 212void arch_update_cpu_topology(void)
203{ 213{
204 struct tl_info *info = tl_info; 214 struct tl_info *info = tl_info;
@@ -206,11 +216,13 @@ void arch_update_cpu_topology(void)
206 int cpu; 216 int cpu;
207 217
208 if (!machine_has_topology) { 218 if (!machine_has_topology) {
219 update_cpu_core_map();
209 topology_update_polarization_simple(); 220 topology_update_polarization_simple();
210 return; 221 return;
211 } 222 }
212 stsi(info, 15, 1, 2); 223 stsi(info, 15, 1, 2);
213 tl_to_cores(info); 224 tl_to_cores(info);
225 update_cpu_core_map();
214 for_each_online_cpu(cpu) { 226 for_each_online_cpu(cpu) {
215 sysdev = get_cpu_sysdev(cpu); 227 sysdev = get_cpu_sysdev(cpu);
216 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); 228 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
@@ -251,20 +263,23 @@ static int __init init_topology_update(void)
251{ 263{
252 int rc; 264 int rc;
253 265
266 rc = 0;
254 if (!machine_has_topology) { 267 if (!machine_has_topology) {
255 topology_update_polarization_simple(); 268 topology_update_polarization_simple();
256 return 0; 269 goto out;
257 } 270 }
258 init_timer_deferrable(&topology_timer); 271 init_timer_deferrable(&topology_timer);
259 if (machine_has_topology_irq) { 272 if (machine_has_topology_irq) {
260 rc = register_external_interrupt(0x2005, topology_interrupt); 273 rc = register_external_interrupt(0x2005, topology_interrupt);
261 if (rc) 274 if (rc)
262 return rc; 275 goto out;
263 ctl_set_bit(0, 8); 276 ctl_set_bit(0, 8);
264 } 277 }
265 else 278 else
266 set_topology_timer(); 279 set_topology_timer();
267 return 0; 280out:
281 update_cpu_core_map();
282 return rc;
268} 283}
269__initcall(init_topology_update); 284__initcall(init_topology_update);
270 285