diff options
author | Halil Pasic <pasic@linux.vnet.ibm.com> | 2017-10-17 16:04:50 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2017-10-20 13:32:10 +0200 |
commit | 963764081d84f25ecc6aff0d49e074c150910e6a (patch) | |
tree | a9866f3a6667f9ebef37a763159d00641ead7228 /target | |
parent | 66dc50f7057b9a0191f54e55764412202306858d (diff) | |
download | qemu-963764081d84f25ecc6aff0d49e074c150910e6a.zip |
s390x: refactor error handling for XSCH handler
Simplify the error handling of the XSCH. Let the code detecting the
condition tell (in a less ambiguous way) how it's to be handled. No
changes in behavior.
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Message-Id: <20171017140453.51099-5-pasic@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/ioinst.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c index 16b5cf2fed..4ad07e9181 100644 --- a/target/s390x/ioinst.c +++ b/target/s390x/ioinst.c @@ -42,8 +42,6 @@ void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1) { int cssid, ssid, schid, m; SubchDev *sch; - int ret = -ENODEV; - int cc; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { program_interrupt(&cpu->env, PGM_OPERAND, 4); @@ -51,24 +49,11 @@ void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1) } trace_ioinst_sch_id("xsch", cssid, ssid, schid); sch = css_find_subch(m, cssid, ssid, schid); - if (sch && css_subch_visible(sch)) { - ret = css_do_xsch(sch); - } - switch (ret) { - case -ENODEV: - cc = 3; - break; - case -EBUSY: - cc = 2; - break; - case 0: - cc = 0; - break; - default: - cc = 1; - break; + if (!sch || !css_subch_visible(sch)) { + setcc(cpu, 3); + return; } - setcc(cpu, cc); + setcc(cpu, css_do_xsch(sch)); } void ioinst_handle_csch(S390CPU *cpu, uint64_t reg1) |