Skip to content

Commit 998eb74

Browse files
efarmanhuth
authored andcommitted
s390x: sigp: Force Set Architecture to return Invalid Parameter
According to the Principles of Operation, the SIGP Set Architecture order will return Incorrect State if some CPUs are not stopped, but only if the CZAM facility is not present. If it is, the order will return Invalid Parameter because the architecture mode cannot be changed. Since CZAM always exists when S390_FEAT_ZARCH exists, which in turn exists for every defined CPU model, we can simplify this code. Fixes: 075e52b ("s390x/cpumodel: we are always in zarchitecture mode") Signed-off-by: Eric Farman <[email protected]> Reviewed-by: Christian Borntraeger <[email protected]> Reviewed-by: Janosch Frank <[email protected]> Message-Id: <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent f142010 commit 998eb74

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

target/s390x/sigp.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -428,26 +428,10 @@ static int handle_sigp_single_dst(S390CPU *cpu, S390CPU *dst_cpu, uint8_t order,
428428
static int sigp_set_architecture(S390CPU *cpu, uint32_t param,
429429
uint64_t *status_reg)
430430
{
431-
CPUState *cur_cs;
432-
S390CPU *cur_cpu;
433-
bool all_stopped = true;
434-
435-
CPU_FOREACH(cur_cs) {
436-
cur_cpu = S390_CPU(cur_cs);
437-
438-
if (cur_cpu == cpu) {
439-
continue;
440-
}
441-
if (s390_cpu_get_state(cur_cpu) != S390_CPU_STATE_STOPPED) {
442-
all_stopped = false;
443-
}
444-
}
445-
446431
*status_reg &= 0xffffffff00000000ULL;
447432

448433
/* Reject set arch order, with czam we're always in z/Arch mode. */
449-
*status_reg |= (all_stopped ? SIGP_STAT_INVALID_PARAMETER :
450-
SIGP_STAT_INCORRECT_STATE);
434+
*status_reg |= SIGP_STAT_INVALID_PARAMETER;
451435
return SIGP_CC_STATUS_STORED;
452436
}
453437

0 commit comments

Comments
 (0)