summaryrefslogtreecommitdiff
path: root/hw/s390x/s390-ccw.c
diff options
context:
space:
mode:
authorHalil Pasic <pasic@linux.vnet.ibm.com>2017-10-17 16:04:49 +0200
committerCornelia Huck <cohuck@redhat.com>2017-10-20 13:32:10 +0200
commit66dc50f7057b9a0191f54e55764412202306858d (patch)
treeaec8322b08d631d8212b333fc6d9614d444adbad /hw/s390x/s390-ccw.c
parente443ef9f21acdc6459b3fbad04019a40ea8c4e80 (diff)
s390x: improve error handling for SSCH and RSCH
Simplify the error handling of the SSCH and RSCH handler avoiding arbitrary and cryptic error codes being used to tell how the instruction is supposed to end. Let the code detecting the condition tell how it's to be handled in a less ambiguous way. It's best to handle SSCH and RSCH in one go as the emulation of the two shares a lot of code. For passthrough this change isn't pure refactoring, but changes the way kernel reported EFAULT is handled. After clarifying the kernel interface we decided that EFAULT shall be mapped to unit exception. Same goes for unexpected error codes and absence of required ORB flags. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Message-Id: <20171017140453.51099-4-pasic@linux.vnet.ibm.com> Tested-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> [CH: cosmetic changes] Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x/s390-ccw.c')
-rw-r--r--hw/s390x/s390-ccw.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c
index 8614dda6f8..0ef232ec27 100644
--- a/hw/s390x/s390-ccw.c
+++ b/hw/s390x/s390-ccw.c
@@ -18,15 +18,14 @@
#include "hw/s390x/css-bridge.h"
#include "hw/s390x/s390-ccw.h"
-int s390_ccw_cmd_request(ORB *orb, SCSW *scsw, void *data)
+IOInstEnding s390_ccw_cmd_request(SubchDev *sch)
{
- S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(data);
+ S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(sch->driver_data);
- if (cdc->handle_request) {
- return cdc->handle_request(orb, scsw, data);
- } else {
- return -ENOSYS;
+ if (!cdc->handle_request) {
+ return IOINST_CC_STATUS_PRESENT;
}
+ return cdc->handle_request(sch);
}
static void s390_ccw_get_dev_info(S390CCWDevice *cdev,