From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF9UK-0003Us-5y for qemu-devel@nongnu.org; Thu, 29 Aug 2013 17:10:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF9UB-0001qp-9O for qemu-devel@nongnu.org; Thu, 29 Aug 2013 17:10:44 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:39659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF9UA-0001qE-G1 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 17:10:34 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Aug 2013 22:04:07 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1CF7217D8058 for ; Thu, 29 Aug 2013 22:10:30 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7TLAHD062521468 for ; Thu, 29 Aug 2013 21:10:17 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7TLASHn028304 for ; Thu, 29 Aug 2013 15:10:29 -0600 From: Christian Borntraeger Date: Thu, 29 Aug 2013 23:10:45 +0200 Message-Id: <1377810649-47484-3-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1377810649-47484-1-git-send-email-borntraeger@de.ibm.com> References: <1377810649-47484-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 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 , Jens Freimann , =?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..8fd46a9 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