aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 21:15:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 21:15:32 -0400
commitdb1417967959569599da2a4bd0ffb93b17ad795f (patch)
tree08751414d5f4a9e264af924154ed3543a8e573a9 /arch/s390/kernel/setup.c
parent48aab2f79dfc1357c48ce22ff5c989b52a590069 (diff)
parentc6da39f26cfe475704ec521723192e520e8f51b8 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 patches from Martin Schwidefsky: "The biggest patch is the rework of the smp code, something I wanted to do for some time. There are some patches for our various dump methods and one new thing: z/VM LGR detection. LGR stands for linux-guest- relocation and is the guest migration feature of z/VM. For debugging purposes we keep a log of the systems where a specific guest has lived." Fix up trivial conflict in arch/s390/kernel/smp.c due to the scheduler cleanup having removed some code next to removed s390 code. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: [S390] kernel: Pass correct stack for smp_call_ipl_cpu() [S390] Ensure that vmcore_info pointer is never accessed directly [S390] dasd: prevent validate server for offline devices [S390] Remove monolithic build option for zcrypt driver. [S390] stack dump: fix indentation in output [S390] kernel: Add OS info memory interface [S390] Use block_sigmask() [S390] kernel: Add z/VM LGR detection [S390] irq: external interrupt code passing [S390] irq: set __ARCH_IRQ_EXIT_IRQS_DISABLED [S390] zfcpdump: Implement async sdias event processing [S390] Use copy_to_absolute_zero() instead of "stura/sturg" [S390] rework idle code [S390] rework smp code [S390] rename lowcore field [S390] Fix gcc 4.6.0 compile warning
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 3b2efc81f34..38e751278bf 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
66long psw_kernel_bits = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_ASC_PRIMARY | 68long 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
354static void __init 356void *restart_stack __attribute__((__section__(".data")));
355setup_lowcore(void) 357
358static 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
575void *restart_stack __attribute__((__section__(".data")));
576
577/*
578 * Setup new PSW and allocate stack for PSW restart interrupt
579 */
580static 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
596static void __init setup_vmcoreinfo(void) 596static 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
785static void __init 786static void __init setup_memory(void)
786setup_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
1017void __init 1017void __init setup_arch(char **cmdline_p)
1018setup_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();