Skip to content

Commit

Permalink
s390/ipl: Use diagnose 8 command separation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Holzheu authored and Martin Schwidefsky committed Jul 26, 2012
1 parent 56280b1 commit 8143ada
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions arch/s390/kernel/ipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ static struct kset *vmcmd_kset;

static void vmcmd_run(struct shutdown_trigger *trigger)
{
char *cmd, *next_cmd;
char *cmd;

if (strcmp(trigger->name, ON_REIPL_STR) == 0)
cmd = vmcmd_on_reboot;
Expand All @@ -1600,15 +1600,7 @@ static void vmcmd_run(struct shutdown_trigger *trigger)

if (strlen(cmd) == 0)
return;
do {
next_cmd = strchr(cmd, '\n');
if (next_cmd) {
next_cmd[0] = 0;
next_cmd += 1;
}
__cpcmd(cmd, NULL, 0, NULL);
cmd = next_cmd;
} while (cmd != NULL);
__cpcmd(cmd, NULL, 0, NULL);
}

static int vmcmd_init(void)
Expand Down

0 comments on commit 8143ada

Please sign in to comment.