[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 19/30] panic: Add the panic hypervisor notifier list
 
- To: "Guilherme G. Piccoli" <gpiccoli@xxxxxxxxxx>, "akpm@xxxxxxxxxxxxxxxxxxxx"	<akpm@xxxxxxxxxxxxxxxxxxxx>, "bhe@xxxxxxxxxx" <bhe@xxxxxxxxxx>,	"pmladek@xxxxxxxx" <pmladek@xxxxxxxx>, "kexec@xxxxxxxxxxxxxxxxxxx"	<kexec@xxxxxxxxxxxxxxxxxxx>
 
- From: "Michael Kelley (LINUX)" <mikelley@xxxxxxxxxxxxx>
 
- Date: Fri, 29 Apr 2022 17:30:44 +0000
 
- Accept-language: en-US
 
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
 
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1lb7HJaoovhC6aIWP9rKJ4VgGH06NMpJYC4i1j5JxsI=; b=cllHTkoF7/QGmRKVAfZLbB2EINE8+FyPVK/DhZU1IvHmvPGKiv37XAYsy2ztQQZBV0S2wCJT80Qzf+ODT8pn9hxUAriFcnDhg0MQtoQDmk99sbR4eoHjIBnESHA8RFpDL0QZ9TQIFYrTQ1sa0LxWuC2wFr9KEoOKWkswbeTWdtT8qAKyinjpnI2y79/6J5xxB374yWzqyHNG2OYd8Xse8Q49miwVkxuAjSdxGMc/d6kQcSSLV+ETreRF9TXQzVouszl+GMZqY9q76aTtD+gRUELbgbQQXH756uY5Jmx8Y7/63+0pYcIqxk4hn9ecg4cqgoQJyCOfZkljvQwjcZgnhw==
 
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XTnYIoTyFDjM5JUklkUkeZSVHdB/KbpjWUKMrwxPKtMBCELnhwwVxh3SyOWp+1En+lBB80Pmi2MOFKxrdFIAO1tVkwmz31aHf3c0WXJgTJO4H8WZ8wWDi+ZLogiDuQYv43MvDvBMsiShc3M4W6FuR/wPAy1Edr9Ejm4EmMmHgoezg8BixUKBI7OUSVmU0/dlrFC57AU3xqY9yjnUIy1vXdv9nlj9XWZBE29iaC+cnW5L/0PZPRadrHbf3+g4UC7EMWCusYpZlk+0nFrTbZZbgil9754PaHuq87Xs5x2NPKguVl+xJisWMMhTPBDhnZUpXDwN8SYDRRPJVsZL70yHUw==
 
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com;
 
