From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO6VA-0007Dc-Rs for qemu-devel@nongnu.org; Fri, 05 Apr 2013 09:16:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UO6V4-0003Gu-Jn for qemu-devel@nongnu.org; Fri, 05 Apr 2013 09:16:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO6V4-0003Gd-Bm for qemu-devel@nongnu.org; Fri, 05 Apr 2013 09:16:14 -0400 Date: Fri, 5 Apr 2013 09:15:59 -0400 From: Luiz Capitulino Message-ID: <20130405091559.22a250c4@redhat.com> In-Reply-To: <515E8E7E.8060504@de.ibm.com> References: <515E8E7E.8060504@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] [RFC] Wire up disabled wait a panicked event on s390 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Peter Maydell , Gleb Natapov , "Michael S. Tsirkin" , Hu Tao , qemu-devel , Alexander Graf , Blue Swirl , Orit Wasserman , Juan Quintela , Markus Armbruster , Jan Kiszka , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , KAMEZAWA Hiroyuki , Anthony Liguori , Marcelo Tosatti , Paolo Bonzini On Fri, 05 Apr 2013 10:42:38 +0200 Christian Borntraeger wrote: > On s390 the disabled wait state indicates a state of attention. > For example Linux uses that state after a panic. Lets > put the system into panicked state. > > An alternative implementation would be to state > disabled-wait
instead of pause in the action field. > (e.g. z/OS, z/VM and other classic OSes use the address of the > disabled wait to indicate an error code). > > Signed-off-by: Christian Borntraeger > --- > target-s390x/kvm.c | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c > index 644f484..0c111f0 100644 > --- a/target-s390x/kvm.c > +++ b/target-s390x/kvm.c > @@ -34,6 +34,8 @@ > #include "sysemu/kvm.h" > #include "cpu.h" > #include "sysemu/device_tree.h" > +#include "qapi/qmp/qjson.h" > +#include "monitor/monitor.h" > > /* #define DEBUG_KVM */ > > @@ -705,9 +707,18 @@ static int handle_intercept(S390CPU *cpu) > r = handle_instruction(cpu, run); > break; > case ICPT_WAITPSW: > - if (s390_del_running_cpu(cpu) == 0 && > - is_special_wait_psw(cs)) { > - qemu_system_shutdown_request(); > + /* disabled wait, since enabled wait is handled in kernel */ > + if (s390_del_running_cpu(cpu) == 0) { > + if (is_special_wait_psw(cs)) { > + qemu_system_shutdown_request(); > + } else { > + QObject *data; > + > + data = qobject_from_jsonf("{ 'action': %s }", "pause"); > + monitor_protocol_event(QEVENT_GUEST_PANICKED, data); > + qobject_decref(data); > + vm_stop(RUN_STATE_GUEST_PANICKED); This is on top of the pvpanic device, right? Seems good to me, although I don't remember the exact semantics of the new event. Also, I think you could move this code to a function and share it with the pvpanic device. > + } > } > r = EXCP_HALTED; > break; >