From: QingFeng Hao <haoqf@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Cornelia Huck <cohuck@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
David Hildenbrand <david@redhat.com>,
Jing Liu <liujbjl@linux.vnet.ibm.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information
Date: Tue, 7 Nov 2017 19:00:33 +0800 [thread overview]
Message-ID: <7c5f5d15-2275-7493-d311-73c21e1e1924@linux.vnet.ibm.com> (raw)
In-Reply-To: <a6b1668e-b646-186b-8036-193100f15d54@redhat.com>
在 2017/9/19 21:04, Eric Blake 写道:
> On 09/19/2017 02:43 AM, Christian Borntraeger wrote:
>> From: Jing Liu <liujbjl@linux.vnet.ibm.com>
>>
>> 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.
>>
>> Demonstrate the these ways with examples as follows.
>>
>> Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
>> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> [minor fixes due to upstream feedback]
>> ---
>> V1->V2:
>> - rename kvm-s390 to s390 in all places
>> - add "loop" to the crash reasons where appropriate
>> - use "-" instead of "_" for qapi
>>
>> qapi/run-state.json | 19 ++++++++++++++++--
>> target/s390x/cpu.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> target/s390x/cpu.h | 6 ++++++
>> target/s390x/kvm.c | 29 +++++++++++++++++++++------
>> vl.c | 6 ++++++
>> 5 files changed, 109 insertions(+), 8 deletions(-)
>>
>> diff --git a/qapi/run-state.json b/qapi/run-state.json
>> index d36ff49..4567510 100644
>> --- a/qapi/run-state.json
>> +
>> +##
>> +# @GuestPanicInformationS390:
>> +#
>> +# S390 specific guest panic information (PSW)
>> +#
>> +# Since: 2.11
>> +##
>> +{'struct': 'GuestPanicInformationS390',
>> + 'data': { 'psw-mask': 'uint64',
>> + 'psw-addr': 'uint64',
>> + 'reason': 'str' } }
> Missing documentation of the three fields; in particular, whether
I didn't get your point, do you mean we need to add comments
for the three fields? But I don't see the comments for Hyper-V either.
Thanks
> 'reason' is for human consumption only (presumably the case) rather than
> for machine parsing.
yes, the 'reason' is for human understanding and also investigation but
psw-*
could be used to parse later.
>
>> + cpu_synchronize_state(cs);
>> + panic_info = g_malloc0(sizeof(GuestPanicInformation));
>> +
>> + panic_info->type = GUEST_PANIC_INFORMATION_TYPE_S390;
>> + panic_info->u.s390.psw_mask = cpu->env.psw.mask;
>> + panic_info->u.s390.psw_addr = cpu->env.psw.addr;
>> +
>> + switch (cs->exception_index) {
>> + case EXCP_CRASH_PGM:
>> + panic_info->u.s390.reason = g_strdup("program interrupt loop");
>> + break;
>> + case EXCP_CRASH_EXT:
>> + panic_info->u.s390.reason = g_strdup("external interrupt loop");
>> + break;
>> + case EXCP_CRASH_WAITPSW:
>> + panic_info->u.s390.reason = g_strdup("disabled wait");
>> + break;
>> + case EXCP_CRASH_OPEREXC:
>> + panic_info->u.s390.reason = g_strdup("operation exception loop");
>> + break;
>> + default:
>> + panic_info->u.s390.reason = g_strdup("unknown crash reason");
>> + break;
> Is it worth a QAPI enum type to expose the reason as one of a finite set
> of known strings, or is that information not needed beyond the
> human-only string that you are setting here?
Actually we had considered to use enum type for 'reason' instead of str,
the awkwardness
is that then qemu_system_guest_panicked has to parse the 'reason' before
it prints it, but
qemu_system_guest_panicked is a common function and we don't want to do
more arch
related handling there.
Thanks!
>
--
Regards
QingFeng Hao
next prev parent reply other threads:[~2017-11-07 11:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 7:43 [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information Christian Borntraeger
2017-09-19 13:04 ` Eric Blake
2017-11-07 11:00 ` QingFeng Hao [this message]
2017-11-07 19:35 ` Eric Blake
2017-11-08 6:36 ` QingFeng Hao
2017-09-19 13:06 ` David Hildenbrand
2017-09-19 13:27 ` Christian Borntraeger
2017-09-19 13:14 ` David Hildenbrand
2017-09-19 13:56 ` Christian Borntraeger
2017-09-19 14:39 ` David Hildenbrand
2017-09-20 9:14 ` Cornelia Huck
2017-09-20 11:23 ` Christian Borntraeger
2017-09-20 14:34 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c5f5d15-2275-7493-d311-73c21e1e1924@linux.vnet.ibm.com \
--to=haoqf@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=eblake@redhat.com \
--cc=liujbjl@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).