From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFOJn-0000oI-OE for qemu-devel@nongnu.org; Fri, 30 Aug 2013 09:00:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFOJf-0001bw-Mv for qemu-devel@nongnu.org; Fri, 30 Aug 2013 09:00:51 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:56693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFO0p-0004YE-VD for qemu-devel@nongnu.org; Fri, 30 Aug 2013 08:41:16 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Aug 2013 13:34:21 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1E32F219005E for ; Fri, 30 Aug 2013 13:41:12 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7UCf0c460293256 for ; Fri, 30 Aug 2013 12:41:00 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7UCfBT4024395 for ; Fri, 30 Aug 2013 06:41:11 -0600 From: Christian Borntraeger Date: Fri, 30 Aug 2013 14:41:29 +0200 Message-Id: <1377866493-47164-4-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1377866493-47164-1-git-send-email-borntraeger@de.ibm.com> References: <1377866493-47164-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 3/7] s390: provide I/O subsystem reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Anthony Liguori 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 Acked-by: Alexander Graf --- 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 0878ab6..af9de5e 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