aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2010-10-25 10:10:52 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-10-25 10:10:21 -0400
commit9186d7a9cfd75e51ac4db4a40e0a558371988bd2 (patch)
treedf0dcb04bd32105734ac736e9ceb1900065dd66a /arch
parent14375bc4eb8dd0fb0e765390650564c35bb31068 (diff)
[S390] topology: clean up facility detection
Move cpu topology facility detection to early setup code where it should be. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/setup.h3
-rw-r--r--arch/s390/kernel/early.c2
-rw-r--r--arch/s390/kernel/topology.c14
3 files changed, 10 insertions, 9 deletions
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 25e831d58e1e..d5e2ef10537d 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -73,6 +73,7 @@ extern unsigned int user_mode;
73#define MACHINE_FLAG_PFMF (1UL << 11) 73#define MACHINE_FLAG_PFMF (1UL << 11)
74#define MACHINE_FLAG_LPAR (1UL << 12) 74#define MACHINE_FLAG_LPAR (1UL << 12)
75#define MACHINE_FLAG_SPP (1UL << 13) 75#define MACHINE_FLAG_SPP (1UL << 13)
76#define MACHINE_FLAG_TOPOLOGY (1UL << 14)
76 77
77#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) 78#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
78#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) 79#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
@@ -90,6 +91,7 @@ extern unsigned int user_mode;
90#define MACHINE_HAS_HPAGE (0) 91#define MACHINE_HAS_HPAGE (0)
91#define MACHINE_HAS_PFMF (0) 92#define MACHINE_HAS_PFMF (0)
92#define MACHINE_HAS_SPP (0) 93#define MACHINE_HAS_SPP (0)
94#define MACHINE_HAS_TOPOLOGY (0)
93#else /* __s390x__ */ 95#else /* __s390x__ */
94#define MACHINE_HAS_IEEE (1) 96#define MACHINE_HAS_IEEE (1)
95#define MACHINE_HAS_CSP (1) 97#define MACHINE_HAS_CSP (1)
@@ -100,6 +102,7 @@ extern unsigned int user_mode;
100#define MACHINE_HAS_HPAGE (S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE) 102#define MACHINE_HAS_HPAGE (S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE)
101#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF) 103#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
102#define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP) 104#define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
105#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
103#endif /* __s390x__ */ 106#endif /* __s390x__ */
104 107
105#define ZFCPDUMP_HSA_SIZE (32UL<<20) 108#define ZFCPDUMP_HSA_SIZE (32UL<<20)
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index d2455d44d99a..d149609e46e6 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -382,6 +382,8 @@ static __init void detect_machine_facilities(void)
382 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; 382 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
383 if (test_facility(8)) 383 if (test_facility(8))
384 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF; 384 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
385 if (test_facility(11))
386 S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
385 if (test_facility(27)) 387 if (test_facility(27))
386 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; 388 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
387 if (test_facility(40)) 389 if (test_facility(40))
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 91fb66baa50b..69004411a93d 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -66,7 +66,6 @@ struct mask_info {
66static int topology_enabled = 1; 66static int topology_enabled = 1;
67static void topology_work_fn(struct work_struct *work); 67static void topology_work_fn(struct work_struct *work);
68static struct tl_info *tl_info; 68static struct tl_info *tl_info;
69static int machine_has_topology;
70static struct timer_list topology_timer; 69static struct timer_list topology_timer;
71static void set_topology_timer(void); 70static void set_topology_timer(void);
72static DECLARE_WORK(topology_work, topology_work_fn); 71static DECLARE_WORK(topology_work, topology_work_fn);
@@ -88,7 +87,7 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
88 cpumask_t mask; 87 cpumask_t mask;
89 88
90 cpus_clear(mask); 89 cpus_clear(mask);
91 if (!topology_enabled || !machine_has_topology) 90 if (!topology_enabled || !MACHINE_HAS_TOPOLOGY)
92 return cpu_possible_map; 91 return cpu_possible_map;
93 while (info) { 92 while (info) {
94 if (cpu_isset(cpu, info->mask)) { 93 if (cpu_isset(cpu, info->mask)) {
@@ -186,7 +185,6 @@ static void tl_to_cores(struct tl_info *info)
186 break; 185 break;
187 default: 186 default:
188 clear_masks(); 187 clear_masks();
189 machine_has_topology = 0;
190 goto out; 188 goto out;
191 } 189 }
192 tle = next_tle(tle); 190 tle = next_tle(tle);
@@ -223,7 +221,7 @@ int topology_set_cpu_management(int fc)
223 int cpu; 221 int cpu;
224 int rc; 222 int rc;
225 223
226 if (!machine_has_topology) 224 if (!MACHINE_HAS_TOPOLOGY)
227 return -EOPNOTSUPP; 225 return -EOPNOTSUPP;
228 if (fc) 226 if (fc)
229 rc = ptf(PTF_VERTICAL); 227 rc = ptf(PTF_VERTICAL);
@@ -269,7 +267,7 @@ int arch_update_cpu_topology(void)
269 struct sys_device *sysdev; 267 struct sys_device *sysdev;
270 int cpu; 268 int cpu;
271 269
272 if (!machine_has_topology) { 270 if (!MACHINE_HAS_TOPOLOGY) {
273 update_cpu_core_map(); 271 update_cpu_core_map();
274 topology_update_polarization_simple(); 272 topology_update_polarization_simple();
275 return 0; 273 return 0;
@@ -323,7 +321,7 @@ static int __init init_topology_update(void)
323 int rc; 321 int rc;
324 322
325 rc = 0; 323 rc = 0;
326 if (!machine_has_topology) { 324 if (!MACHINE_HAS_TOPOLOGY) {
327 topology_update_polarization_simple(); 325 topology_update_polarization_simple();
328 goto out; 326 goto out;
329 } 327 }
@@ -354,10 +352,8 @@ void __init s390_init_cpu_topology(void)
354 struct tl_info *info; 352 struct tl_info *info;
355 int i; 353 int i;
356 354
357 if (!test_facility(2) || !test_facility(11)) 355 if (!MACHINE_HAS_TOPOLOGY)
358 return; 356 return;
359 machine_has_topology = 1;
360
361 tl_info = alloc_bootmem_pages(PAGE_SIZE); 357 tl_info = alloc_bootmem_pages(PAGE_SIZE);
362 info = tl_info; 358 info = tl_info;
363 store_topology(info); 359 store_topology(info);