From bab482d7405f9fe3cac9c213d60f9ca9442c047b Mon Sep 17 00:00:00 2001 From: Xiao Feng Ren Date: Wed, 17 May 2017 02:48:11 +0200 Subject: 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 Signed-off-by: Dong Jia Shi Message-Id: <20170517004813.58227-12-bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-ccw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hw/s390x/s390-ccw.c') diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index e2b1973fda..8614dda6f8 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -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); -- cgit v1.2.3