diff options
Diffstat (limited to 'arch/s390/kernel/ipl.c')
-rw-r--r-- | arch/s390/kernel/ipl.c | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 4890ac6d7faa..72c8b0d070c8 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/reboot.h> | 15 | #include <linux/reboot.h> |
16 | #include <linux/ctype.h> | 16 | #include <linux/ctype.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/gfp.h> | ||
18 | #include <asm/ipl.h> | 19 | #include <asm/ipl.h> |
19 | #include <asm/smp.h> | 20 | #include <asm/smp.h> |
20 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
@@ -221,7 +222,7 @@ static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \ | |||
221 | const char *buf, size_t len) \ | 222 | const char *buf, size_t len) \ |
222 | { \ | 223 | { \ |
223 | strncpy(_value, buf, sizeof(_value) - 1); \ | 224 | strncpy(_value, buf, sizeof(_value) - 1); \ |
224 | strstrip(_value); \ | 225 | strim(_value); \ |
225 | return len; \ | 226 | return len; \ |
226 | } \ | 227 | } \ |
227 | static struct kobj_attribute sys_##_prefix##_##_name##_attr = \ | 228 | static struct kobj_attribute sys_##_prefix##_##_name##_attr = \ |
@@ -472,7 +473,7 @@ static ssize_t ipl_ccw_loadparm_show(struct kobject *kobj, | |||
472 | return sprintf(page, "#unknown#\n"); | 473 | return sprintf(page, "#unknown#\n"); |
473 | memcpy(loadparm, &sclp_ipl_info.loadparm, LOADPARM_LEN); | 474 | memcpy(loadparm, &sclp_ipl_info.loadparm, LOADPARM_LEN); |
474 | EBCASC(loadparm, LOADPARM_LEN); | 475 | EBCASC(loadparm, LOADPARM_LEN); |
475 | strstrip(loadparm); | 476 | strim(loadparm); |
476 | return sprintf(page, "%s\n", loadparm); | 477 | return sprintf(page, "%s\n", loadparm); |
477 | } | 478 | } |
478 | 479 | ||
@@ -553,7 +554,7 @@ out: | |||
553 | return rc; | 554 | return rc; |
554 | } | 555 | } |
555 | 556 | ||
556 | static void ipl_run(struct shutdown_trigger *trigger) | 557 | static void __ipl_run(void *unused) |
557 | { | 558 | { |
558 | diag308(DIAG308_IPL, NULL); | 559 | diag308(DIAG308_IPL, NULL); |
559 | if (MACHINE_IS_VM) | 560 | if (MACHINE_IS_VM) |
@@ -562,6 +563,11 @@ static void ipl_run(struct shutdown_trigger *trigger) | |||
562 | reipl_ccw_dev(&ipl_info.data.ccw.dev_id); | 563 | reipl_ccw_dev(&ipl_info.data.ccw.dev_id); |
563 | } | 564 | } |
564 | 565 | ||
566 | static void ipl_run(struct shutdown_trigger *trigger) | ||
567 | { | ||
568 | smp_switch_to_ipl_cpu(__ipl_run, NULL); | ||
569 | } | ||
570 | |||
565 | static int __init ipl_init(void) | 571 | static int __init ipl_init(void) |
566 | { | 572 | { |
567 | int rc; | 573 | int rc; |
@@ -776,7 +782,7 @@ static void reipl_get_ascii_loadparm(char *loadparm, | |||
776 | memcpy(loadparm, ibp->ipl_info.ccw.load_parm, LOADPARM_LEN); | 782 | memcpy(loadparm, ibp->ipl_info.ccw.load_parm, LOADPARM_LEN); |
777 | EBCASC(loadparm, LOADPARM_LEN); | 783 | EBCASC(loadparm, LOADPARM_LEN); |
778 | loadparm[LOADPARM_LEN] = 0; | 784 | loadparm[LOADPARM_LEN] = 0; |
779 | strstrip(loadparm); | 785 | strim(loadparm); |
780 | } | 786 | } |
781 | 787 | ||
782 | static ssize_t reipl_generic_loadparm_show(struct ipl_parameter_block *ipb, | 788 | static ssize_t reipl_generic_loadparm_show(struct ipl_parameter_block *ipb, |
@@ -1039,7 +1045,7 @@ static void get_ipl_string(char *dst, struct ipl_parameter_block *ipb, | |||
1039 | sprintf(dst + pos, " PARM %s", vmparm); | 1045 | sprintf(dst + pos, " PARM %s", vmparm); |
1040 | } | 1046 | } |
1041 | 1047 | ||
1042 | static void reipl_run(struct shutdown_trigger *trigger) | 1048 | static void __reipl_run(void *unused) |
1043 | { | 1049 | { |
1044 | struct ccw_dev_id devid; | 1050 | struct ccw_dev_id devid; |
1045 | static char buf[128]; | 1051 | static char buf[128]; |
@@ -1087,6 +1093,11 @@ static void reipl_run(struct shutdown_trigger *trigger) | |||
1087 | disabled_wait((unsigned long) __builtin_return_address(0)); | 1093 | disabled_wait((unsigned long) __builtin_return_address(0)); |
1088 | } | 1094 | } |
1089 | 1095 | ||
1096 | static void reipl_run(struct shutdown_trigger *trigger) | ||
1097 | { | ||
1098 | smp_switch_to_ipl_cpu(__reipl_run, NULL); | ||
1099 | } | ||
1100 | |||
1090 | static void reipl_block_ccw_init(struct ipl_parameter_block *ipb) | 1101 | static void reipl_block_ccw_init(struct ipl_parameter_block *ipb) |
1091 | { | 1102 | { |
1092 | ipb->hdr.len = IPL_PARM_BLK_CCW_LEN; | 1103 | ipb->hdr.len = IPL_PARM_BLK_CCW_LEN; |
@@ -1369,20 +1380,18 @@ static struct kobj_attribute dump_type_attr = | |||
1369 | 1380 | ||
1370 | static struct kset *dump_kset; | 1381 | static struct kset *dump_kset; |
1371 | 1382 | ||
1372 | static void dump_run(struct shutdown_trigger *trigger) | 1383 | static void __dump_run(void *unused) |
1373 | { | 1384 | { |
1374 | struct ccw_dev_id devid; | 1385 | struct ccw_dev_id devid; |
1375 | static char buf[100]; | 1386 | static char buf[100]; |
1376 | 1387 | ||
1377 | switch (dump_method) { | 1388 | switch (dump_method) { |
1378 | case DUMP_METHOD_CCW_CIO: | 1389 | case DUMP_METHOD_CCW_CIO: |
1379 | smp_send_stop(); | ||
1380 | devid.devno = dump_block_ccw->ipl_info.ccw.devno; | 1390 | devid.devno = dump_block_ccw->ipl_info.ccw.devno; |
1381 | devid.ssid = 0; | 1391 | devid.ssid = 0; |
1382 | reipl_ccw_dev(&devid); | 1392 | reipl_ccw_dev(&devid); |
1383 | break; | 1393 | break; |
1384 | case DUMP_METHOD_CCW_VM: | 1394 | case DUMP_METHOD_CCW_VM: |
1385 | smp_send_stop(); | ||
1386 | sprintf(buf, "STORE STATUS"); | 1395 | sprintf(buf, "STORE STATUS"); |
1387 | __cpcmd(buf, NULL, 0, NULL); | 1396 | __cpcmd(buf, NULL, 0, NULL); |
1388 | sprintf(buf, "IPL %X", dump_block_ccw->ipl_info.ccw.devno); | 1397 | sprintf(buf, "IPL %X", dump_block_ccw->ipl_info.ccw.devno); |
@@ -1396,10 +1405,17 @@ static void dump_run(struct shutdown_trigger *trigger) | |||
1396 | diag308(DIAG308_SET, dump_block_fcp); | 1405 | diag308(DIAG308_SET, dump_block_fcp); |
1397 | diag308(DIAG308_DUMP, NULL); | 1406 | diag308(DIAG308_DUMP, NULL); |
1398 | break; | 1407 | break; |
1399 | case DUMP_METHOD_NONE: | 1408 | default: |
1400 | return; | 1409 | break; |
1401 | } | 1410 | } |
1402 | printk(KERN_EMERG "Dump failed!\n"); | 1411 | } |
1412 | |||
1413 | static void dump_run(struct shutdown_trigger *trigger) | ||
1414 | { | ||
1415 | if (dump_method == DUMP_METHOD_NONE) | ||
1416 | return; | ||
1417 | smp_send_stop(); | ||
1418 | smp_switch_to_ipl_cpu(__dump_run, NULL); | ||
1403 | } | 1419 | } |
1404 | 1420 | ||
1405 | static int __init dump_ccw_init(void) | 1421 | static int __init dump_ccw_init(void) |
@@ -1577,7 +1593,7 @@ static void vmcmd_run(struct shutdown_trigger *trigger) | |||
1577 | static int vmcmd_init(void) | 1593 | static int vmcmd_init(void) |
1578 | { | 1594 | { |
1579 | if (!MACHINE_IS_VM) | 1595 | if (!MACHINE_IS_VM) |
1580 | return -ENOTSUPP; | 1596 | return -EOPNOTSUPP; |
1581 | vmcmd_kset = kset_create_and_add("vmcmd", NULL, firmware_kobj); | 1597 | vmcmd_kset = kset_create_and_add("vmcmd", NULL, firmware_kobj); |
1582 | if (!vmcmd_kset) | 1598 | if (!vmcmd_kset) |
1583 | return -ENOMEM; | 1599 | return -ENOMEM; |
@@ -1595,7 +1611,7 @@ static void stop_run(struct shutdown_trigger *trigger) | |||
1595 | { | 1611 | { |
1596 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) | 1612 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) |
1597 | disabled_wait((unsigned long) __builtin_return_address(0)); | 1613 | disabled_wait((unsigned long) __builtin_return_address(0)); |
1598 | while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) | 1614 | while (sigp(smp_processor_id(), sigp_stop) == sigp_busy) |
1599 | cpu_relax(); | 1615 | cpu_relax(); |
1600 | for (;;); | 1616 | for (;;); |
1601 | } | 1617 | } |
@@ -1902,7 +1918,6 @@ void __init ipl_update_parameters(void) | |||
1902 | void __init ipl_save_parameters(void) | 1918 | void __init ipl_save_parameters(void) |
1903 | { | 1919 | { |
1904 | struct cio_iplinfo iplinfo; | 1920 | struct cio_iplinfo iplinfo; |
1905 | unsigned int *ipl_ptr; | ||
1906 | void *src, *dst; | 1921 | void *src, *dst; |
1907 | 1922 | ||
1908 | if (cio_get_iplinfo(&iplinfo)) | 1923 | if (cio_get_iplinfo(&iplinfo)) |
@@ -1913,11 +1928,10 @@ void __init ipl_save_parameters(void) | |||
1913 | if (!iplinfo.is_qdio) | 1928 | if (!iplinfo.is_qdio) |
1914 | return; | 1929 | return; |
1915 | ipl_flags |= IPL_PARMBLOCK_VALID; | 1930 | ipl_flags |= IPL_PARMBLOCK_VALID; |
1916 | ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR; | 1931 | src = (void *)(unsigned long)S390_lowcore.ipl_parmblock_ptr; |
1917 | src = (void *)(unsigned long)*ipl_ptr; | ||
1918 | dst = (void *)IPL_PARMBLOCK_ORIGIN; | 1932 | dst = (void *)IPL_PARMBLOCK_ORIGIN; |
1919 | memmove(dst, src, PAGE_SIZE); | 1933 | memmove(dst, src, PAGE_SIZE); |
1920 | *ipl_ptr = IPL_PARMBLOCK_ORIGIN; | 1934 | S390_lowcore.ipl_parmblock_ptr = IPL_PARMBLOCK_ORIGIN; |
1921 | } | 1935 | } |
1922 | 1936 | ||
1923 | static LIST_HEAD(rcall); | 1937 | static LIST_HEAD(rcall); |