All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bradley Morgan <include@grrlz.net>
To: akpm@linux-foundation.org
Cc: pmladek@suse.com, include@grrlz.net, baoquan.he@linux.dev,
	arnd@arndb.de, corbet@lwn.net, gregkh@linuxfoundation.org,
	rdunlap@infradead.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, feng.tang@linux.alibaba.com
Subject: [RFC PATCH 3/4] misc/pvpanic: notify the host on the pre kdump list
Date: Sat, 11 Jul 2026 00:22:52 +0000	[thread overview]
Message-ID: <20260711002253.1115-4-include@grrlz.net> (raw)
In-Reply-To: <20260711002253.1115-1-include@grrlz.net>

Writing the panic event to the pvpanic device is a self contained
upcall, and pvpanic_send_event() already takes pvpanic_lock with a
trylock, so the callback satisfies the contract as is.

The INT_MAX priority is kept so the host hears about the panic
before anything else on the list runs.

Signed-off-by: Bradley Morgan <include@grrlz.net>
---
 drivers/misc/pvpanic/pvpanic.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
index 17c0eb549463..c409968228e4 100644
--- a/drivers/misc/pvpanic/pvpanic.c
+++ b/drivers/misc/pvpanic/pvpanic.c
@@ -218,7 +218,7 @@ static int pvpanic_init(void)
 	INIT_LIST_HEAD(&pvpanic_list);
 	spin_lock_init(&pvpanic_lock);
 
-	atomic_notifier_chain_register(&panic_notifier_list, &pvpanic_panic_nb);
+	panic_notifier_register_pre_kdump(&pvpanic_panic_nb);
 
 	return 0;
 }
@@ -226,7 +226,6 @@ module_init(pvpanic_init);
 
 static void pvpanic_exit(void)
 {
-	atomic_notifier_chain_unregister(&panic_notifier_list, &pvpanic_panic_nb);
-
+	panic_notifier_unregister_pre_kdump(&pvpanic_panic_nb);
 }
 module_exit(pvpanic_exit);
-- 
2.53.0



WARNING: multiple messages have this Message-ID (diff)
From: Bradley Morgan <include@grrlz.net>
To: akpm@linux-foundation.org
Cc: baoquan.he@linux.dev, pmladek@suse.com,
	feng.tang@linux.alibaba.com, gregkh@linuxfoundation.org,
	arnd@arndb.de, corbet@lwn.net, rdunlap@infradead.org,
	gpiccoli@igalia.com, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, include@grrlz.net
Subject: [RFC PATCH 3/4] misc/pvpanic: notify the host on the pre kdump list
Date: Sat, 11 Jul 2026 00:22:52 +0000	[thread overview]
Message-ID: <20260711002253.1115-4-include@grrlz.net> (raw)
In-Reply-To: <20260711002253.1115-1-include@grrlz.net>

Writing the panic event to the pvpanic device is a self contained
upcall, and pvpanic_send_event() already takes pvpanic_lock with a
trylock, so the callback satisfies the contract as is.

The INT_MAX priority is kept so the host hears about the panic
before anything else on the list runs.

Signed-off-by: Bradley Morgan <include@grrlz.net>
---
 drivers/misc/pvpanic/pvpanic.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
index 17c0eb549463..c409968228e4 100644
--- a/drivers/misc/pvpanic/pvpanic.c
+++ b/drivers/misc/pvpanic/pvpanic.c
@@ -218,7 +218,7 @@ static int pvpanic_init(void)
 	INIT_LIST_HEAD(&pvpanic_list);
 	spin_lock_init(&pvpanic_lock);
 
-	atomic_notifier_chain_register(&panic_notifier_list, &pvpanic_panic_nb);
+	panic_notifier_register_pre_kdump(&pvpanic_panic_nb);
 
 	return 0;
 }
@@ -226,7 +226,6 @@ module_init(pvpanic_init);
 
 static void pvpanic_exit(void)
 {
-	atomic_notifier_chain_unregister(&panic_notifier_list, &pvpanic_panic_nb);
-
+	panic_notifier_unregister_pre_kdump(&pvpanic_panic_nb);
 }
 module_exit(pvpanic_exit);
-- 
2.53.0


  parent reply	other threads:[~2026-07-11  0:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-11  0:22 [RFC PATCH 0/4] panic: a pre kdump notifier list for hypervisor upcalls Bradley Morgan
2026-07-11  0:22 ` Bradley Morgan
2026-07-11  0:22 ` [RFC PATCH 1/4] panic: add a pre kdump notifier list Bradley Morgan
2026-07-11  0:22   ` Bradley Morgan
2026-07-11  0:22 ` [RFC PATCH 2/4] panic: run the pre kdump list before crash kexec Bradley Morgan
2026-07-11  0:22   ` Bradley Morgan
2026-07-11  0:22 ` Bradley Morgan [this message]
2026-07-11  0:22   ` [RFC PATCH 3/4] misc/pvpanic: notify the host on the pre kdump list Bradley Morgan
2026-07-11  0:22 ` [RFC PATCH 4/4] MAINTAINERS: add an entry for the pre kdump notifier list Bradley Morgan
2026-07-11  0:22   ` Bradley Morgan

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=20260711002253.1115-4-include@grrlz.net \
    --to=include@grrlz.net \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=baoquan.he@linux.dev \
    --cc=corbet@lwn.net \
    --cc=feng.tang@linux.alibaba.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rdunlap@infradead.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.