- Cc: "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>,	"bcm-kernel-feedback-list@xxxxxxxxxxxx"	<bcm-kernel-feedback-list@xxxxxxxxxxxx>, "coresight@xxxxxxxxxxxxxxxx"	<coresight@xxxxxxxxxxxxxxxx>, "linuxppc-dev@xxxxxxxxxxxxxxxx"	<linuxppc-dev@xxxxxxxxxxxxxxxx>, "linux-alpha@xxxxxxxxxxxxxxx"	<linux-alpha@xxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx"	<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-edac@xxxxxxxxxxxxxxx"	<linux-edac@xxxxxxxxxxxxxxx>, "linux-hyperv@xxxxxxxxxxxxxxx"	<linux-hyperv@xxxxxxxxxxxxxxx>, "linux-leds@xxxxxxxxxxxxxxx"	<linux-leds@xxxxxxxxxxxxxxx>, "linux-mips@xxxxxxxxxxxxxxx"	<linux-mips@xxxxxxxxxxxxxxx>, "linux-parisc@xxxxxxxxxxxxxxx"	<linux-parisc@xxxxxxxxxxxxxxx>, "linux-pm@xxxxxxxxxxxxxxx"	<linux-pm@xxxxxxxxxxxxxxx>, "linux-remoteproc@xxxxxxxxxxxxxxx"	<linux-remoteproc@xxxxxxxxxxxxxxx>, "linux-s390@xxxxxxxxxxxxxxx"	<linux-s390@xxxxxxxxxxxxxxx>, "linux-tegra@xxxxxxxxxxxxxxx"	<linux-tegra@xxxxxxxxxxxxxxx>, "linux-um@xxxxxxxxxxxxxxxxxxx"	<linux-um@xxxxxxxxxxxxxxxxxxx>, "linux-xtensa@xxxxxxxxxxxxxxxx"	<linux-xtensa@xxxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxxxxxx"	<netdev@xxxxxxxxxxxxxxx>, "openipmi-developer@xxxxxxxxxxxxxxxxxxxxx"	<openipmi-developer@xxxxxxxxxxxxxxxxxxxxx>, "rcu@xxxxxxxxxxxxxxx"	<rcu@xxxxxxxxxxxxxxx>, "sparclinux@xxxxxxxxxxxxxxx"	<sparclinux@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx"	<xen-devel@xxxxxxxxxxxxxxxxxxxx>, "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>,	"kernel-dev@xxxxxxxxxx" <kernel-dev@xxxxxxxxxx>, "kernel@xxxxxxxxxxxx"	<kernel@xxxxxxxxxxxx>, "halves@xxxxxxxxxxxxx" <halves@xxxxxxxxxxxxx>,	"fabiomirmar@xxxxxxxxx" <fabiomirmar@xxxxxxxxx>,	"alejandro.j.jimenez@xxxxxxxxxx" <alejandro.j.jimenez@xxxxxxxxxx>,	"andriy.shevchenko@xxxxxxxxxxxxxxx" <andriy.shevchenko@xxxxxxxxxxxxxxx>,	"arnd@xxxxxxxx" <arnd@xxxxxxxx>, "bp@xxxxxxxxx" <bp@xxxxxxxxx>,	"corbet@xxxxxxx" <corbet@xxxxxxx>, "d.hatayama@xxxxxxxxxxxxxx"	<d.hatayama@xxxxxxxxxxxxxx>, "dave.hansen@xxxxxxxxxxxxxxx"	<dave.hansen@xxxxxxxxxxxxxxx>, "dyoung@xxxxxxxxxx" <dyoung@xxxxxxxxxx>,	"feng.tang@xxxxxxxxx" <feng.tang@xxxxxxxxx>, "gregkh@xxxxxxxxxxxxxxxxxxx"	<gregkh@xxxxxxxxxxxxxxxxxxx>, "hidehiro.kawai.ez@xxxxxxxxxxx"	<hidehiro.kawai.ez@xxxxxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>,	"john.ogness@xxxxxxxxxxxxx" <john.ogness@xxxxxxxxxxxxx>,	"keescook@xxxxxxxxxxxx" <keescook@xxxxxxxxxxxx>, "luto@xxxxxxxxxx"	<luto@xxxxxxxxxx>, "mhiramat@xxxxxxxxxx" <mhiramat@xxxxxxxxxx>,	"mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "paulmck@xxxxxxxxxx"	<paulmck@xxxxxxxxxx>, "peterz@xxxxxxxxxxxxx" <peterz@xxxxxxxxxxxxx>,	"rostedt@xxxxxxxxxxx" <rostedt@xxxxxxxxxxx>, "senozhatsky@xxxxxxxxxxxx"	<senozhatsky@xxxxxxxxxxxx>, "stern@xxxxxxxxxxxxxxxxxxx"	<stern@xxxxxxxxxxxxxxxxxxx>, "tglx@xxxxxxxxxxxxx" <tglx@xxxxxxxxxxxxx>,	"vgoyal@xxxxxxxxxx" <vgoyal@xxxxxxxxxx>, vkuznets <vkuznets@xxxxxxxxxx>,	"will@xxxxxxxxxx" <will@xxxxxxxxxx>, Alexander Gordeev	<agordeev@xxxxxxxxxxxxx>, Andrea Parri <parri.andrea@xxxxxxxxx>, Ard Biesheuvel <ardb@xxxxxxxxxx>, Benjamin Herrenschmidt	<benh@xxxxxxxxxxxxxxxxxxx>, Brian Norris <computersforpeace@xxxxxxxxx>,	Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Christophe JAILLET	<christophe.jaillet@xxxxxxxxxx>, David Gow <davidgow@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Dexuan Cui <decui@xxxxxxxxxxxxx>, Doug Berger	<opendmb@xxxxxxxxx>, Evan Green <evgreen@xxxxxxxxxxxx>, Florian Fainelli	<f.fainelli@xxxxxxxxx>, Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>, Hari Bathini	<hbathini@xxxxxxxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Julius Werner	<jwerner@xxxxxxxxxxxx>, Justin Chen <justinpopo6@xxxxxxxxx>, KY Srinivasan	<kys@xxxxxxxxxxxxx>, Lee Jones <lee.jones@xxxxxxxxxx>, Markus Mayer	<mmayer@xxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Mihai Carabas	<mihai.carabas@xxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Pavel Machek <pavel@xxxxxx>, Scott Branden	<scott.branden@xxxxxxxxxxxx>, Sebastian Reichel <sre@xxxxxxxxxx>, Shile Zhang	<shile.zhang@xxxxxxxxxxxxxxxxx>, Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>,	Sven Schnelle <svens@xxxxxxxxxxxxx>, Thomas Bogendoerfer	<tsbogend@xxxxxxxxxxxxxxxx>, Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>, Vasily Gorbik <gor@xxxxxxxxxxxxx>, Wang ShaoBo <bobo.shaobowang@xxxxxxxxxx>, Wei Liu	<wei.liu@xxxxxxxxxx>, zhenwei pi <pizhenwei@xxxxxxxxxxxxx>
 
