[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PH0PR21MB30256260CCF4CAB713BBB11ED7FC9@PH0PR21MB3025.namprd21.prod.outlook.com>
Date: Fri, 29 Apr 2022 17:30:44 +0000
From: "Michael Kelley (LINUX)" <mikelley@...rosoft.com>
To: "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"bhe@...hat.com" <bhe@...hat.com>,
"pmladek@...e.com" <pmladek@...e.com>,
"kexec@...ts.infradead.org" <kexec@...ts.infradead.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bcm-kernel-feedback-list@...adcom.com"
<bcm-kernel-feedback-list@...adcom.com>,
"coresight@...ts.linaro.org" <coresight@...ts.linaro.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-alpha@...r.kernel.org" <linux-alpha@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
"linux-parisc@...r.kernel.org" <linux-parisc@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-remoteproc@...r.kernel.org" <linux-remoteproc@...r.kernel.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-um@...ts.infradead.org" <linux-um@...ts.infradead.org>,
"linux-xtensa@...ux-xtensa.org" <linux-xtensa@...ux-xtensa.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"openipmi-developer@...ts.sourceforge.net"
<openipmi-developer@...ts.sourceforge.net>,
"rcu@...r.kernel.org" <rcu@...r.kernel.org>,
"sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>,
"xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
"x86@...nel.org" <x86@...nel.org>,
"kernel-dev@...lia.com" <kernel-dev@...lia.com>,
"kernel@...ccoli.net" <kernel@...ccoli.net>,
"halves@...onical.com" <halves@...onical.com>,
"fabiomirmar@...il.com" <fabiomirmar@...il.com>,
"alejandro.j.jimenez@...cle.com" <alejandro.j.jimenez@...cle.com>,
"andriy.shevchenko@...ux.intel.com"
<andriy.shevchenko@...ux.intel.com>,
"arnd@...db.de" <arnd@...db.de>, "bp@...en8.de" <bp@...en8.de>,
"corbet@....net" <corbet@....net>,
"d.hatayama@...fujitsu.com" <d.hatayama@...fujitsu.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"dyoung@...hat.com" <dyoung@...hat.com>,
"feng.tang@...el.com" <feng.tang@...el.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"hidehiro.kawai.ez@...achi.com" <hidehiro.kawai.ez@...achi.com>,
"jgross@...e.com" <jgross@...e.com>,
"john.ogness@...utronix.de" <john.ogness@...utronix.de>,
"keescook@...omium.org" <keescook@...omium.org>,
"luto@...nel.org" <luto@...nel.org>,
"mhiramat@...nel.org" <mhiramat@...nel.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"paulmck@...nel.org" <paulmck@...nel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"senozhatsky@...omium.org" <senozhatsky@...omium.org>,
"stern@...land.harvard.edu" <stern@...land.harvard.edu>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"vgoyal@...hat.com" <vgoyal@...hat.com>,
vkuznets <vkuznets@...hat.com>,
"will@...nel.org" <will@...nel.org>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Andrea Parri <parri.andrea@...il.com>,
Ard Biesheuvel <ardb@...nel.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Brian Norris <computersforpeace@...il.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
David Gow <davidgow@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Dexuan Cui <decui@...rosoft.com>,
Doug Berger <opendmb@...il.com>,
Evan Green <evgreen@...omium.org>,
Florian Fainelli <f.fainelli@...il.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Hari Bathini <hbathini@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Julius Werner <jwerner@...omium.org>,
Justin Chen <justinpopo6@...il.com>,
KY Srinivasan <kys@...rosoft.com>,
Lee Jones <lee.jones@...aro.org>,
Markus Mayer <mmayer@...adcom.com>,
Michael Ellerman <mpe@...erman.id.au>,
Mihai Carabas <mihai.carabas@...cle.com>,
Nicholas Piggin <npiggin@...il.com>,
Paul Mackerras <paulus@...ba.org>, Pavel Machek <pavel@....cz>,
Scott Branden <scott.branden@...adcom.com>,
Sebastian Reichel <sre@...nel.org>,
Shile Zhang <shile.zhang@...ux.alibaba.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Tianyu Lan <Tianyu.Lan@...rosoft.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Wang ShaoBo <bobo.shaobowang@...wei.com>,
Wei Liu <wei.liu@...nel.org>,
zhenwei pi <pizhenwei@...edance.com>
Subject: RE: [PATCH 19/30] panic: Add the panic hypervisor notifier list
From: Guilherme G. Piccoli <gpiccoli@...lia.com> 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@...ux.ibm.com>
> Cc: Andrea Parri (Microsoft) <parri.andrea@...il.com>
> Cc: Ard Biesheuvel <ardb@...nel.org>
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Cc: Brian Norris <computersforpeace@...il.com>
> Cc: Christian Borntraeger <borntraeger@...ux.ibm.com>
> Cc: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Cc: David Gow <davidgow@...gle.com>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Dexuan Cui <decui@...rosoft.com>
> Cc: Doug Berger <opendmb@...il.com>
> Cc: Evan Green <evgreen@...omium.org>
> Cc: Florian Fainelli <f.fainelli@...il.com>
> Cc: Haiyang Zhang <haiyangz@...rosoft.com>
> Cc: Hari Bathini <hbathini@...ux.ibm.com>
> Cc: Heiko Carstens <hca@...ux.ibm.com>
> Cc: Julius Werner <jwerner@...omium.org>
> Cc: Justin Chen <justinpopo6@...il.com>
> Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
> Cc: Lee Jones <lee.jones@...aro.org>
> Cc: Markus Mayer <mmayer@...adcom.com>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: Michael Kelley <mikelley@...rosoft.com>
> Cc: Mihai Carabas <mihai.carabas@...cle.com>
> Cc: Nicholas Piggin <npiggin@...il.com>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Pavel Machek <pavel@....cz>
> Cc: Scott Branden <scott.branden@...adcom.com>
> Cc: Sebastian Reichel <sre@...nel.org>
> Cc: Shile Zhang <shile.zhang@...ux.alibaba.com>
> Cc: Stephen Hemminger <sthemmin@...rosoft.com>
> Cc: Sven Schnelle <svens@...ux.ibm.com>
> Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
> Cc: Tianyu Lan <Tianyu.Lan@...rosoft.com>
> Cc: Vasily Gorbik <gor@...ux.ibm.com>
> Cc: Wang ShaoBo <bobo.shaobowang@...wei.com>
> Cc: Wei Liu <wei.liu@...nel.org>
> Cc: zhenwei pi <pizhenwei@...edance.com>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@...lia.com>
> ---
> 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.
Powered by blists - more mailing lists