aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-09-11 04:28:45 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-11 04:29:48 -0400
commitd3135e0c40c9a13ad0c57783f2b9569c4c00bd26 (patch)
tree93ff9924ef63c4ef36d9c3dcd5499a57217a9bba /arch/s390/kernel/early.c
parent04a95f6df9d7753098729ef1464e38552627af9d (diff)
[S390] kernel: always keep machine flags in lowcore
Eleminate the local variable machine_flags and always change machine flags directly in the lowcore. This avoids confusion about when and why the two variables have to be synchronized. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 21f3799fe27c..734deeaa7361 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -35,8 +35,6 @@
35 35
36char kernel_nss_name[NSS_NAME_SIZE + 1]; 36char kernel_nss_name[NSS_NAME_SIZE + 1];
37 37
38static unsigned long machine_flags;
39
40static void __init setup_boot_command_line(void); 38static void __init setup_boot_command_line(void);
41 39
42/* 40/*
@@ -206,12 +204,9 @@ static noinline __init void detect_machine_type(void)
206 204
207 /* Running under KVM? If not we assume z/VM */ 205 /* Running under KVM? If not we assume z/VM */
208 if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3)) 206 if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3))
209 machine_flags |= MACHINE_FLAG_KVM; 207 S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
210 else 208 else
211 machine_flags |= MACHINE_FLAG_VM; 209 S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
212
213 /* Store machine flags for setting up lowcore early */
214 S390_lowcore.machine_flags = machine_flags;
215} 210}
216 211
217static __init void early_pgm_check_handler(void) 212static __init void early_pgm_check_handler(void)
@@ -246,7 +241,7 @@ static noinline __init void setup_hpage(void)
246 facilities = stfl(); 241 facilities = stfl();
247 if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29))) 242 if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29)))
248 return; 243 return;
249 machine_flags |= MACHINE_FLAG_HPAGE; 244 S390_lowcore.machine_flags |= MACHINE_FLAG_HPAGE;
250 __ctl_set_bit(0, 23); 245 __ctl_set_bit(0, 23);
251#endif 246#endif
252} 247}
@@ -264,7 +259,7 @@ static __init void detect_mvpg(void)
264 EX_TABLE(0b,1b) 259 EX_TABLE(0b,1b)
265 : "=d" (rc) : "0" (-EOPNOTSUPP), "a" (0) : "memory", "cc", "0"); 260 : "=d" (rc) : "0" (-EOPNOTSUPP), "a" (0) : "memory", "cc", "0");
266 if (!rc) 261 if (!rc)
267 machine_flags |= MACHINE_FLAG_MVPG; 262 S390_lowcore.machine_flags |= MACHINE_FLAG_MVPG;
268#endif 263#endif
269} 264}
270 265
@@ -280,7 +275,7 @@ static __init void detect_ieee(void)
280 EX_TABLE(0b,1b) 275 EX_TABLE(0b,1b)
281 : "=d" (rc), "=d" (tmp): "0" (-EOPNOTSUPP) : "cc"); 276 : "=d" (rc), "=d" (tmp): "0" (-EOPNOTSUPP) : "cc");
282 if (!rc) 277 if (!rc)
283 machine_flags |= MACHINE_FLAG_IEEE; 278 S390_lowcore.machine_flags |= MACHINE_FLAG_IEEE;
284#endif 279#endif
285} 280}
286 281
@@ -299,7 +294,7 @@ static __init void detect_csp(void)
299 EX_TABLE(0b,1b) 294 EX_TABLE(0b,1b)
300 : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc", "0", "1", "2"); 295 : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc", "0", "1", "2");
301 if (!rc) 296 if (!rc)
302 machine_flags |= MACHINE_FLAG_CSP; 297 S390_lowcore.machine_flags |= MACHINE_FLAG_CSP;
303#endif 298#endif
304} 299}
305 300
@@ -316,7 +311,7 @@ static __init void detect_diag9c(void)
316 EX_TABLE(0b,1b) 311 EX_TABLE(0b,1b)
317 : "=d" (rc) : "0" (-EOPNOTSUPP), "d" (cpu_address) : "cc"); 312 : "=d" (rc) : "0" (-EOPNOTSUPP), "d" (cpu_address) : "cc");
318 if (!rc) 313 if (!rc)
319 machine_flags |= MACHINE_FLAG_DIAG9C; 314 S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG9C;
320} 315}
321 316
322static __init void detect_diag44(void) 317static __init void detect_diag44(void)
@@ -331,7 +326,7 @@ static __init void detect_diag44(void)
331 EX_TABLE(0b,1b) 326 EX_TABLE(0b,1b)
332 : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc"); 327 : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc");
333 if (!rc) 328 if (!rc)
334 machine_flags |= MACHINE_FLAG_DIAG44; 329 S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG44;
335#endif 330#endif
336} 331}
337 332
@@ -342,11 +337,11 @@ static __init void detect_machine_facilities(void)
342 337
343 facilities = stfl(); 338 facilities = stfl();
344 if (facilities & (1 << 28)) 339 if (facilities & (1 << 28))
345 machine_flags |= MACHINE_FLAG_IDTE; 340 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
346 if (facilities & (1 << 23)) 341 if (facilities & (1 << 23))
347 machine_flags |= MACHINE_FLAG_PFMF; 342 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
348 if (facilities & (1 << 4)) 343 if (facilities & (1 << 4))
349 machine_flags |= MACHINE_FLAG_MVCOS; 344 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
350#endif 345#endif
351} 346}
352 347
@@ -428,7 +423,6 @@ void __init startup_init(void)
428 setup_hpage(); 423 setup_hpage();
429 sclp_facilities_detect(); 424 sclp_facilities_detect();
430 detect_memory_layout(memory_chunk); 425 detect_memory_layout(memory_chunk);
431 S390_lowcore.machine_flags = machine_flags;
432#ifdef CONFIG_DYNAMIC_FTRACE 426#ifdef CONFIG_DYNAMIC_FTRACE
433 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller; 427 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller;
434#endif 428#endif