s390x/css: ccw translation infrastructure

Implement a basic infrastructure of handling channel I/O instruction
interception for passed through subchannels:
1. Branch the code path of instruction interception handling by
   SubChannel type.
2. For a passed-through subchannel, issue the ORB to kernel to do ccw
   translation and perform an I/O operation.
3. Assign different condition code based on the I/O result, or
   trigger a program check.

Signed-off-by: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Message-Id: <20170517004813.58227-12-bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
Xiao Feng Ren 2017-05-17 02:48:11 +02:00 committed by Cornelia Huck
parent 8ca2b376b4
commit bab482d740
5 changed files with 109 additions and 6 deletions

View file

@ -18,6 +18,17 @@
#include "hw/s390x/css-bridge.h"
#include "hw/s390x/s390-ccw.h"
int s390_ccw_cmd_request(ORB *orb, SCSW *scsw, void *data)
{
S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(data);
if (cdc->handle_request) {
return cdc->handle_request(orb, scsw, data);
} else {
return -ENOSYS;
}
}
static void s390_ccw_get_dev_info(S390CCWDevice *cdev,
char *sysfsdev,
Error **errp)
@ -72,6 +83,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **errp)
goto out_mdevid_free;
}
sch->driver_data = cdev;
sch->do_subchannel_work = do_subchannel_work_passthrough;
ccw_dev->sch = sch;
ret = css_sch_build_schib(sch, &cdev->hostid);