diff options
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r-- | arch/s390/kernel/setup.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 3b2efc81f34e..38e751278bf7 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/s390/kernel/setup.c | 2 | * arch/s390/kernel/setup.c |
3 | * | 3 | * |
4 | * S390 version | 4 | * S390 version |
5 | * Copyright (C) IBM Corp. 1999,2010 | 5 | * Copyright (C) IBM Corp. 1999,2012 |
6 | * Author(s): Hartmut Penner (hp@de.ibm.com), | 6 | * Author(s): Hartmut Penner (hp@de.ibm.com), |
7 | * Martin Schwidefsky (schwidefsky@de.ibm.com) | 7 | * Martin Schwidefsky (schwidefsky@de.ibm.com) |
8 | * | 8 | * |
@@ -62,6 +62,8 @@ | |||
62 | #include <asm/ebcdic.h> | 62 | #include <asm/ebcdic.h> |
63 | #include <asm/kvm_virtio.h> | 63 | #include <asm/kvm_virtio.h> |
64 | #include <asm/diag.h> | 64 | #include <asm/diag.h> |
65 | #include <asm/os_info.h> | ||
66 | #include "entry.h" | ||
65 | 67 | ||
66 | long psw_kernel_bits = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_ASC_PRIMARY | | 68 | long psw_kernel_bits = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_ASC_PRIMARY | |
67 | PSW_MASK_EA | PSW_MASK_BA; | 69 | PSW_MASK_EA | PSW_MASK_BA; |
@@ -351,8 +353,9 @@ static void setup_addressing_mode(void) | |||
351 | } | 353 | } |
352 | } | 354 | } |
353 | 355 | ||
354 | static void __init | 356 | void *restart_stack __attribute__((__section__(".data"))); |
355 | setup_lowcore(void) | 357 | |
358 | static void __init setup_lowcore(void) | ||
356 | { | 359 | { |
357 | struct _lowcore *lc; | 360 | struct _lowcore *lc; |
358 | 361 | ||
@@ -363,7 +366,7 @@ setup_lowcore(void) | |||
363 | lc = __alloc_bootmem_low(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0); | 366 | lc = __alloc_bootmem_low(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0); |
364 | lc->restart_psw.mask = psw_kernel_bits; | 367 | lc->restart_psw.mask = psw_kernel_bits; |
365 | lc->restart_psw.addr = | 368 | lc->restart_psw.addr = |
366 | PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; | 369 | PSW_ADDR_AMODE | (unsigned long) restart_int_handler; |
367 | lc->external_new_psw.mask = psw_kernel_bits | | 370 | lc->external_new_psw.mask = psw_kernel_bits | |
368 | PSW_MASK_DAT | PSW_MASK_MCHECK; | 371 | PSW_MASK_DAT | PSW_MASK_MCHECK; |
369 | lc->external_new_psw.addr = | 372 | lc->external_new_psw.addr = |
@@ -412,6 +415,24 @@ setup_lowcore(void) | |||
412 | lc->last_update_timer = S390_lowcore.last_update_timer; | 415 | lc->last_update_timer = S390_lowcore.last_update_timer; |
413 | lc->last_update_clock = S390_lowcore.last_update_clock; | 416 | lc->last_update_clock = S390_lowcore.last_update_clock; |
414 | lc->ftrace_func = S390_lowcore.ftrace_func; | 417 | lc->ftrace_func = S390_lowcore.ftrace_func; |
418 | |||
419 | restart_stack = __alloc_bootmem(ASYNC_SIZE, ASYNC_SIZE, 0); | ||
420 | restart_stack += ASYNC_SIZE; | ||
421 | |||
422 | /* | ||
423 | * Set up PSW restart to call ipl.c:do_restart(). Copy the relevant | ||
424 | * restart data to the absolute zero lowcore. This is necesary if | ||
425 | * PSW restart is done on an offline CPU that has lowcore zero. | ||
426 | */ | ||
427 | lc->restart_stack = (unsigned long) restart_stack; | ||
428 | lc->restart_fn = (unsigned long) do_restart; | ||
429 | lc->restart_data = 0; | ||
430 | lc->restart_source = -1UL; | ||
431 | memcpy(&S390_lowcore.restart_stack, &lc->restart_stack, | ||
432 | 4*sizeof(unsigned long)); | ||
433 | copy_to_absolute_zero(&S390_lowcore.restart_psw, | ||
434 | &lc->restart_psw, sizeof(psw_t)); | ||
435 | |||
415 | set_prefix((u32)(unsigned long) lc); | 436 | set_prefix((u32)(unsigned long) lc); |
416 | lowcore_ptr[0] = lc; | 437 | lowcore_ptr[0] = lc; |
417 | } | 438 | } |
@@ -572,27 +593,6 @@ static void __init setup_memory_end(void) | |||
572 | } | 593 | } |
573 | } | 594 | } |
574 | 595 | ||
575 | void *restart_stack __attribute__((__section__(".data"))); | ||
576 | |||
577 | /* | ||
578 | * Setup new PSW and allocate stack for PSW restart interrupt | ||
579 | */ | ||
580 | static void __init setup_restart_psw(void) | ||
581 | { | ||
582 | psw_t psw; | ||
583 | |||
584 | restart_stack = __alloc_bootmem(ASYNC_SIZE, ASYNC_SIZE, 0); | ||
585 | restart_stack += ASYNC_SIZE; | ||
586 | |||
587 | /* | ||
588 | * Setup restart PSW for absolute zero lowcore. This is necesary | ||
589 | * if PSW restart is done on an offline CPU that has lowcore zero | ||
590 | */ | ||
591 | psw.mask = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_EA | PSW_MASK_BA; | ||
592 | psw.addr = PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; | ||
593 | copy_to_absolute_zero(&S390_lowcore.restart_psw, &psw, sizeof(psw)); | ||
594 | } | ||
595 | |||
596 | static void __init setup_vmcoreinfo(void) | 596 | static void __init setup_vmcoreinfo(void) |
597 | { | 597 | { |
598 | #ifdef CONFIG_KEXEC | 598 | #ifdef CONFIG_KEXEC |
@@ -747,7 +747,7 @@ static void __init reserve_crashkernel(void) | |||
747 | { | 747 | { |
748 | #ifdef CONFIG_CRASH_DUMP | 748 | #ifdef CONFIG_CRASH_DUMP |
749 | unsigned long long crash_base, crash_size; | 749 | unsigned long long crash_base, crash_size; |
750 | char *msg; | 750 | char *msg = NULL; |
751 | int rc; | 751 | int rc; |
752 | 752 | ||
753 | rc = parse_crashkernel(boot_command_line, memory_end, &crash_size, | 753 | rc = parse_crashkernel(boot_command_line, memory_end, &crash_size, |
@@ -779,11 +779,11 @@ static void __init reserve_crashkernel(void) | |||
779 | pr_info("Reserving %lluMB of memory at %lluMB " | 779 | pr_info("Reserving %lluMB of memory at %lluMB " |
780 | "for crashkernel (System RAM: %luMB)\n", | 780 | "for crashkernel (System RAM: %luMB)\n", |
781 | crash_size >> 20, crash_base >> 20, memory_end >> 20); | 781 | crash_size >> 20, crash_base >> 20, memory_end >> 20); |
782 | os_info_crashkernel_add(crash_base, crash_size); | ||
782 | #endif | 783 | #endif |
783 | } | 784 | } |
784 | 785 | ||
785 | static void __init | 786 | static void __init setup_memory(void) |
786 | setup_memory(void) | ||
787 | { | 787 | { |
788 | unsigned long bootmap_size; | 788 | unsigned long bootmap_size; |
789 | unsigned long start_pfn, end_pfn; | 789 | unsigned long start_pfn, end_pfn; |
@@ -1014,8 +1014,7 @@ static void __init setup_hwcaps(void) | |||
1014 | * was printed. | 1014 | * was printed. |
1015 | */ | 1015 | */ |
1016 | 1016 | ||
1017 | void __init | 1017 | void __init setup_arch(char **cmdline_p) |
1018 | setup_arch(char **cmdline_p) | ||
1019 | { | 1018 | { |
1020 | /* | 1019 | /* |
1021 | * print what head.S has found out about the machine | 1020 | * print what head.S has found out about the machine |
@@ -1060,6 +1059,7 @@ setup_arch(char **cmdline_p) | |||
1060 | 1059 | ||
1061 | parse_early_param(); | 1060 | parse_early_param(); |
1062 | 1061 | ||
1062 | os_info_init(); | ||
1063 | setup_ipl(); | 1063 | setup_ipl(); |
1064 | setup_memory_end(); | 1064 | setup_memory_end(); |
1065 | setup_addressing_mode(); | 1065 | setup_addressing_mode(); |
@@ -1068,7 +1068,6 @@ setup_arch(char **cmdline_p) | |||
1068 | setup_memory(); | 1068 | setup_memory(); |
1069 | setup_resources(); | 1069 | setup_resources(); |
1070 | setup_vmcoreinfo(); | 1070 | setup_vmcoreinfo(); |
1071 | setup_restart_psw(); | ||
1072 | setup_lowcore(); | 1071 | setup_lowcore(); |
1073 | 1072 | ||
1074 | cpu_init(); | 1073 | cpu_init(); |