summaryrefslogtreecommitdiff
path: root/target/s390x/kvm.c
diff options
context:
space:
mode:
authorJason J. Herne <jjherne@linux.vnet.ibm.com>2016-09-01 10:56:49 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-07-14 12:29:49 +0200
commit075e52b816648f21ca6bf5cc01624dff3993c99e (patch)
tree76302017dc22c8b8f9cbf6ce8f00c44a5fe72995 /target/s390x/kvm.c
parent6da5c593bb2c27cef5fbfc4b37342bbf66133cc1 (diff)
downloadqemu-075e52b816648f21ca6bf5cc01624dff3993c99e.tar.gz
s390x/cpumodel: we are always in zarchitecture mode
In QEMU, a guest VCPU always started in and never was able to leave z/Architecture mode. Now we have an architected way of showing this condition. The SIGP SET ARCHITECTURE instruction is simply rejected. Linux as guest seems to not care about the return value, which is a good thing The new handling is just like already being in z/Architecture mode. We'll not try to fake absence of this facility, but still not indicate the facility in case some strange CPU model turned z/Architecture off completely (which doesn't work either way but let's us see how a guest would react on a lack of this facility). Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target/s390x/kvm.c')
-rw-r--r--target/s390x/kvm.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 3a80f1fc49..8c6cc0aaf7 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -1757,41 +1757,25 @@ static int sigp_set_architecture(S390CPU *cpu, uint32_t param,
{
CPUState *cur_cs;
S390CPU *cur_cpu;
+ bool all_stopped = true;
- /* due to the BQL, we are the only active cpu */
CPU_FOREACH(cur_cs) {
cur_cpu = S390_CPU(cur_cs);
- if (cur_cpu->env.sigp_order != 0) {
- return SIGP_CC_BUSY;
+
+ if (cur_cpu == cpu) {
+ continue;
}
- cpu_synchronize_state(cur_cs);
- /* all but the current one have to be stopped */
- if (cur_cpu != cpu &&
- s390_cpu_get_state(cur_cpu) != CPU_STATE_STOPPED) {
- *status_reg &= 0xffffffff00000000ULL;
- *status_reg |= SIGP_STAT_INCORRECT_STATE;
- return SIGP_CC_STATUS_STORED;
+ if (s390_cpu_get_state(cur_cpu) != CPU_STATE_STOPPED) {
+ all_stopped = false;
}
}
- switch (param & 0xff) {
- case SIGP_MODE_ESA_S390:
- /* not supported */
- return SIGP_CC_NOT_OPERATIONAL;
- case SIGP_MODE_Z_ARCH_TRANS_ALL_PSW:
- case SIGP_MODE_Z_ARCH_TRANS_CUR_PSW:
- CPU_FOREACH(cur_cs) {
- cur_cpu = S390_CPU(cur_cs);
- cur_cpu->env.pfault_token = -1UL;
- }
- break;
- default:
- *status_reg &= 0xffffffff00000000ULL;
- *status_reg |= SIGP_STAT_INVALID_PARAMETER;
- return SIGP_CC_STATUS_STORED;
- }
+ *status_reg &= 0xffffffff00000000ULL;
- return SIGP_CC_ORDER_CODE_ACCEPTED;
+ /* Reject set arch order, with czam we're always in z/Arch mode. */
+ *status_reg |= (all_stopped ? SIGP_STAT_INVALID_PARAMETER :
+ SIGP_STAT_INCORRECT_STATE);
+ return SIGP_CC_STATUS_STORED;
}
static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)