Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Holzheu and committed by
Martin Schwidefsky
8143adaf 56280b1b

+2 -10
+2 -10
arch/s390/kernel/ipl.c
··· 1583 1583 1584 1584 static void vmcmd_run(struct shutdown_trigger *trigger) 1585 1585 { 1586 - char *cmd, *next_cmd; 1586 + char *cmd; 1587 1587 1588 1588 if (strcmp(trigger->name, ON_REIPL_STR) == 0) 1589 1589 cmd = vmcmd_on_reboot; ··· 1600 1600 1601 1601 if (strlen(cmd) == 0) 1602 1602 return; 1603 - do { 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); 1603 + __cpcmd(cmd, NULL, 0, NULL); 1612 1604 } 1613 1605 1614 1606 static int vmcmd_init(void)