From nobody Tue Nov 4 18:50:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530530410965485.6898553614375; Mon, 2 Jul 2018 04:20:10 -0700 (PDT) Received: from localhost ([::1]:60088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZwsK-000393-9n for importer@patchew.org; Mon, 02 Jul 2018 07:20:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZwq6-0001vK-Km for qemu-devel@nongnu.org; Mon, 02 Jul 2018 07:17:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZwq5-0005yZ-LX for qemu-devel@nongnu.org; Mon, 02 Jul 2018 07:17:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36479 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fZwq5-0005yD-FD; Mon, 02 Jul 2018 07:17:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04F6D7C6A9; Mon, 2 Jul 2018 11:17:49 +0000 (UTC) Received: from localhost (ovpn-116-251.ams2.redhat.com [10.36.116.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6B98111CA1A; Mon, 2 Jul 2018 11:17:48 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Mon, 2 Jul 2018 13:17:23 +0200 Message-Id: <20180702111737.18970-2-cohuck@redhat.com> In-Reply-To: <20180702111737.18970-1-cohuck@redhat.com> References: <20180702111737.18970-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 11:17:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 11:17:49 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 01/15] s390/ipl: fix ipl with -no-reboot X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Christian Borntraeger kexec/kdump as well as the bootloader use a subcode of diagnose 308 that is supposed to reset the I/O subsystem but not comprise a full "reboot". With the latest refactoring this is now broken when -no-reboot is used or when libvirt acts on a reboot QMP event, for example a virt-install from iso images. We need to mark these "subsystem resets" as special. Fixes: a30fb811cbe9 (s390x: refactor reset/reipl handling) Signed-off-by: Christian Borntraeger Reviewed-by: David Hildenbrand Message-Id: <20180622102928.173420-1-borntraeger@de.ibm.com> Acked-by: Paolo Bonzini Signed-off-by: Cornelia Huck --- hw/s390x/ipl.c | 8 +++++++- include/sysemu/sysemu.h | 4 ++++ vl.c | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 0d67349004..f278036fa7 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -535,7 +535,13 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_re= set reset_type) ipl->iplb_valid =3D s390_gen_initial_iplb(ipl); } } - qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + if (reset_type =3D=3D S390_RESET_MODIFIED_CLEAR || + reset_type =3D=3D S390_RESET_LOAD_NORMAL) { + /* ignore -no-reboot, send no event */ + qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET); + } else { + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } /* as this is triggered by a CPU, make sure to exit the loop */ if (tcg_enabled()) { cpu_loop_exit(cs); diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index b921c6f3b7..76ef6196a7 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -44,6 +44,10 @@ typedef enum ShutdownCause { turns that into a shutdown */ SHUTDOWN_CAUSE_GUEST_PANIC, /* Guest panicked, and command line turns that into a shutdown */ + SHUTDOWN_CAUSE_SUBSYSTEM_RESET,/* Partial guest reset that does not tr= igger + QMP events and ignores --no-reboot. = This + is useful for sanitize hypercalls on= s390 + that are used during kexec/kdump/boo= t */ SHUTDOWN_CAUSE__MAX, } ShutdownCause; =20 diff --git a/vl.c b/vl.c index ef6cfcec40..9442beee21 100644 --- a/vl.c +++ b/vl.c @@ -1645,7 +1645,7 @@ void qemu_system_reset(ShutdownCause reason) } else { qemu_devices_reset(); } - if (reason) { + if (reason !=3D SHUTDOWN_CAUSE_SUBSYSTEM_RESET) { qapi_event_send_reset(shutdown_caused_by_guest(reason), &error_abort); } @@ -1691,7 +1691,7 @@ void qemu_system_guest_panicked(GuestPanicInformation= *info) =20 void qemu_system_reset_request(ShutdownCause reason) { - if (no_reboot) { + if (no_reboot && reason !=3D SHUTDOWN_CAUSE_SUBSYSTEM_RESET) { shutdown_requested =3D reason; } else { reset_requested =3D reason; --=20 2.14.4