diff options
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r-- | arch/s390/kernel/setup.c | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 40b57693de38..afa9fdba200e 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -302,10 +302,10 @@ static int __init parse_vmalloc(char *arg) | |||
302 | } | 302 | } |
303 | early_param("vmalloc", parse_vmalloc); | 303 | early_param("vmalloc", parse_vmalloc); |
304 | 304 | ||
305 | unsigned int addressing_mode = HOME_SPACE_MODE; | 305 | unsigned int s390_user_mode = PRIMARY_SPACE_MODE; |
306 | EXPORT_SYMBOL_GPL(addressing_mode); | 306 | EXPORT_SYMBOL_GPL(s390_user_mode); |
307 | 307 | ||
308 | static int set_amode_primary(void) | 308 | static void __init set_user_mode_primary(void) |
309 | { | 309 | { |
310 | psw_kernel_bits = (psw_kernel_bits & ~PSW_MASK_ASC) | PSW_ASC_HOME; | 310 | psw_kernel_bits = (psw_kernel_bits & ~PSW_MASK_ASC) | PSW_ASC_HOME; |
311 | psw_user_bits = (psw_user_bits & ~PSW_MASK_ASC) | PSW_ASC_PRIMARY; | 311 | psw_user_bits = (psw_user_bits & ~PSW_MASK_ASC) | PSW_ASC_PRIMARY; |
@@ -313,48 +313,30 @@ static int set_amode_primary(void) | |||
313 | psw32_user_bits = | 313 | psw32_user_bits = |
314 | (psw32_user_bits & ~PSW32_MASK_ASC) | PSW32_ASC_PRIMARY; | 314 | (psw32_user_bits & ~PSW32_MASK_ASC) | PSW32_ASC_PRIMARY; |
315 | #endif | 315 | #endif |
316 | 316 | uaccess = MACHINE_HAS_MVCOS ? uaccess_mvcos_switch : uaccess_pt; | |
317 | if (MACHINE_HAS_MVCOS) { | ||
318 | memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess)); | ||
319 | return 1; | ||
320 | } else { | ||
321 | memcpy(&uaccess, &uaccess_pt, sizeof(uaccess)); | ||
322 | return 0; | ||
323 | } | ||
324 | } | ||
325 | |||
326 | /* | ||
327 | * Switch kernel/user addressing modes? | ||
328 | */ | ||
329 | static int __init early_parse_switch_amode(char *p) | ||
330 | { | ||
331 | addressing_mode = PRIMARY_SPACE_MODE; | ||
332 | return 0; | ||
333 | } | 317 | } |
334 | early_param("switch_amode", early_parse_switch_amode); | ||
335 | 318 | ||
336 | static int __init early_parse_user_mode(char *p) | 319 | static int __init early_parse_user_mode(char *p) |
337 | { | 320 | { |
338 | if (p && strcmp(p, "primary") == 0) | 321 | if (p && strcmp(p, "primary") == 0) |
339 | addressing_mode = PRIMARY_SPACE_MODE; | 322 | s390_user_mode = PRIMARY_SPACE_MODE; |
340 | else if (!p || strcmp(p, "home") == 0) | 323 | else if (!p || strcmp(p, "home") == 0) |
341 | addressing_mode = HOME_SPACE_MODE; | 324 | s390_user_mode = HOME_SPACE_MODE; |
342 | else | 325 | else |
343 | return 1; | 326 | return 1; |
344 | return 0; | 327 | return 0; |
345 | } | 328 | } |
346 | early_param("user_mode", early_parse_user_mode); | 329 | early_param("user_mode", early_parse_user_mode); |
347 | 330 | ||
348 | static void setup_addressing_mode(void) | 331 | static void __init setup_addressing_mode(void) |
349 | { | 332 | { |
350 | if (addressing_mode == PRIMARY_SPACE_MODE) { | 333 | if (s390_user_mode != PRIMARY_SPACE_MODE) |
351 | if (set_amode_primary()) | 334 | return; |
352 | pr_info("Address spaces switched, " | 335 | set_user_mode_primary(); |
353 | "mvcos available\n"); | 336 | if (MACHINE_HAS_MVCOS) |
354 | else | 337 | pr_info("Address spaces switched, mvcos available\n"); |
355 | pr_info("Address spaces switched, " | 338 | else |
356 | "mvcos not available\n"); | 339 | pr_info("Address spaces switched, mvcos not available\n"); |
357 | } | ||
358 | } | 340 | } |
359 | 341 | ||
360 | void *restart_stack __attribute__((__section__(".data"))); | 342 | void *restart_stack __attribute__((__section__(".data"))); |
@@ -602,9 +584,7 @@ static void __init setup_memory_end(void) | |||
602 | 584 | ||
603 | static void __init setup_vmcoreinfo(void) | 585 | static void __init setup_vmcoreinfo(void) |
604 | { | 586 | { |
605 | #ifdef CONFIG_KEXEC | ||
606 | mem_assign_absolute(S390_lowcore.vmcore_info, paddr_vmcoreinfo_note()); | 587 | mem_assign_absolute(S390_lowcore.vmcore_info, paddr_vmcoreinfo_note()); |
607 | #endif | ||
608 | } | 588 | } |
609 | 589 | ||
610 | #ifdef CONFIG_CRASH_DUMP | 590 | #ifdef CONFIG_CRASH_DUMP |
@@ -980,6 +960,12 @@ static void __init setup_hwcaps(void) | |||
980 | * HWCAP_S390_HIGH_GPRS is bit 9. | 960 | * HWCAP_S390_HIGH_GPRS is bit 9. |
981 | */ | 961 | */ |
982 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; | 962 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; |
963 | |||
964 | /* | ||
965 | * Transactional execution support HWCAP_S390_TE is bit 10. | ||
966 | */ | ||
967 | if (test_facility(50) && test_facility(73)) | ||
968 | elf_hwcap |= HWCAP_S390_TE; | ||
983 | #endif | 969 | #endif |
984 | 970 | ||
985 | get_cpu_id(&cpu_id); | 971 | get_cpu_id(&cpu_id); |