aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/ipl.c
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2012-07-24 12:43:02 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-07-26 04:07:26 -0400
commit8143adafd2d00b13f1db96ce06b6bf479e0bfe5b (patch)
treeafc5ed9fd4b0093928833da2d473e1de9008dce1 /arch/s390/kernel/ipl.c
parent56280b1bf68764c67d99887d5834788246d5896e (diff)
s390/ipl: Use diagnose 8 command separation
Currently the vmcmd shutdown action is parsed by the kernel and if multiple cp commands have been specified, they are issued separately with the cpcmd() function. The underlying diagnose 8 instruction already allows to specify multiple commands that are separated by 0x15. The ASCEBC() function used by cpcmd() translates '\n' to 0x15. The '\n' character is currently used as vmcmd command separator and therefore the vmcmd string can be passed directly to the cpcmd() function. Using the diagnose 8 command separation has the advantage that also after disruptive commands that stop Linux, for example "def store", additional commands can be executed. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/ipl.c')
-rw-r--r--arch/s390/kernel/ipl.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index e64d141555c..6ffcd320321 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1583,7 +1583,7 @@ static struct kset *vmcmd_kset;
1583 1583
1584static void vmcmd_run(struct shutdown_trigger *trigger) 1584static void vmcmd_run(struct shutdown_trigger *trigger)
1585{ 1585{
1586 char *cmd, *next_cmd; 1586 char *cmd;
1587 1587
1588 if (strcmp(trigger->name, ON_REIPL_STR) == 0) 1588 if (strcmp(trigger->name, ON_REIPL_STR) == 0)
1589 cmd = vmcmd_on_reboot; 1589 cmd = vmcmd_on_reboot;
@@ -1600,15 +1600,7 @@ static void vmcmd_run(struct shutdown_trigger *trigger)
1600 1600
1601 if (strlen(cmd) == 0) 1601 if (strlen(cmd) == 0)
1602 return; 1602 return;
1603 do { 1603 __cpcmd(cmd, NULL, 0, NULL);
1604 next_cmd = strchr(cmd, '\n');
1605 if (next_cmd) {
1606 next_cmd[0] = 0;
1607 next_cmd += 1;
1608 }
1609 __cpcmd(cmd, NULL, 0, NULL);
1610 cmd = next_cmd;
1611 } while (cmd != NULL);
1612} 1604}
1613 1605
1614static int vmcmd_init(void) 1606static int vmcmd_init(void)