All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Julien Grall <julien@xen.org>, Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3] xen: add support for automatic debug key actions in case of crash
Date: Fri, 11 Dec 2020 08:02:45 +0100	[thread overview]
Message-ID: <7271b2f4-816a-5541-5402-50ea29218d81@suse.com> (raw)
In-Reply-To: <1e305cf6-aa14-54cc-a77d-88bb38ba4c6e@xen.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 3248 bytes --]

On 10.12.20 21:51, Julien Grall wrote:
> Hi Jan,
> 
> On 09/12/2020 14:29, Jan Beulich wrote:
>> On 09.12.2020 13:11, Julien Grall wrote:
>>> On 26/11/2020 11:20, Jan Beulich wrote:
>>>> On 26.11.2020 09:03, Juergen Gross wrote:
>>>>> When the host crashes it would sometimes be nice to have additional
>>>>> debug data available which could be produced via debug keys, but
>>>>> halting the server for manual intervention might be impossible due to
>>>>> the need to reboot/kexec rather sooner than later.
>>>>>
>>>>> Add support for automatic debug key actions in case of crashes which
>>>>> can be activated via boot- or runtime-parameter.
>>>>>
>>>>> Depending on the type of crash the desired data might be different, so
>>>>> support different settings for the possible types of crashes.
>>>>>
>>>>> The parameter is "crash-debug" with the following syntax:
>>>>>
>>>>>     crash-debug-<type>=<string>
>>>>>
>>>>> with <type> being one of:
>>>>>
>>>>>     panic, hwdom, watchdog, kexeccmd, debugkey
>>>>>
>>>>> and <string> a sequence of debug key characters with '+' having the
>>>>> special semantics of a 10 millisecond pause.
>>>>>
>>>>> So "crash-debug-watchdog=0+0qr" would result in special output in case
>>>>> of watchdog triggered crash (dom0 state, 10 ms pause, dom0 state,
>>>>> domain info, run queues).
>>>>>
>>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>>> ---
>>>>> V2:
>>>>> - switched special character '.' to '+' (Jan Beulich)
>>>>> - 10 ms instead of 1 s pause (Jan Beulich)
>>>>> - added more text to the boot parameter description (Jan Beulich)
>>>>>
>>>>> V3:
>>>>> - added const (Jan Beulich)
>>>>> - thorough test of crash reason parameter (Jan Beulich)
>>>>> - kexeccmd case should depend on CONFIG_KEXEC (Jan Beulich)
>>>>> - added dummy get_irq_regs() helper on Arm
>>>>>
>>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>>
>>>> Except for the Arm aspect, where I'm not sure using
>>>> guest_cpu_user_regs() is correct in all cases,
>>>
>>> I am not entirely sure to understand what get_irq_regs() is supposed to
>>> returned on x86. Is it the registers saved from the most recent 
>>> exception?
>>
>> An interrupt (not an exception) sets the underlying per-CPU
>> variable, such that interested parties will know the real
>> context is not guest or "normal" Xen code, but an IRQ.
> 
> Thanks for the explanation. I am a bit confused to why we need to give a 
> regs to handle_keypress() because no-one seems to use it. Do you have an 
> explanation?

dump_registers() (key 'd') is using it.

> 
> To add to the confusion, it looks like that get_irqs_regs() may return 
> NULL. So sometimes we may pass guest_cpu_regs() (which may contain 
> garbagge or a set too far).

I guess this is a best effort approach.

> 
> I guess providing the wrong information to handle_keypress() is not 
> going to matter that much because no-one use it (?). Although, I'd like 
> to make sure this is not going to bite us in the future.

TBH using the 'd' handler isn't making that much sense, as the
information delivered would be of interest only in case of a panic(),
which is already printing that information.


Juergen

[-- Attachment #1.1.2: OpenPGP_0xB0DE9DD628BF132F.asc --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2020-12-11  7:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  8:03 [PATCH v3] xen: add support for automatic debug key actions in case of crash Juergen Gross
2020-11-26 11:20 ` Jan Beulich
2020-12-05  1:06   ` Stefano Stabellini
2020-12-09 12:11   ` Julien Grall
2020-12-09 14:29     ` Jan Beulich
2020-12-10 20:51       ` Julien Grall
2020-12-11  7:02         ` Jürgen Groß [this message]
2020-12-11  7:24           ` Jan Beulich
2020-12-11  7:29             ` Jürgen Groß
2020-12-11 10:22             ` Julien Grall
2020-12-11 10:38               ` Jürgen Groß
2020-12-11 10:49                 ` Julien Grall
2020-12-11 10:51                   ` Jürgen Groß
2020-12-11 10:44               ` Jan Beulich

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=7271b2f4-816a-5541-5402-50ea29218d81@suse.com \
    --to=jgross@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.