From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3oIM-0000dK-DJ for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3oIA-0000ns-U6 for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:19:30 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:34521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3oIA-0000nX-GX for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:19:18 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jul 2013 15:10:39 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8E67D17D8059 for ; Mon, 29 Jul 2013 15:20:57 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6TEJ2cg7602280 for ; Mon, 29 Jul 2013 14:19:02 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6TEJDOM005749 for ; Mon, 29 Jul 2013 08:19:13 -0600 From: Christian Borntraeger Date: Mon, 29 Jul 2013 16:19:23 +0200 Message-Id: <1375107567-24301-3-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1375107567-24301-1-git-send-email-borntraeger@de.ibm.com> References: <1375107567-24301-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 2/6] s390: provide I/O subsystem reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Cornelia Huck , Christian Borntraeger , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel Provide a function that resets the I/O subsystem. Signed-off-by: Christian Borntraeger --- hw/s390x/s390-virtio-ccw.c | 15 +++++++++++++++ target-s390x/cpu.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index aebbbf1..c5cdb11 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -17,6 +17,21 @@ #include "css.h" #include "virtio-ccw.h" +void io_subsystem_reset(void) +{ + DeviceState *css, *sclp; + + css = DEVICE(object_resolve_path_type("", "virtual-css-bridge", NULL)); + if (css) { + qdev_reset_all(css); + } + sclp = DEVICE(object_resolve_path_type("", + "s390-sclp-event-facility", NULL)); + if (sclp) { + qdev_reset_all(sclp); + } +} + static int virtio_ccw_hcall_notify(const uint64_t *args) { uint64_t subch_id = args[0]; diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 65bef86..1c8e2c2 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -400,6 +400,7 @@ void cpu_unlock(void); typedef struct SubchDev SubchDev; #ifndef CONFIG_USER_ONLY +extern void io_subsystem_reset(void); SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid, uint16_t schid); bool css_subch_visible(SubchDev *sch); -- 1.8.3.1