From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejn4P-0002nF-KG for qemu-devel@nongnu.org; Thu, 08 Feb 2018 09:21:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejn4K-000557-RC for qemu-devel@nongnu.org; Thu, 08 Feb 2018 09:21:01 -0500 References: <20180208095752.23960-1-borntraeger@de.ibm.com> From: Eric Blake Message-ID: Date: Thu, 8 Feb 2018 08:20:48 -0600 MIME-Version: 1.0 In-Reply-To: <20180208095752.23960-1-borntraeger@de.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7] s390x/cpu: expose the guest crash information List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger , qemu-s390x Cc: qemu-devel , Cornelia Huck , Thomas Huth , David Hildenbrand , Halil Pasic , Bjoern Walk , Boris Fiuczynski On 02/08/2018 03:57 AM, Christian Borntraeger wrote: > This patch is the s390 implementation of guest crash information, > similar to commit d187e08dc4 ("i386/cpu: add crash-information QOM > property") and the related commits. We will detect several crash > reasons, with the "disabled wait" being the most important one, since > this is used by all s390 guests as a "panic like" notification. > > Co-authored-by: Jing Liu > Signed-off-by: Christian Borntraeger > --- > +## > +# @GuestPanicInformationS390: > +# > +# S390 specific guest panic information (PSW) > +# > +# @core: core id of the CPU that crashed > +# @psw-mask: control fields of guest PSW > +# @psw-addr: guest instruction address > +# @reason: guest crash reason in human readable form > +# > +# Since: 2.12 > +## > +{'struct': 'GuestPanicInformationS390', > + 'data': { 'core': 'uint32', Should core be optional,... > +static GuestPanicInformation *s390_cpu_get_crash_info(CPUState *cs) > +{ > + GuestPanicInformation *panic_info; > + S390CPU *cpu = S390_CPU(cs); > + > + cpu_synchronize_state(cs); > + panic_info = g_malloc0(sizeof(GuestPanicInformation)); > + > + panic_info->type = GUEST_PANIC_INFORMATION_TYPE_S390; > +#if !defined(CONFIG_USER_ONLY) > + panic_info->u.s390.core = cpu->env.core_id; > +#endif ...given that it is only conditionally assigned? If so, you'd also need to set panic_info->u.s390.has_core when you have a core id to expose. > + > +static void s390_cpu_get_crash_info_qom(Object *obj, Visitor *v, > + const char *name, void *opaque, > + Error **errp) > +{ > + CPUState *cs = CPU(obj); > + GuestPanicInformation *panic_info; > + > + if (!cs->crash_occurred) { > + error_setg(errp, "No crash occured"); s/occured/occurred/ -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org