qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: David Hildenbrand <david@redhat.com>, qemu-s390x <qemu-s390x@nongnu.org>
Cc: Thomas Huth <thuth@redhat.com>,
	Bjoern Walk <bwalk@linux.vnet.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v6] s390x/cpu: expose the guest crash information
Date: Wed, 7 Feb 2018 15:04:56 +0100	[thread overview]
Message-ID: <2bc7ae11-dde0-b195-e5c6-6a99aeb0e9be@de.ibm.com> (raw)
In-Reply-To: <1216cef6-00fd-683d-2bf2-1673ee272c0d@de.ibm.com>



On 02/07/2018 02:29 PM, Christian Borntraeger wrote:
> 
> 
> On 02/07/2018 02:21 PM, David Hildenbrand wrote:
>> On 07.02.2018 13:38, 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.
>>>
>>> Demonstrate these ways with examples as follows.
>>>
>>>   1. crash-information QOM property;
>>>
>>>   Run qemu with -qmp unix:qmp-sock,server, then use utility "qmp-shell"
>>>   to execute "qom-get" command, and might get the result like,
>>>
>>>   (QEMU) (QEMU) qom-get path=/machine/unattached/device[0] \
>>>       property=crash-information
>>>   {"return": {"core": 0, "reason": "disabledwait", "psw-mask": 562956395872256, \
>>>       "type": "s390", "psw-addr": 1102832}}
>>>
>>>   2. GUEST_PANICKED event reporting;
>>>
>>>   Run qemu with a socket option, and telnet or nc to that,
>>>   -chardev socket,id=qmp,port=4444,host=localhost,server \
>>>   -mon chardev=qmp,mode=control,pretty=on \
>>>   Negotiating the mode by { "execute": "qmp_capabilities" }, and the crash
>>>   information will be reported on a guest crash event like,
>>>
>>>   {
>>>     "timestamp": {
>>>         "seconds": 1518004739,
>>>         "microseconds": 552563
>>>     },
>>>     "event": "GUEST_PANICKED",
>>>     "data": {
>>>         "action": "pause",
>>>         "info": {
>>>             "core": 0,
>>>             "psw-addr": 1102832,
>>>             "reason": "disabledwait",
>>>             "psw-mask": 562956395872256,
>>>             "type": "s390"
>>>         }
>>>     }
>>>   }
>>>
>>>   3. log;
>>>
>>>   Run qemu with the parameters: -D <logfile> -d guest_errors, to
>>>   specify the logfile and log item. The results might be,
>>>
>>>   Guest crashed on cpu 0: disabledwait
>>>   PSW: 0x0002000180000000 0x000000000010d3f0
>>>
>>> Co-authored-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>>> ---
>>> V5->V6: - use qapi enum
>>> 	- add core id to the crash parameters
>>> 	- indent fixes
>>> 	- rework debug log message to reuse the enum string
>>> 	- update patch description
>>>
>>>  qapi/run-state.json   | 54 +++++++++++++++++++++++++++++++++++++++++++++++++--
>>>  target/s390x/cpu.c    | 41 ++++++++++++++++++++++++++++++++++++++
>>>  target/s390x/cpu.h    |  2 ++
>>>  target/s390x/helper.c |  5 ++++-
>>>  target/s390x/kvm.c    | 15 +++++++-------
>>>  vl.c                  | 12 ++++++++++--
>>>  6 files changed, 116 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/qapi/run-state.json b/qapi/run-state.json
>>> index bca46a8785..328c86b4bb 100644
>>> --- a/qapi/run-state.json
>>> +++ b/qapi/run-state.json
>>> @@ -320,22 +320,29 @@
>>>  #
>>>  # An enumeration of the guest panic information types
>>>  #
>>> +# @hyper-v: hyper-v guest panic information type
>>> +#
>>> +# @s390: s390 guest panic information type (Since: 2.12)
>>> +#
>>>  # Since: 2.9
>>>  ##
>>>  { 'enum': 'GuestPanicInformationType',
>>> -  'data': [ 'hyper-v'] }
>>> +  'data': [ 'hyper-v', 's390' ] }
>>>  
>>>  ##
>>>  # @GuestPanicInformation:
>>>  #
>>>  # Information about a guest panic
>>>  #
>>> +# @type: Crash type that defines the hypervisor specific information
>>> +#
>>>  # Since: 2.9
>>>  ##
>>>  {'union': 'GuestPanicInformation',
>>>   'base': {'type': 'GuestPanicInformationType'},
>>>   'discriminator': 'type',
>>> - 'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
>>> + 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
>>> +           's390': 'GuestPanicInformationS390' } }
>>>  
>>>  ##
>>>  # @GuestPanicInformationHyperV:
>>> @@ -350,3 +357,46 @@
>>>             'arg3': 'uint64',
>>>             'arg4': 'uint64',
>>>             'arg5': 'uint64' } }
>>> +
>>> +##
>>> +# @S390CrashReason:
>>> +#
>>> +# Reason why the CPU is in a crashed state.
>>> +#
>>> +# @unknown: no crash reason was set
>>> +#
>>> +# @disabledwait: the CPU has entered a disabled wait state
>>> +#
>>> +# @extintloop: timer interrupt with new PSW enabled for timer
>>
>> Is this CPU timer or CKC? Or both?
> 
> both. The kernel will give this to QEMU if one timer is going to be
> delivered but the new PSW is enabled for external interrupts.

What about:

diff --git a/qapi/run-state.json b/qapi/run-state.json
index 328c86b4bb..c7b2ab84be 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -367,7 +367,8 @@
 #
 # @disabledwait: the CPU has entered a disabled wait state
 #
-# @extintloop: timer interrupt with new PSW enabled for timer
+# @extintloop: clock comparator or cpu timer interrupt with new PSW enabled
+#              for external interrupts
 #
 # @pgmintloop: program interrupt with BAD new PSW
 #

  reply	other threads:[~2018-02-07 14:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 12:38 [Qemu-devel] [PATCH v6] s390x/cpu: expose the guest crash information Christian Borntraeger
2018-02-07 13:07 ` no-reply
2018-02-07 13:15   ` Christian Borntraeger
2018-02-07 13:21 ` David Hildenbrand
2018-02-07 13:29   ` Christian Borntraeger
2018-02-07 14:04     ` Christian Borntraeger [this message]
2018-02-07 14:32       ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
2018-02-07 14:12 ` [Qemu-devel] " no-reply
2018-02-07 16:58 ` Cornelia Huck
2018-02-07 17:56   ` Eric Blake
2018-02-07 18:15   ` Christian Borntraeger
2018-02-08  8:09     ` Cornelia Huck
2018-02-07 18:44 ` Christian Borntraeger
2018-02-07 19:11   ` 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=2bc7ae11-dde0-b195-e5c6-6a99aeb0e9be@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=bwalk@linux.vnet.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fiuczy@linux.vnet.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --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).