- Delivery-date: Fri, 29 Apr 2022 17:31:31 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
- Msip_labels:  MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=ffbe4afc-a779-4ef6-ac4b-fe8bbe7e97a6;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-04-29T17:17:23Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
 
- Thread-index: AQHYWonjjKMtrubrvUiw63ryI2yC7q0HJOjg
 
- Thread-topic: [PATCH 19/30] panic: Add the panic hypervisor notifier list
 
 
 
From: Guilherme G. Piccoli <gpiccoli@xxxxxxxxxx> Sent: Wednesday, April 27, 
2022 3:49 PM
> 
> The goal of this new panic notifier is to allow its users to register
> callbacks to run very early in the panic path. This aims hypervisor/FW
> notification mechanisms as well as simple LED functions, and any other
> simple and safe mechanism that should run early in the panic path; more
> dangerous callbacks should execute later.
> 
> For now, the patch is almost a no-op (although it changes a bit the
> ordering in which some panic notifiers are executed). In a subsequent
> patch, the panic path will be refactored, then the panic hypervisor
> notifiers will effectively run very early in the panic path.
> 
> We also defer documenting it all properly in the subsequent refactor
> patch. While at it, we removed some useless header inclusions and
> fixed some notifiers return too (by using the standard NOTIFY_DONE).
> 
> Cc: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
> Cc: Andrea Parri (Microsoft) <parri.andrea@xxxxxxxxx>
> Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>
> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> Cc: Brian Norris <computersforpeace@xxxxxxxxx>
> Cc: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>
> Cc: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> Cc: David Gow <davidgow@xxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Dexuan Cui <decui@xxxxxxxxxxxxx>
> Cc: Doug Berger <opendmb@xxxxxxxxx>
> Cc: Evan Green <evgreen@xxxxxxxxxxxx>
> Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
> Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> Cc: Hari Bathini <hbathini@xxxxxxxxxxxxx>
> Cc: Heiko Carstens <hca@xxxxxxxxxxxxx>
> Cc: Julius Werner <jwerner@xxxxxxxxxxxx>
> Cc: Justin Chen <justinpopo6@xxxxxxxxx>
> Cc: "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>
> Cc: Lee Jones <lee.jones@xxxxxxxxxx>
> Cc: Markus Mayer <mmayer@xxxxxxxxxxxx>
> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> Cc: Michael Kelley <mikelley@xxxxxxxxxxxxx>
> Cc: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
> Cc: Nicholas Piggin <npiggin@xxxxxxxxx>
> Cc: Paul Mackerras <paulus@xxxxxxxxx>
> Cc: Pavel Machek <pavel@xxxxxx>
> Cc: Scott Branden <scott.branden@xxxxxxxxxxxx>
> Cc: Sebastian Reichel <sre@xxxxxxxxxx>
> Cc: Shile Zhang <shile.zhang@xxxxxxxxxxxxxxxxx>
> Cc: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
> Cc: Sven Schnelle <svens@xxxxxxxxxxxxx>
> Cc: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
> Cc: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>
> Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx>
> Cc: Wang ShaoBo <bobo.shaobowang@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu@xxxxxxxxxx>
> Cc: zhenwei pi <pizhenwei@xxxxxxxxxxxxx>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@xxxxxxxxxx>
> ---
>  arch/mips/sgi-ip22/ip22-reset.c          | 2 +-
>  arch/mips/sgi-ip32/ip32-reset.c          | 3 +--
>  arch/powerpc/kernel/setup-common.c       | 2 +-
>  arch/sparc/kernel/sstate.c               | 3 +--
>  drivers/firmware/google/gsmi.c           | 4 ++--
>  drivers/hv/vmbus_drv.c                   | 4 ++--
>  drivers/leds/trigger/ledtrig-activity.c  | 4 ++--
>  drivers/leds/trigger/ledtrig-heartbeat.c | 4 ++--
>  drivers/misc/bcm-vk/bcm_vk_dev.c         | 6 +++---
>  drivers/misc/pvpanic/pvpanic.c           | 4 ++--
>  drivers/power/reset/ltc2952-poweroff.c   | 4 ++--
>  drivers/s390/char/zcore.c                | 5 +++--
>  drivers/soc/bcm/brcmstb/pm/pm-arm.c      | 2 +-
>  include/linux/panic_notifier.h           | 1 +
>  kernel/panic.c                           | 4 ++++
>  15 files changed, 28 insertions(+), 24 deletions(-)
[ snip]
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index f37f12d48001..901b97034308 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -1614,7 +1614,7 @@ static int vmbus_bus_init(void)
>                       hv_kmsg_dump_register();
> 
>               register_die_notifier(&hyperv_die_report_block);
> -             atomic_notifier_chain_register(&panic_notifier_list,
> +             atomic_notifier_chain_register(&panic_hypervisor_list,
>                                               &hyperv_panic_report_block);
>       }
> 
> @@ -2843,7 +2843,7 @@ static void __exit vmbus_exit(void)
>       if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
>               kmsg_dump_unregister(&hv_kmsg_dumper);
>               unregister_die_notifier(&hyperv_die_report_block);
> -             atomic_notifier_chain_unregister(&panic_notifier_list,
> +             atomic_notifier_chain_unregister(&panic_hypervisor_list,
>                                               &hyperv_panic_report_block);
>       }
> 
Using the hypervisor_list here produces a bit of a mismatch.  In many cases
this notifier will do nothing, and will defer to the kmsg_dump() mechanism
to notify the hypervisor about the panic.   Running the kmsg_dump()
mechanism is linked to the info_list, so I'm thinking the Hyper-V panic report
notifier should be on the info_list as well.  That way the reporting behavior
is triggered at the same point in the panic path regardless of which
reporting mechanism is used.
 
    
     |