]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/s390/kernel/early.c
Merge tag 'reset-fixes-for-4.14' of git://git.pengutronix.de/git/pza/linux into fixes
[mirror_ubuntu-bionic-kernel.git] / arch / s390 / kernel / early.c
CommitLineData
ab14de6c 1/*
155af2f9 2 * Copyright IBM Corp. 2007, 2009
ab14de6c
HC
3 * Author(s): Hongjie Yang <hongjie@us.ibm.com>,
4 * Heiko Carstens <heiko.carstens@de.ibm.com>
5 */
6
11af97e1
HB
7#define KMSG_COMPONENT "setup"
8#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
9
92e6ecf3 10#include <linux/compiler.h>
ab14de6c
HC
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/string.h>
14#include <linux/ctype.h>
15#include <linux/lockdep.h>
dcc096c5 16#include <linux/extable.h>
ab14de6c
HC
17#include <linux/pfn.h>
18#include <linux/uaccess.h>
11af97e1 19#include <linux/kernel.h>
1ec2772e 20#include <asm/diag.h>
a0443fbb 21#include <asm/ebcdic.h>
46b05d26 22#include <asm/ipl.h>
ab14de6c
HC
23#include <asm/lowcore.h>
24#include <asm/processor.h>
25#include <asm/sections.h>
26#include <asm/setup.h>
92e6ecf3 27#include <asm/sysinfo.h>
ab14de6c
HC
28#include <asm/cpcmd.h>
29#include <asm/sclp.h>
a0616cde 30#include <asm/facility.h>
a806170e 31#include "entry.h"
ab14de6c
HC
32
33/*
34 * Create a Kernel NSS if the SAVESYS= parameter is defined
35 */
a0443fbb 36#define DEFSYS_CMD_SIZE 128
ab14de6c
HC
37#define SAVESYS_CMD_SIZE 32
38
ab14de6c
HC
39char kernel_nss_name[NSS_NAME_SIZE + 1];
40
a0443fbb
HB
41static void __init setup_boot_command_line(void);
42
b6112ccb
MS
43/*
44 * Get the TOD clock running.
45 */
46static void __init reset_tod_clock(void)
47{
48 u64 time;
49
1aae0560 50 if (store_tod_clock(&time) == 0)
b6112ccb
MS
51 return;
52 /* TOD clock not running. Set the clock to Unix Epoch. */
1aae0560 53 if (set_tod_clock(TOD_UNIX_EPOCH) != 0 || store_tod_clock(&time) != 0)
b6112ccb
MS
54 disabled_wait(0);
55
6e2ef5e4
MS
56 memset(tod_clock_base, 0, 16);
57 *(__u64 *) &tod_clock_base[1] = TOD_UNIX_EPOCH;
58 S390_lowcore.last_update_clock = TOD_UNIX_EPOCH;
b6112ccb 59}
a0443fbb 60
ab14de6c 61#ifdef CONFIG_SHARED_KERNEL
a0443fbb
HB
62int __init savesys_ipl_nss(char *cmd, const int cmdlen);
63
64asm(
65 " .section .init.text,\"ax\",@progbits\n"
66 " .align 4\n"
67 " .type savesys_ipl_nss, @function\n"
68 "savesys_ipl_nss:\n"
a0443fbb
HB
69 " stmg 6,15,48(15)\n"
70 " lgr 14,3\n"
71 " sam31\n"
72 " diag 2,14,0x8\n"
73 " sam64\n"
74 " lgr 2,14\n"
75 " lmg 6,15,48(15)\n"
a0443fbb 76 " br 14\n"
18764463
HC
77 " .size savesys_ipl_nss, .-savesys_ipl_nss\n"
78 " .previous\n");
a0443fbb 79
684d2fd4
HB
80static __initdata char upper_command_line[COMMAND_LINE_SIZE];
81
ab14de6c
HC
82static noinline __init void create_kernel_nss(void)
83{
84 unsigned int i, stext_pfn, eshared_pfn, end_pfn, min_size;
85#ifdef CONFIG_BLK_DEV_INITRD
86 unsigned int sinitrd_pfn, einitrd_pfn;
87#endif
88 int response;
69ac43b0 89 int hlen;
a0443fbb 90 size_t len;
ab14de6c 91 char *savesys_ptr;
ab14de6c
HC
92 char defsys_cmd[DEFSYS_CMD_SIZE];
93 char savesys_cmd[SAVESYS_CMD_SIZE];
94
95 /* Do nothing if we are not running under VM */
96 if (!MACHINE_IS_VM)
97 return;
98
99 /* Convert COMMAND_LINE to upper case */
a0443fbb
HB
100 for (i = 0; i < strlen(boot_command_line); i++)
101 upper_command_line[i] = toupper(boot_command_line[i]);
ab14de6c
HC
102
103 savesys_ptr = strstr(upper_command_line, "SAVESYS=");
104
105 if (!savesys_ptr)
106 return;
107
108 savesys_ptr += 8; /* Point to the beginning of the NSS name */
109 for (i = 0; i < NSS_NAME_SIZE; i++) {
110 if (savesys_ptr[i] == ' ' || savesys_ptr[i] == '\0')
111 break;
112 kernel_nss_name[i] = savesys_ptr[i];
113 }
114
115 stext_pfn = PFN_DOWN(__pa(&_stext));
116 eshared_pfn = PFN_DOWN(__pa(&_eshared));
117 end_pfn = PFN_UP(__pa(&_end));
118 min_size = end_pfn << 2;
119
69ac43b0
CL
120 hlen = snprintf(defsys_cmd, DEFSYS_CMD_SIZE,
121 "DEFSYS %s 00000-%.5X EW %.5X-%.5X SR %.5X-%.5X",
122 kernel_nss_name, stext_pfn - 1, stext_pfn,
123 eshared_pfn - 1, eshared_pfn, end_pfn);
ab14de6c
HC
124
125#ifdef CONFIG_BLK_DEV_INITRD
126 if (INITRD_START && INITRD_SIZE) {
127 sinitrd_pfn = PFN_DOWN(__pa(INITRD_START));
128 einitrd_pfn = PFN_UP(__pa(INITRD_START + INITRD_SIZE));
129 min_size = einitrd_pfn << 2;
69ac43b0
CL
130 hlen += snprintf(defsys_cmd + hlen, DEFSYS_CMD_SIZE - hlen,
131 " EW %.5X-%.5X", sinitrd_pfn, einitrd_pfn);
ab14de6c
HC
132 }
133#endif
134
69ac43b0
CL
135 snprintf(defsys_cmd + hlen, DEFSYS_CMD_SIZE - hlen,
136 " EW MINSIZE=%.7iK PARMREGS=0-13", min_size);
137 defsys_cmd[DEFSYS_CMD_SIZE - 1] = '\0';
894e491e
HC
138 snprintf(savesys_cmd, SAVESYS_CMD_SIZE, "SAVESYS %s \n IPL %s",
139 kernel_nss_name, kernel_nss_name);
140 savesys_cmd[SAVESYS_CMD_SIZE - 1] = '\0';
ab14de6c
HC
141
142 __cpcmd(defsys_cmd, NULL, 0, &response);
143
583b33bc 144 if (response != 0) {
11af97e1
HB
145 pr_err("Defining the Linux kernel NSS failed with rc=%d\n",
146 response);
583b33bc 147 kernel_nss_name[0] = '\0';
ab14de6c 148 return;
583b33bc 149 }
ab14de6c 150
a0443fbb
HB
151 len = strlen(savesys_cmd);
152 ASCEBC(savesys_cmd, len);
153 response = savesys_ipl_nss(savesys_cmd, len);
ab14de6c 154
a0443fbb
HB
155 /* On success: response is equal to the command size,
156 * max SAVESYS_CMD_SIZE
157 * On error: response contains the numeric portion of cp error message.
158 * for SAVESYS it will be >= 263
11af97e1 159 * for missing privilege class, it will be 1
a0443fbb 160 */
11af97e1
HB
161 if (response > SAVESYS_CMD_SIZE || response == 1) {
162 pr_err("Saving the Linux kernel NSS failed with rc=%d\n",
163 response);
583b33bc 164 kernel_nss_name[0] = '\0';
ab14de6c 165 return;
583b33bc 166 }
ab14de6c 167
b89031e0 168 /* re-initialize cputime accounting. */
6e2ef5e4
MS
169 get_tod_clock_ext(tod_clock_base);
170 S390_lowcore.last_update_clock = *(__u64 *) &tod_clock_base[1];
b89031e0
MS
171 S390_lowcore.last_update_timer = 0x7fffffffffffffffULL;
172 S390_lowcore.user_timer = 0;
173 S390_lowcore.system_timer = 0;
174 asm volatile("SPT 0(%0)" : : "a" (&S390_lowcore.last_update_timer));
175
a0443fbb
HB
176 /* re-setup boot command line with new ipl vm parms */
177 ipl_update_parameters();
178 setup_boot_command_line();
179
ab14de6c
HC
180 ipl_flags = IPL_NSS_VALID;
181}
182
183#else /* CONFIG_SHARED_KERNEL */
184
185static inline void create_kernel_nss(void) { }
186
187#endif /* CONFIG_SHARED_KERNEL */
188
189/*
190 * Clear bss memory
191 */
192static noinline __init void clear_bss_section(void)
193{
229d9c6d 194 memset(__bss_start, 0, __bss_stop - __bss_start);
ab14de6c
HC
195}
196
197/*
198 * Initialize storage key for kernel pages
199 */
200static noinline __init void init_kernel_storage_key(void)
201{
127c1fef 202#if PAGE_DEFAULT_KEY
ab14de6c
HC
203 unsigned long end_pfn, init_pfn;
204
205 end_pfn = PFN_UP(__pa(&_end));
206
207 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
e2b8d7af
MS
208 page_set_storage_key(init_pfn << PAGE_SHIFT,
209 PAGE_DEFAULT_KEY, 0);
127c1fef 210#endif
ab14de6c
HC
211}
212
fade4dc4 213static __initdata char sysinfo_page[PAGE_SIZE] __aligned(PAGE_SIZE);
92e6ecf3 214
ab14de6c
HC
215static noinline __init void detect_machine_type(void)
216{
fade4dc4
HC
217 struct sysinfo_3_2_2 *vmms = (struct sysinfo_3_2_2 *)&sysinfo_page;
218
27d71602 219 /* Check current-configuration-level */
caf757c6 220 if (stsi(NULL, 0, 0, 0) <= 2) {
27d71602 221 S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
92e6ecf3 222 return;
27d71602
MS
223 }
224 /* Get virtual-machine cpu information. */
caf757c6 225 if (stsi(vmms, 3, 2, 2) || !vmms->count)
92e6ecf3 226 return;
ab14de6c 227
92e6ecf3 228 /* Running under KVM? If not we assume z/VM */
fade4dc4 229 if (!memcmp(vmms->vm[0].cpi, "\xd2\xe5\xd4", 3))
d3135e0c 230 S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
92e6ecf3 231 else
d3135e0c 232 S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
ab14de6c
HC
233}
234
d2f03974
HC
235/* Remove leading, trailing and double whitespace. */
236static inline void strim_all(char *str)
237{
238 char *s;
239
240 s = strim(str);
241 if (s != str)
242 memmove(str, s, strlen(s));
243 while (*str) {
244 if (!isspace(*str++))
245 continue;
246 if (isspace(*str)) {
247 s = skip_spaces(str);
248 memmove(str, s, strlen(s) + 1);
249 }
250 }
251}
252
4b8fe77a
CB
253static noinline __init void setup_arch_string(void)
254{
255 struct sysinfo_1_1_1 *mach = (struct sysinfo_1_1_1 *)&sysinfo_page;
2f8876f9
HC
256 struct sysinfo_3_2_2 *vm = (struct sysinfo_3_2_2 *)&sysinfo_page;
257 char mstr[80], hvstr[17];
4b8fe77a
CB
258
259 if (stsi(mach, 1, 1, 1))
260 return;
261 EBCASC(mach->manufacturer, sizeof(mach->manufacturer));
262 EBCASC(mach->type, sizeof(mach->type));
263 EBCASC(mach->model, sizeof(mach->model));
264 EBCASC(mach->model_capacity, sizeof(mach->model_capacity));
d2f03974
HC
265 sprintf(mstr, "%-16.16s %-4.4s %-16.16s %-16.16s",
266 mach->manufacturer, mach->type,
267 mach->model, mach->model_capacity);
268 strim_all(mstr);
2f8876f9
HC
269 if (stsi(vm, 3, 2, 2) == 0 && vm->count) {
270 EBCASC(vm->vm[0].cpi, sizeof(vm->vm[0].cpi));
271 sprintf(hvstr, "%-16.16s", vm->vm[0].cpi);
272 strim_all(hvstr);
273 } else {
274 sprintf(hvstr, "%s",
275 MACHINE_IS_LPAR ? "LPAR" :
276 MACHINE_IS_VM ? "z/VM" :
277 MACHINE_IS_KVM ? "KVM" : "unknown");
278 }
279 dump_stack_set_arch_desc("%s (%s)", mstr, hvstr);
4b8fe77a
CB
280}
281
fade4dc4
HC
282static __init void setup_topology(void)
283{
fade4dc4
HC
284 int max_mnest;
285
286 if (!test_facility(11))
287 return;
288 S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
289 for (max_mnest = 6; max_mnest > 1; max_mnest--) {
caf757c6 290 if (stsi(&sysinfo_page, 15, 1, max_mnest) == 0)
fade4dc4
HC
291 break;
292 }
293 topology_max_mnest = max_mnest;
fade4dc4
HC
294}
295
a3415703 296static void early_pgm_check_handler(void)
ab14de6c 297{
ab14de6c 298 const struct exception_table_entry *fixup;
50be6345 299 unsigned long cr0, cr0_new;
eb608fb3 300 unsigned long addr;
ab14de6c
HC
301
302 addr = S390_lowcore.program_old_psw.addr;
9cb1ccec 303 fixup = search_exception_tables(addr);
ab14de6c
HC
304 if (!fixup)
305 disabled_wait(0);
50be6345
PH
306 /* Disable low address protection before storing into lowcore. */
307 __ctl_store(cr0, 0, 0);
308 cr0_new = cr0 & ~(1UL << 28);
309 __ctl_load(cr0_new, 0, 0);
fecc868a 310 S390_lowcore.program_old_psw.addr = extable_fixup(fixup);
50be6345 311 __ctl_load(cr0, 0, 0);
ab14de6c
HC
312}
313
5f954c34 314static noinline __init void setup_lowcore_early(void)
ab14de6c
HC
315{
316 psw_t psw;
317
b50511e4 318 psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA;
fecc868a 319 psw.addr = (unsigned long) s390_base_ext_handler;
ab14de6c 320 S390_lowcore.external_new_psw = psw;
fecc868a 321 psw.addr = (unsigned long) s390_base_pgm_handler;
ab14de6c
HC
322 S390_lowcore.program_new_psw = psw;
323 s390_base_pgm_handler_fn = early_pgm_check_handler;
c360192b 324 S390_lowcore.preempt_count = INIT_PREEMPT_COUNT;
ab14de6c
HC
325}
326
14375bc4
MS
327static noinline __init void setup_facility_list(void)
328{
3ab121ab
MH
329 stfle(S390_lowcore.stfle_fac_list,
330 ARRAY_SIZE(S390_lowcore.stfle_fac_list));
14375bc4
MS
331}
332
2e5061e4
HC
333static __init void detect_diag9c(void)
334{
335 unsigned int cpu_address;
336 int rc;
337
338 cpu_address = stap();
1ec2772e 339 diag_stat_inc(DIAG_STAT_X09C);
2e5061e4
HC
340 asm volatile(
341 " diag %2,0,0x9c\n"
342 "0: la %0,0\n"
343 "1:\n"
344 EX_TABLE(0b,1b)
345 : "=d" (rc) : "0" (-EOPNOTSUPP), "d" (cpu_address) : "cc");
346 if (!rc)
d3135e0c 347 S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG9C;
2e5061e4
HC
348}
349
350static __init void detect_diag44(void)
351{
2e5061e4
HC
352 int rc;
353
1ec2772e 354 diag_stat_inc(DIAG_STAT_X044);
2e5061e4
HC
355 asm volatile(
356 " diag 0,0,0x44\n"
357 "0: la %0,0\n"
358 "1:\n"
359 EX_TABLE(0b,1b)
360 : "=d" (rc) : "0" (-EOPNOTSUPP) : "cc");
361 if (!rc)
d3135e0c 362 S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG44;
2e5061e4
HC
363}
364
365static __init void detect_machine_facilities(void)
366{
3c7ef08b
HC
367 if (test_facility(8)) {
368 S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT1;
369 __ctl_set_bit(0, 23);
370 }
85e9d0e5
HC
371 if (test_facility(78))
372 S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT2;
14375bc4 373 if (test_facility(3))
d3135e0c 374 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
14375bc4 375 if (test_facility(40))
23d18e8d 376 S390_lowcore.machine_flags |= MACHINE_FLAG_LPP;
d35339a4
MS
377 if (test_facility(50) && test_facility(73))
378 S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
1b948d6c
MS
379 if (test_facility(51))
380 S390_lowcore.machine_flags |= MACHINE_FLAG_TLB_LC;
b5510d9b 381 if (test_facility(129)) {
80703617 382 S390_lowcore.machine_flags |= MACHINE_FLAG_VX;
b5510d9b
HB
383 __ctl_set_bit(0, 17);
384 }
57d7f939
MS
385 if (test_facility(130)) {
386 S390_lowcore.machine_flags |= MACHINE_FLAG_NX;
387 __ctl_set_bit(0, 20);
388 }
916cda1a
MS
389 if (test_facility(133))
390 S390_lowcore.machine_flags |= MACHINE_FLAG_GS;
6e2ef5e4
MS
391 if (test_facility(139) && (tod_clock_base[1] & 0x80)) {
392 /* Enabled signed clock comparator comparisons */
393 S390_lowcore.machine_flags |= MACHINE_FLAG_SCC;
394 clock_comparator_max = -1ULL >> 1;
395 __ctl_set_bit(0, 53);
396 }
b5510d9b
HB
397}
398
1a36a39e
MS
399static inline void save_vector_registers(void)
400{
401#ifdef CONFIG_CRASH_DUMP
402 if (test_facility(129))
403 save_vx_regs(boot_cpu_vector_save_area);
404#endif
405}
406
b5510d9b
HB
407static int __init disable_vector_extension(char *str)
408{
409 S390_lowcore.machine_flags &= ~MACHINE_FLAG_VX;
410 __ctl_clear_bit(0, 17);
673cfddf 411 return 0;
2e5061e4 412}
b5510d9b 413early_param("novx", disable_vector_extension);
2e5061e4 414
57d7f939
MS
415static int __init noexec_setup(char *str)
416{
417 bool enabled;
418 int rc;
419
420 rc = kstrtobool(str, &enabled);
421 if (!rc && !enabled) {
422 /* Disable no-execute support */
423 S390_lowcore.machine_flags &= ~MACHINE_FLAG_NX;
424 __ctl_clear_bit(0, 20);
425 }
426 return rc;
427}
428early_param("noexec", noexec_setup);
429
61b0b016 430static int __init cad_setup(char *str)
2c72a44e 431{
b13de4b7
MS
432 bool enabled;
433 int rc;
2c72a44e 434
b13de4b7
MS
435 rc = kstrtobool(str, &enabled);
436 if (!rc && enabled && test_facility(128))
2c72a44e
MS
437 /* Enable problem state CAD. */
438 __ctl_set_bit(2, 3);
b13de4b7 439 return rc;
2c72a44e 440}
b13de4b7 441early_param("cad", cad_setup);
2c72a44e 442
d543a106
HC
443static __init void memmove_early(void *dst, const void *src, size_t n)
444{
445 unsigned long addr;
446 long incr;
447 psw_t old;
448
449 if (!n)
450 return;
451 incr = 1;
452 if (dst > src) {
453 incr = -incr;
454 dst += n - 1;
455 src += n - 1;
456 }
457 old = S390_lowcore.program_new_psw;
458 S390_lowcore.program_new_psw.mask = __extract_psw();
459 asm volatile(
460 " larl %[addr],1f\n"
461 " stg %[addr],%[psw_pgm_addr]\n"
462 "0: mvc 0(1,%[dst]),0(%[src])\n"
463 " agr %[dst],%[incr]\n"
464 " agr %[src],%[incr]\n"
465 " brctg %[n],0b\n"
466 "1:\n"
467 : [addr] "=&d" (addr),
75a35734 468 [psw_pgm_addr] "=Q" (S390_lowcore.program_new_psw.addr),
d543a106
HC
469 [dst] "+&a" (dst), [src] "+&a" (src), [n] "+d" (n)
470 : [incr] "d" (incr)
471 : "cc", "memory");
472 S390_lowcore.program_new_psw = old;
473}
474
475static __init noinline void ipl_save_parameters(void)
476{
477 void *src, *dst;
478
479 src = (void *)(unsigned long) S390_lowcore.ipl_parmblock_ptr;
480 dst = (void *) IPL_PARMBLOCK_ORIGIN;
481 memmove_early(dst, src, PAGE_SIZE);
482 S390_lowcore.ipl_parmblock_ptr = IPL_PARMBLOCK_ORIGIN;
483}
484
485static __init noinline void rescue_initrd(void)
761cdf6a
HC
486{
487#ifdef CONFIG_BLK_DEV_INITRD
27e7318c 488 unsigned long min_initrd_addr = (unsigned long) _end + (4UL << 20);
761cdf6a 489 /*
27e7318c
HC
490 * Just like in case of IPL from VM reader we make sure there is a
491 * gap of 4MB between end of kernel and start of initrd.
492 * That way we can also be sure that saving an NSS will succeed,
493 * which however only requires different segments.
761cdf6a
HC
494 */
495 if (!INITRD_START || !INITRD_SIZE)
496 return;
27e7318c 497 if (INITRD_START >= min_initrd_addr)
761cdf6a 498 return;
d543a106 499 memmove_early((void *) min_initrd_addr, (void *) INITRD_START, INITRD_SIZE);
27e7318c 500 INITRD_START = min_initrd_addr;
761cdf6a
HC
501#endif
502}
503
a0443fbb 504/* Set up boot command line */
684d2fd4 505static void __init append_to_cmdline(size_t (*ipl_data)(char *, size_t))
a0443fbb 506{
684d2fd4
HB
507 char *parm, *delim;
508 size_t rc, len;
509
510 len = strlen(boot_command_line);
a0443fbb 511
684d2fd4
HB
512 delim = boot_command_line + len; /* '\0' character position */
513 parm = boot_command_line + len + 1; /* append right after '\0' */
514
515 rc = ipl_data(parm, COMMAND_LINE_SIZE - len - 1);
516 if (rc) {
517 if (*parm == '=')
518 memmove(boot_command_line, parm + 1, rc);
519 else
520 *delim = ' '; /* replace '\0' with space */
521 }
522}
523
1fb81057 524static inline int has_ebcdic_char(const char *str)
684d2fd4 525{
61fd330d
MS
526 int i;
527
1fb81057
MH
528 for (i = 0; str[i]; i++)
529 if (str[i] & 0x80)
530 return 1;
531 return 0;
532}
61fd330d 533
1fb81057
MH
534static void __init setup_boot_command_line(void)
535{
536 COMMAND_LINE[ARCH_COMMAND_LINE_SIZE - 1] = 0;
537 /* convert arch command line to ascii if necessary */
538 if (has_ebcdic_char(COMMAND_LINE))
539 EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
a0443fbb 540 /* copy arch command line */
61fd330d
MS
541 strlcpy(boot_command_line, strstrip(COMMAND_LINE),
542 ARCH_COMMAND_LINE_SIZE);
a0443fbb
HB
543
544 /* append IPL PARM data to the boot command line */
684d2fd4
HB
545 if (MACHINE_IS_VM)
546 append_to_cmdline(append_ipl_vmparm);
547
548 append_to_cmdline(append_ipl_scpdata);
a0443fbb
HB
549}
550
ab14de6c
HC
551/*
552 * Save ipl parameters, clear bss memory, initialize storage keys
553 * and create a kernel NSS at startup if the SAVESYS= parm is defined
554 */
555void __init startup_init(void)
556{
b6112ccb 557 reset_tod_clock();
ab14de6c 558 ipl_save_parameters();
761cdf6a 559 rescue_initrd();
ab14de6c 560 clear_bss_section();
d543a106 561 ipl_verify_parameters();
b1c0854d 562 time_early_init();
ab14de6c 563 init_kernel_storage_key();
ab14de6c 564 lockdep_off();
ab14de6c 565 setup_lowcore_early();
14375bc4 566 setup_facility_list();
a0443fbb 567 detect_machine_type();
4b8fe77a 568 setup_arch_string();
a0443fbb
HB
569 ipl_update_parameters();
570 setup_boot_command_line();
571 create_kernel_nss();
2e5061e4
HC
572 detect_diag9c();
573 detect_diag44();
574 detect_machine_facilities();
1a36a39e 575 save_vector_registers();
fade4dc4 576 setup_topology();
7b50da53 577 sclp_early_detect();
ab14de6c
HC
578 lockdep_on();
579}