* [PATCH v4 0/4] panic, x86/vmware: Preserve crash logs before kdump
@ 2026-11-18 6:01 ` Zack Rusin
0 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: linux-doc, Kees Cook, Dave Hansen, Stephen Brennan, Bo Gan,
H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, linux-kernel,
Ian Forbes, Sergey Senozhatsky, Thomas Gleixner
This series lets VMware guests copy the end of their kernel log to
the host's vmware.log when they crash, before entering kdump. This
preserves diagnostic information even if the guest cannot save its
own logs or the crash dump fails.
Using the existing panic notifier list for this would require
crash_kexec_post_notifiers=1, which also runs unrelated callbacks
before kdump. Following Petr's suggestion, v3 instead adds a separate
platform panic notifier list for callbacks that need to run early.
It runs before kdump and before stopping the other CPUs. It also
covers fatal oopses that enter kdump without going through panic().
The callbacks run at most once, and the list can be disabled for
debugging with disable_panic_notifiers_platform_list.
crash_kexec_post_notifiers, the existing panic notifiers and the
kmsg dumpers are unchanged.
The VMware log sender is the first user. It uses a preallocated
8 KiB buffer and limits both the transfer size and the number of
retries. Logging is enabled by default in ordinary guests; encrypted
guests must opt in through kernel.vmware_record_panic_msg. The copy
is best-effort: kdump and reboot do not depend on it succeeding.
The separate VMware guest-crash notification, which can cause the
host to terminate the VM, is a kmsg dumper registered late in boot,
so it runs after the built-in log dumpers. It is suppressed while a
crash kernel is loaded.
Changes since v3:
- Call the platform list before taking the kexec lock in __crash_kexec(),
so a callback that panics on a direct crash_kexec() can still enter
kdump (reported by Sashiko).
- Rebase onto v7.4-rc3.
Changes since v2:
- Replace the pre-kdump list and postponement parameter with the
platform list and a debugging switch to disable it.
- Run the list in vpanic() before the other CPUs are stopped,
instead of just before the kmsg dumpers.
- Correct the sysctl documentation heading.
- Rebase onto v7.4-rc1.
Tested on x86-64 guests on VMware Workstation, ESXi (ordinary,
SEV-SNP and TDX) and QEMU/KVM.
Platform list proposal:
https://lore.kernel.org/r/ateYxCu63pRY9EGq@pathway.suse.cz
v3:
https://lore.kernel.org/r/cover.1794201807.git.zack.rusin@broadcom.com
v2:
https://lore.kernel.org/r/cover.1790014793.git.zack.rusin@broadcom.com
v1:
https://lore.kernel.org/r/cover.1788414671.git.zack.rusin@broadcom.com
Zack Rusin (4):
panic: Add a platform panic notifier list
x86/vmware: Add a bounded panic log sender
x86/vmware: Add the vmware_record_panic_msg sysctl
x86/vmware: Report guest crashes after kmsg dumpers
.../admin-guide/kernel-parameters.txt | 12 +
Documentation/admin-guide/sysctl/kernel.rst | 20 ++
arch/x86/include/asm/vmware.h | 2 +
arch/x86/kernel/cpu/vmware.c | 250 ++++++++++++++++++
include/linux/panic_notifier.h | 3 +
kernel/crash_core.c | 8 +
kernel/panic.c | 51 ++++
7 files changed, 346 insertions(+)
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH v4 1/4] panic: Add a platform panic notifier list
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:01 ` Zack Rusin
-1 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, linux-kernel,
John Ogness, Steven Rostedt, Sergey Senozhatsky, Kees Cook,
Jonathan Corbet, Bo Gan, Brennan Lamoreaux, kexec, linux-doc,
Guilherme G. Piccoli, Maaz Mombasawala, Shuah Khan, Randy Dunlap,
Stephen Brennan, Michael Kelley, Ian Forbes, Bradley Morgan
Some platforms set crash_kexec_post_notifiers so their crash handlers
run before kdump. That also runs every other panic notifier and kmsg
dumper before the crash kernel.
Add panic_notifiers_platform_list for platform callbacks that need to
run early and are safe while other CPUs are still running. Call it
from vpanic() before kdump and before stopping the other CPUs,
independently of crash_kexec_post_notifiers.
Also call it from __crash_kexec() if a crash kernel is loaded, since a
fatal oops can enter kdump without panic(). Call it before taking the
kexec lock, so a callback that panics can still enter kdump. Run the
list at most once, including when a callback panics.
Add disable_panic_notifiers_platform_list to skip these callbacks
when debugging panic or kdump failures.
Suggested-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/ateYxCu63pRY9EGq@pathway.suse.cz
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: Call the list before kexec_trylock() in __crash_kexec(), and only
when a crash kernel is loaded, so a callback that panics on a direct
crash_kexec() can still enter kdump (reported by Sashiko).
v3: New. Replaces v2 patches 1-3 (pre-kdump list, crash-core call and
panic_pre_kdump_postpone) with the platform list Petr suggested: one
early call in vpanic(), one in __crash_kexec(), a shared guard and a
disable switch. The guard is a plain bool, because calls are
serialized, normally by panic_cpu.
.../admin-guide/kernel-parameters.txt | 12 +++++
include/linux/panic_notifier.h | 3 ++
kernel/crash_core.c | 8 +++
kernel/panic.c | 51 +++++++++++++++++++
4 files changed, 74 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0b3c140babd9..85ddcad397bf 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1308,6 +1308,18 @@ Kernel parameters
MTRR settings. This parameter disables that behavior,
possibly causing your machine to run very slowly.
+ disable_panic_notifiers_platform_list=
+ [KNL] Skip the platform panic notifiers. They
+ normally run early in panic(), before kdump, and on
+ crash paths that enter kdump without panic().
+ Intended for debugging panic and kdump failures.
+ Skipping them may lose platform crash handling,
+ such as a copy of the kernel log on the hypervisor.
+ Format: <bool>
+ Default: 0
+ Writable at runtime via
+ /sys/module/kernel/parameters/disable_panic_notifiers_platform_list.
+
disable_timer_pin_1 [X86,EARLY]
Disable PIN 1 of APIC timer
Can be useful to work around chipset bugs.
diff --git a/include/linux/panic_notifier.h b/include/linux/panic_notifier.h
index 41e32483d7a7..1eaf1ffba0bc 100644
--- a/include/linux/panic_notifier.h
+++ b/include/linux/panic_notifier.h
@@ -6,6 +6,9 @@
#include <linux/types.h>
extern struct atomic_notifier_head panic_notifier_list;
+extern struct atomic_notifier_head panic_notifiers_platform_list;
+
+void panic_notify_platform(void);
extern bool crash_kexec_post_notifiers;
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index d0bd2d0cf899..704a39875ea5 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -23,6 +23,7 @@
#include <linux/objtool.h>
#include <linux/delay.h>
#include <linux/panic.h>
+#include <linux/panic_notifier.h>
#include <asm/page.h>
#include <asm/sections.h>
@@ -126,6 +127,13 @@ static void crash_cma_clear_pending_dma(void)
*/
void __noclone __crash_kexec(struct pt_regs *regs)
{
+ /*
+ * For crash paths that bypass panic(). Run before taking the kexec
+ * lock, so a callback that panics can still enter kdump.
+ */
+ if (kexec_crash_loaded())
+ panic_notify_platform();
+
/* Take the kexec_lock here to prevent sys_kexec_load
* running on one cpu from replacing the crash kernel
* we are using after a panic on a different cpu.
diff --git a/kernel/panic.c b/kernel/panic.c
index 91e48d33b7db..bb27c14ef9f0 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -62,6 +62,7 @@ static int pause_on_oops;
static int pause_on_oops_flag;
static DEFINE_SPINLOCK(pause_on_oops_lock);
bool crash_kexec_post_notifiers;
+static bool disable_panic_notifiers_platform_list;
int panic_on_warn __read_mostly;
unsigned long panic_on_taint;
bool panic_on_taint_nousertaint = false;
@@ -82,6 +83,10 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
EXPORT_SYMBOL(panic_notifier_list);
+struct atomic_notifier_head panic_notifiers_platform_list =
+ ATOMIC_NOTIFIER_INIT(panic_notifiers_platform_list);
+EXPORT_SYMBOL_GPL(panic_notifiers_platform_list);
+
static void panic_print_deprecated(void)
{
pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
@@ -577,6 +582,47 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
void __weak arch_do_panic(void) {}
+/**
+ * panic_notify_platform - run early platform crash callbacks
+ *
+ * panic_notifiers_platform_list is for platform callbacks that need to
+ * run during a crash without requiring crash_kexec_post_notifiers.
+ *
+ * vpanic() calls this before kdump and before stopping the other CPUs.
+ * __crash_kexec() also calls it for crash paths that bypass panic(),
+ * if a crash kernel is loaded.
+ * Calls must be serialized across CPUs, normally by panic_cpu.
+ *
+ * The list runs at most once, even if a callback panics. Setting
+ * disable_panic_notifiers_platform_list skips the call without marking
+ * the list as run, so a call made after the switch is cleared can still
+ * run it.
+ *
+ * Callbacks receive a notifier value of 0 and NULL data. They must
+ * return NOTIFY_DONE; NOTIFY_STOP would skip the callbacks after them.
+ *
+ * Context: Callbacks run with interrupts disabled, possibly in NMI
+ * context. Other CPUs may still be running. Callbacks must limit their
+ * work and must not sleep, allocate memory, take locks, wait for other
+ * CPUs or invoke kexec.
+ */
+void panic_notify_platform(void)
+{
+ static bool done;
+ unsigned long flags;
+
+ if (READ_ONCE(disable_panic_notifiers_platform_list))
+ return;
+
+ local_irq_save(flags);
+ if (!done) {
+ done = true;
+ atomic_notifier_call_chain(&panic_notifiers_platform_list,
+ 0, NULL);
+ }
+ local_irq_restore(flags);
+}
+
/**
* vpanic - halt the system
* @fmt: The text string to print
@@ -669,6 +715,9 @@ void vpanic(const char *fmt, va_list args)
*/
kgdb_panic(buf);
+ /* Before kdump and before stopping the other CPUs */
+ panic_notify_platform();
+
/*
* If we have crashed and we have a crash kernel loaded let it handle
* everything else.
@@ -1217,6 +1266,8 @@ core_param(panic, panic_timeout, int, 0644);
core_param(pause_on_oops, pause_on_oops, int, 0644);
core_param(panic_on_warn, panic_on_warn, int, 0644);
core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
+core_param(disable_panic_notifiers_platform_list,
+ disable_panic_notifiers_platform_list, bool, 0644);
core_param(panic_console_replay, panic_console_replay, bool, 0644);
static int panic_print_set(const char *val, const struct kernel_param *kp)
^ permalink raw reply related [flat|nested] 43+ messages in thread* [PATCH v4 1/4] panic: Add a platform panic notifier list
@ 2026-11-18 6:01 ` Zack Rusin
0 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: linux-doc, Kees Cook, Dave Hansen, Stephen Brennan, Bo Gan,
H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, linux-kernel,
Ian Forbes, Sergey Senozhatsky, Thomas Gleixner
Some platforms set crash_kexec_post_notifiers so their crash handlers
run before kdump. That also runs every other panic notifier and kmsg
dumper before the crash kernel.
Add panic_notifiers_platform_list for platform callbacks that need to
run early and are safe while other CPUs are still running. Call it
from vpanic() before kdump and before stopping the other CPUs,
independently of crash_kexec_post_notifiers.
Also call it from __crash_kexec() if a crash kernel is loaded, since a
fatal oops can enter kdump without panic(). Call it before taking the
kexec lock, so a callback that panics can still enter kdump. Run the
list at most once, including when a callback panics.
Add disable_panic_notifiers_platform_list to skip these callbacks
when debugging panic or kdump failures.
Suggested-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/ateYxCu63pRY9EGq@pathway.suse.cz
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: Call the list before kexec_trylock() in __crash_kexec(), and only
when a crash kernel is loaded, so a callback that panics on a direct
crash_kexec() can still enter kdump (reported by Sashiko).
v3: New. Replaces v2 patches 1-3 (pre-kdump list, crash-core call and
panic_pre_kdump_postpone) with the platform list Petr suggested: one
early call in vpanic(), one in __crash_kexec(), a shared guard and a
disable switch. The guard is a plain bool, because calls are
serialized, normally by panic_cpu.
.../admin-guide/kernel-parameters.txt | 12 +++++
include/linux/panic_notifier.h | 3 ++
kernel/crash_core.c | 8 +++
kernel/panic.c | 51 +++++++++++++++++++
4 files changed, 74 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0b3c140babd9..85ddcad397bf 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1308,6 +1308,18 @@ Kernel parameters
MTRR settings. This parameter disables that behavior,
possibly causing your machine to run very slowly.
+ disable_panic_notifiers_platform_list=
+ [KNL] Skip the platform panic notifiers. They
+ normally run early in panic(), before kdump, and on
+ crash paths that enter kdump without panic().
+ Intended for debugging panic and kdump failures.
+ Skipping them may lose platform crash handling,
+ such as a copy of the kernel log on the hypervisor.
+ Format: <bool>
+ Default: 0
+ Writable at runtime via
+ /sys/module/kernel/parameters/disable_panic_notifiers_platform_list.
+
disable_timer_pin_1 [X86,EARLY]
Disable PIN 1 of APIC timer
Can be useful to work around chipset bugs.
diff --git a/include/linux/panic_notifier.h b/include/linux/panic_notifier.h
index 41e32483d7a7..1eaf1ffba0bc 100644
--- a/include/linux/panic_notifier.h
+++ b/include/linux/panic_notifier.h
@@ -6,6 +6,9 @@
#include <linux/types.h>
extern struct atomic_notifier_head panic_notifier_list;
+extern struct atomic_notifier_head panic_notifiers_platform_list;
+
+void panic_notify_platform(void);
extern bool crash_kexec_post_notifiers;
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index d0bd2d0cf899..704a39875ea5 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -23,6 +23,7 @@
#include <linux/objtool.h>
#include <linux/delay.h>
#include <linux/panic.h>
+#include <linux/panic_notifier.h>
#include <asm/page.h>
#include <asm/sections.h>
@@ -126,6 +127,13 @@ static void crash_cma_clear_pending_dma(void)
*/
void __noclone __crash_kexec(struct pt_regs *regs)
{
+ /*
+ * For crash paths that bypass panic(). Run before taking the kexec
+ * lock, so a callback that panics can still enter kdump.
+ */
+ if (kexec_crash_loaded())
+ panic_notify_platform();
+
/* Take the kexec_lock here to prevent sys_kexec_load
* running on one cpu from replacing the crash kernel
* we are using after a panic on a different cpu.
diff --git a/kernel/panic.c b/kernel/panic.c
index 91e48d33b7db..bb27c14ef9f0 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -62,6 +62,7 @@ static int pause_on_oops;
static int pause_on_oops_flag;
static DEFINE_SPINLOCK(pause_on_oops_lock);
bool crash_kexec_post_notifiers;
+static bool disable_panic_notifiers_platform_list;
int panic_on_warn __read_mostly;
unsigned long panic_on_taint;
bool panic_on_taint_nousertaint = false;
@@ -82,6 +83,10 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
EXPORT_SYMBOL(panic_notifier_list);
+struct atomic_notifier_head panic_notifiers_platform_list =
+ ATOMIC_NOTIFIER_INIT(panic_notifiers_platform_list);
+EXPORT_SYMBOL_GPL(panic_notifiers_platform_list);
+
static void panic_print_deprecated(void)
{
pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
@@ -577,6 +582,47 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
void __weak arch_do_panic(void) {}
+/**
+ * panic_notify_platform - run early platform crash callbacks
+ *
+ * panic_notifiers_platform_list is for platform callbacks that need to
+ * run during a crash without requiring crash_kexec_post_notifiers.
+ *
+ * vpanic() calls this before kdump and before stopping the other CPUs.
+ * __crash_kexec() also calls it for crash paths that bypass panic(),
+ * if a crash kernel is loaded.
+ * Calls must be serialized across CPUs, normally by panic_cpu.
+ *
+ * The list runs at most once, even if a callback panics. Setting
+ * disable_panic_notifiers_platform_list skips the call without marking
+ * the list as run, so a call made after the switch is cleared can still
+ * run it.
+ *
+ * Callbacks receive a notifier value of 0 and NULL data. They must
+ * return NOTIFY_DONE; NOTIFY_STOP would skip the callbacks after them.
+ *
+ * Context: Callbacks run with interrupts disabled, possibly in NMI
+ * context. Other CPUs may still be running. Callbacks must limit their
+ * work and must not sleep, allocate memory, take locks, wait for other
+ * CPUs or invoke kexec.
+ */
+void panic_notify_platform(void)
+{
+ static bool done;
+ unsigned long flags;
+
+ if (READ_ONCE(disable_panic_notifiers_platform_list))
+ return;
+
+ local_irq_save(flags);
+ if (!done) {
+ done = true;
+ atomic_notifier_call_chain(&panic_notifiers_platform_list,
+ 0, NULL);
+ }
+ local_irq_restore(flags);
+}
+
/**
* vpanic - halt the system
* @fmt: The text string to print
@@ -669,6 +715,9 @@ void vpanic(const char *fmt, va_list args)
*/
kgdb_panic(buf);
+ /* Before kdump and before stopping the other CPUs */
+ panic_notify_platform();
+
/*
* If we have crashed and we have a crash kernel loaded let it handle
* everything else.
@@ -1217,6 +1266,8 @@ core_param(panic, panic_timeout, int, 0644);
core_param(pause_on_oops, pause_on_oops, int, 0644);
core_param(panic_on_warn, panic_on_warn, int, 0644);
core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
+core_param(disable_panic_notifiers_platform_list,
+ disable_panic_notifiers_platform_list, bool, 0644);
core_param(panic_console_replay, panic_console_replay, bool, 0644);
static int panic_print_set(const char *val, const struct kernel_param *kp)
^ permalink raw reply related [flat|nested] 43+ messages in thread* Re: [PATCH v4 1/4] panic: Add a platform panic notifier list
2026-11-18 6:01 ` Zack Rusin
(?)
@ 2026-11-18 6:16 ` sashiko-bot
-1 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:16 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Kees Cook, Dave Hansen, Stephen Brennan, Bo Gan, H. Peter Anvin,
Jonathan Corbet, Brennan Lamoreaux, x86, Joel Granados,
Alexey Makhalov, Ingo Molnar, bcm-kernel-feedback-list,
Ajay Kaher, Bradley Morgan, John Ogness, virtualization,
Steven Rostedt, Maaz Mombasawala, Borislav Petkov, Shuah Khan,
Michael Kelley, Randy Dunlap, kexec, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner, Michael S. Tsirkin,
Eugenio Perez
> Some platforms set crash_kexec_post_notifiers so their crash handlers
> run before kdump. That also runs every other panic notifier and kmsg
> dumper before the crash kernel.
>
> Add panic_notifiers_platform_list for platform callbacks that need to
> run early and are safe while other CPUs are still running. Call it
> from vpanic() before kdump and before stopping the other CPUs,
> independently of crash_kexec_post_notifiers.
>
> Also call it from __crash_kexec() if a crash kernel is loaded, since a
> fatal oops can enter kdump without panic(). Call it before taking the
> kexec lock, so a callback that panics can still enter kdump. Run the
> list at most once, including when a callback panics.
>
> Add disable_panic_notifiers_platform_list to skip these callbacks
> when debugging panic or kdump failures.
>
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Link: https://lore.kernel.org/r/ateYxCu63pRY9EGq@pathway.suse.cz
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=1
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 1/4] panic: Add a platform panic notifier list
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-20 8:36 ` Petr Mladek
-1 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 8:36 UTC (permalink / raw)
To: Zack Rusin
Cc: Andrew Morton, Baoquan He, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Dave Young, Borislav Petkov, Ajay Kaher,
Alexey Makhalov, x86, Joel Granados, Thomas Gleixner, Ingo Molnar,
Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, linux-kernel, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, linux-doc, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan
On Wed 2026-11-18 01:01:48, Zack Rusin wrote:
> Some platforms set crash_kexec_post_notifiers so their crash handlers
> run before kdump. That also runs every other panic notifier and kmsg
> dumper before the crash kernel.
>
> Add panic_notifiers_platform_list for platform callbacks that need to
> run early and are safe while other CPUs are still running. Call it
> from vpanic() before kdump and before stopping the other CPUs,
> independently of crash_kexec_post_notifiers.
>
> Also call it from __crash_kexec() if a crash kernel is loaded, since a
> fatal oops can enter kdump without panic(). Call it before taking the
> kexec lock, so a callback that panics can still enter kdump. Run the
> list at most once, including when a callback panics.
>
> Add disable_panic_notifiers_platform_list to skip these callbacks
> when debugging panic or kdump failures.
>
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Link: https://lore.kernel.org/r/ateYxCu63pRY9EGq@pathway.suse.cz
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
JFYI, it looks reasonable from my POV:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 1/4] panic: Add a platform panic notifier list
@ 2026-11-20 8:36 ` Petr Mladek
0 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 8:36 UTC (permalink / raw)
To: Zack Rusin
Cc: linux-doc, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Pasha Tatashin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Ingo Molnar, bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan,
Baoquan He, John Ogness, virtualization, Steven Rostedt,
Maaz Mombasawala, Borislav Petkov, Shuah Khan, Michael Kelley,
Pratyush Yadav, Randy Dunlap, kexec, linux-kernel, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner, Andrew Morton, Mike Rapoport
On Wed 2026-11-18 01:01:48, Zack Rusin wrote:
> Some platforms set crash_kexec_post_notifiers so their crash handlers
> run before kdump. That also runs every other panic notifier and kmsg
> dumper before the crash kernel.
>
> Add panic_notifiers_platform_list for platform callbacks that need to
> run early and are safe while other CPUs are still running. Call it
> from vpanic() before kdump and before stopping the other CPUs,
> independently of crash_kexec_post_notifiers.
>
> Also call it from __crash_kexec() if a crash kernel is loaded, since a
> fatal oops can enter kdump without panic(). Call it before taking the
> kexec lock, so a callback that panics can still enter kdump. Run the
> list at most once, including when a callback panics.
>
> Add disable_panic_notifiers_platform_list to skip these callbacks
> when debugging panic or kdump failures.
>
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Link: https://lore.kernel.org/r/ateYxCu63pRY9EGq@pathway.suse.cz
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
JFYI, it looks reasonable from my POV:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:01 ` Zack Rusin
-1 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, linux-kernel,
John Ogness, Steven Rostedt, Sergey Senozhatsky, Kees Cook,
Jonathan Corbet, Bo Gan, Brennan Lamoreaux, kexec, linux-doc,
Guilherme G. Piccoli, Maaz Mombasawala, Shuah Khan, Randy Dunlap,
Stephen Brennan, Michael Kelley, Ian Forbes, Bradley Morgan
A VMware guest may be unable to save its own logs after a crash. Copy
the newest kernel log records to the host's vmware.log before kdump,
so they remain available if the capture kernel fails.
Register the sender on the platform panic notifier list and send the
log through the low-bandwidth register interface. Allocate a fixed
8 KiB buffer during early init; 4 KiB can lose useful stack-trace
context. The callback allocates no memory and emits no printk
messages. Limit the transfer to the buffer size and make at most three
attempts, retrying only if a VM checkpoint interrupts the transfer.
Enable logging by default only in guests without memory encryption;
encrypted guests should send their log to the host only when an
administrator opts in. The copy is best-effort diagnostics; kdump does
not depend on it succeeding.
Suggested-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/SN6PR02MB41574A11D309A0530C63E0FED4842@SN6PR02MB4157.namprd02.prod.outlook.com
Link: https://lore.kernel.org/r/20260309235250.2611115-3-alexey.makhalov@broadcom.com
Co-developed-by: Bo Gan <bo.gan@broadcom.com>
Signed-off-by: Bo Gan <bo.gan@broadcom.com>
Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: No change.
v3: Register on the platform list instead of the pre-kdump list. The
VMware code is otherwise unchanged from v2.
arch/x86/include/asm/vmware.h | 1 +
arch/x86/kernel/cpu/vmware.c | 173 ++++++++++++++++++++++++++++++++++
2 files changed, 174 insertions(+)
diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h
index fb011cef01e7..dc3cf8123914 100644
--- a/arch/x86/include/asm/vmware.h
+++ b/arch/x86/include/asm/vmware.h
@@ -57,6 +57,7 @@
#define VMWARE_HYPERVISOR_MAGIC 0x564d5868U
#define VMWARE_CMD_GETVERSION 10
+#define VMWARE_CMD_MESSAGE 30
#define VMWARE_CMD_GETHZ 45
#define VMWARE_CMD_GETVCPU_INFO 68
#define VMWARE_CMD_STEALCLOCK 91
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index f7ab9e7902cf..0c6f7248a665 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -24,11 +24,16 @@
#include <linux/dmi.h>
#include <linux/init.h>
#include <linux/export.h>
+#include <linux/kmsg_dump.h>
+#include <linux/mm.h>
+#include <linux/panic_notifier.h>
#include <linux/clocksource.h>
#include <linux/cpu.h>
#include <linux/efi.h>
#include <linux/reboot.h>
+#include <linux/sizes.h>
#include <linux/static_call.h>
+#include <linux/wordpart.h>
#include <linux/sched/cputime.h>
#include <asm/div64.h>
#include <asm/x86_init.h>
@@ -52,6 +57,23 @@
#define STEALCLOCK_DISABLED 0
#define STEALCLOCK_ENABLED 1
+#define VMWARE_MSG_STATUS_SUCCESS BIT(16)
+#define VMWARE_MSG_STATUS_CPT BIT(20)
+
+#define VMWARE_RPCI_PROTOCOL 0x49435052
+#define VMWARE_GUESTMSG_COOKIE BIT(31)
+
+#define VMWARE_MSG_TYPE(n) ((n) << 16)
+#define VMWARE_MSG_OPEN VMWARE_MSG_TYPE(0U)
+#define VMWARE_MSG_SENDSIZE VMWARE_MSG_TYPE(1U)
+#define VMWARE_MSG_SENDPAYLOAD VMWARE_MSG_TYPE(2U)
+#define VMWARE_MSG_CLOSE VMWARE_MSG_TYPE(6U)
+
+#define VMWARE_LOG_BUF_SIZE SZ_8K
+#define VMWARE_LOG_ATTEMPTS 3
+#define VMWARE_LOG_PREFIX "log "
+#define VMWARE_LOG_PREFIX_LEN (sizeof(VMWARE_LOG_PREFIX) - 1)
+
struct vmware_steal_time {
union {
u64 clock; /* stolen time counter in units of vtsc */
@@ -64,6 +86,12 @@ struct vmware_steal_time {
u64 reserved[7];
};
+struct vmware_rpc_channel {
+ u16 id;
+ u32 cookie_high;
+ u32 cookie_low;
+};
+
static unsigned long vmware_tsc_khz __ro_after_init;
static u8 vmware_hypercall_mode __ro_after_init;
@@ -142,6 +170,151 @@ static unsigned long vmware_get_tsc_khz(void)
return vmware_tsc_khz;
}
+static int vmware_log_open(struct vmware_rpc_channel *channel)
+{
+ u32 info, id;
+
+ vmware_hypercall6(VMWARE_CMD_MESSAGE | VMWARE_MSG_OPEN,
+ VMWARE_RPCI_PROTOCOL | VMWARE_GUESTMSG_COOKIE, 0,
+ &info, &id, &channel->cookie_high,
+ &channel->cookie_low);
+ if (!(info & VMWARE_MSG_STATUS_SUCCESS))
+ return -EIO;
+
+ channel->id = upper_16_bits(id);
+ return 0;
+}
+
+static int vmware_log_close(const struct vmware_rpc_channel *channel)
+{
+ u32 info;
+
+ vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_CLOSE, 0,
+ (u32)channel->id << 16, channel->cookie_high,
+ channel->cookie_low, &info);
+
+ return info & VMWARE_MSG_STATUS_SUCCESS ? 0 : -EIO;
+}
+
+static int vmware_log_send_once(const struct vmware_rpc_channel *channel,
+ const char *buffer, size_t length)
+{
+ u32 info;
+
+ vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDSIZE, length,
+ (u32)channel->id << 16, channel->cookie_high,
+ channel->cookie_low, &info);
+ if (!(info & VMWARE_MSG_STATUS_SUCCESS))
+ return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
+
+ while (length) {
+ size_t bytes = min_t(size_t, length, sizeof(u32));
+ u32 word = 0;
+
+ memcpy(&word, buffer, bytes);
+ vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDPAYLOAD,
+ word, (u32)channel->id << 16,
+ channel->cookie_high, channel->cookie_low,
+ &info);
+ if (!(info & VMWARE_MSG_STATUS_SUCCESS))
+ return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
+
+ buffer += bytes;
+ length -= bytes;
+ }
+
+ return 0;
+}
+
+static int vmware_log_send(const struct vmware_rpc_channel *channel,
+ const char *buffer, size_t length)
+{
+ int attempt, ret;
+
+ for (attempt = 0; attempt < VMWARE_LOG_ATTEMPTS; attempt++) {
+ ret = vmware_log_send_once(channel, buffer, length);
+ if (ret != -EAGAIN)
+ return ret;
+ }
+
+ return -EAGAIN;
+}
+
+static int vmware_log_rpc(const char *buffer, size_t length)
+{
+ struct vmware_rpc_channel channel;
+ int close_ret, ret;
+
+ ret = vmware_log_open(&channel);
+ if (ret)
+ return ret;
+
+ ret = vmware_log_send(&channel, buffer, length);
+ close_ret = vmware_log_close(&channel);
+ if (!ret && close_ret)
+ ret = close_ret;
+
+ return ret;
+}
+
+static struct page *vmware_panic_page;
+static bool vmware_record_panic_msg;
+
+static int vmware_panic_log_notify(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ struct kmsg_dump_iter iter;
+ char *buffer = page_address(vmware_panic_page);
+ size_t length = 0;
+
+ if (!READ_ONCE(vmware_record_panic_msg))
+ return NOTIFY_DONE;
+
+ memcpy(buffer, VMWARE_LOG_PREFIX, VMWARE_LOG_PREFIX_LEN);
+ kmsg_dump_rewind(&iter);
+ (void)kmsg_dump_get_buffer(&iter, true,
+ buffer + VMWARE_LOG_PREFIX_LEN,
+ VMWARE_LOG_BUF_SIZE - VMWARE_LOG_PREFIX_LEN,
+ &length);
+ (void)vmware_log_rpc(buffer, length + VMWARE_LOG_PREFIX_LEN);
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block vmware_panic_log_nb = {
+ .notifier_call = vmware_panic_log_notify,
+};
+
+static int __init vmware_panic_log_init(void)
+{
+ int ret;
+
+ if (!IS_ENABLED(CONFIG_PRINTK) ||
+ !hypervisor_is_type(X86_HYPER_VMWARE))
+ return 0;
+
+ vmware_record_panic_msg =
+ !cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT);
+
+ vmware_panic_page = alloc_pages(GFP_KERNEL,
+ get_order(VMWARE_LOG_BUF_SIZE));
+ if (!vmware_panic_page) {
+ pr_err("failed to allocate panic log buffer\n");
+ return 0;
+ }
+
+ ret = atomic_notifier_chain_register(&panic_notifiers_platform_list,
+ &vmware_panic_log_nb);
+ if (ret) {
+ pr_err("failed to register panic log notifier: %d\n", ret);
+ __free_pages(vmware_panic_page, get_order(VMWARE_LOG_BUF_SIZE));
+ vmware_panic_page = NULL;
+ }
+
+ return 0;
+}
+early_initcall(vmware_panic_log_init);
+
#ifdef CONFIG_PARAVIRT
static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
static bool vmw_sched_clock __initdata = true;
^ permalink raw reply related [flat|nested] 43+ messages in thread* [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender
@ 2026-11-18 6:01 ` Zack Rusin
0 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: linux-doc, Kees Cook, Dave Hansen, Stephen Brennan, Bo Gan,
H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, linux-kernel,
Ian Forbes, Sergey Senozhatsky, Thomas Gleixner
A VMware guest may be unable to save its own logs after a crash. Copy
the newest kernel log records to the host's vmware.log before kdump,
so they remain available if the capture kernel fails.
Register the sender on the platform panic notifier list and send the
log through the low-bandwidth register interface. Allocate a fixed
8 KiB buffer during early init; 4 KiB can lose useful stack-trace
context. The callback allocates no memory and emits no printk
messages. Limit the transfer to the buffer size and make at most three
attempts, retrying only if a VM checkpoint interrupts the transfer.
Enable logging by default only in guests without memory encryption;
encrypted guests should send their log to the host only when an
administrator opts in. The copy is best-effort diagnostics; kdump does
not depend on it succeeding.
Suggested-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/SN6PR02MB41574A11D309A0530C63E0FED4842@SN6PR02MB4157.namprd02.prod.outlook.com
Link: https://lore.kernel.org/r/20260309235250.2611115-3-alexey.makhalov@broadcom.com
Co-developed-by: Bo Gan <bo.gan@broadcom.com>
Signed-off-by: Bo Gan <bo.gan@broadcom.com>
Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: No change.
v3: Register on the platform list instead of the pre-kdump list. The
VMware code is otherwise unchanged from v2.
arch/x86/include/asm/vmware.h | 1 +
arch/x86/kernel/cpu/vmware.c | 173 ++++++++++++++++++++++++++++++++++
2 files changed, 174 insertions(+)
diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h
index fb011cef01e7..dc3cf8123914 100644
--- a/arch/x86/include/asm/vmware.h
+++ b/arch/x86/include/asm/vmware.h
@@ -57,6 +57,7 @@
#define VMWARE_HYPERVISOR_MAGIC 0x564d5868U
#define VMWARE_CMD_GETVERSION 10
+#define VMWARE_CMD_MESSAGE 30
#define VMWARE_CMD_GETHZ 45
#define VMWARE_CMD_GETVCPU_INFO 68
#define VMWARE_CMD_STEALCLOCK 91
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index f7ab9e7902cf..0c6f7248a665 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -24,11 +24,16 @@
#include <linux/dmi.h>
#include <linux/init.h>
#include <linux/export.h>
+#include <linux/kmsg_dump.h>
+#include <linux/mm.h>
+#include <linux/panic_notifier.h>
#include <linux/clocksource.h>
#include <linux/cpu.h>
#include <linux/efi.h>
#include <linux/reboot.h>
+#include <linux/sizes.h>
#include <linux/static_call.h>
+#include <linux/wordpart.h>
#include <linux/sched/cputime.h>
#include <asm/div64.h>
#include <asm/x86_init.h>
@@ -52,6 +57,23 @@
#define STEALCLOCK_DISABLED 0
#define STEALCLOCK_ENABLED 1
+#define VMWARE_MSG_STATUS_SUCCESS BIT(16)
+#define VMWARE_MSG_STATUS_CPT BIT(20)
+
+#define VMWARE_RPCI_PROTOCOL 0x49435052
+#define VMWARE_GUESTMSG_COOKIE BIT(31)
+
+#define VMWARE_MSG_TYPE(n) ((n) << 16)
+#define VMWARE_MSG_OPEN VMWARE_MSG_TYPE(0U)
+#define VMWARE_MSG_SENDSIZE VMWARE_MSG_TYPE(1U)
+#define VMWARE_MSG_SENDPAYLOAD VMWARE_MSG_TYPE(2U)
+#define VMWARE_MSG_CLOSE VMWARE_MSG_TYPE(6U)
+
+#define VMWARE_LOG_BUF_SIZE SZ_8K
+#define VMWARE_LOG_ATTEMPTS 3
+#define VMWARE_LOG_PREFIX "log "
+#define VMWARE_LOG_PREFIX_LEN (sizeof(VMWARE_LOG_PREFIX) - 1)
+
struct vmware_steal_time {
union {
u64 clock; /* stolen time counter in units of vtsc */
@@ -64,6 +86,12 @@ struct vmware_steal_time {
u64 reserved[7];
};
+struct vmware_rpc_channel {
+ u16 id;
+ u32 cookie_high;
+ u32 cookie_low;
+};
+
static unsigned long vmware_tsc_khz __ro_after_init;
static u8 vmware_hypercall_mode __ro_after_init;
@@ -142,6 +170,151 @@ static unsigned long vmware_get_tsc_khz(void)
return vmware_tsc_khz;
}
+static int vmware_log_open(struct vmware_rpc_channel *channel)
+{
+ u32 info, id;
+
+ vmware_hypercall6(VMWARE_CMD_MESSAGE | VMWARE_MSG_OPEN,
+ VMWARE_RPCI_PROTOCOL | VMWARE_GUESTMSG_COOKIE, 0,
+ &info, &id, &channel->cookie_high,
+ &channel->cookie_low);
+ if (!(info & VMWARE_MSG_STATUS_SUCCESS))
+ return -EIO;
+
+ channel->id = upper_16_bits(id);
+ return 0;
+}
+
+static int vmware_log_close(const struct vmware_rpc_channel *channel)
+{
+ u32 info;
+
+ vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_CLOSE, 0,
+ (u32)channel->id << 16, channel->cookie_high,
+ channel->cookie_low, &info);
+
+ return info & VMWARE_MSG_STATUS_SUCCESS ? 0 : -EIO;
+}
+
+static int vmware_log_send_once(const struct vmware_rpc_channel *channel,
+ const char *buffer, size_t length)
+{
+ u32 info;
+
+ vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDSIZE, length,
+ (u32)channel->id << 16, channel->cookie_high,
+ channel->cookie_low, &info);
+ if (!(info & VMWARE_MSG_STATUS_SUCCESS))
+ return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
+
+ while (length) {
+ size_t bytes = min_t(size_t, length, sizeof(u32));
+ u32 word = 0;
+
+ memcpy(&word, buffer, bytes);
+ vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDPAYLOAD,
+ word, (u32)channel->id << 16,
+ channel->cookie_high, channel->cookie_low,
+ &info);
+ if (!(info & VMWARE_MSG_STATUS_SUCCESS))
+ return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
+
+ buffer += bytes;
+ length -= bytes;
+ }
+
+ return 0;
+}
+
+static int vmware_log_send(const struct vmware_rpc_channel *channel,
+ const char *buffer, size_t length)
+{
+ int attempt, ret;
+
+ for (attempt = 0; attempt < VMWARE_LOG_ATTEMPTS; attempt++) {
+ ret = vmware_log_send_once(channel, buffer, length);
+ if (ret != -EAGAIN)
+ return ret;
+ }
+
+ return -EAGAIN;
+}
+
+static int vmware_log_rpc(const char *buffer, size_t length)
+{
+ struct vmware_rpc_channel channel;
+ int close_ret, ret;
+
+ ret = vmware_log_open(&channel);
+ if (ret)
+ return ret;
+
+ ret = vmware_log_send(&channel, buffer, length);
+ close_ret = vmware_log_close(&channel);
+ if (!ret && close_ret)
+ ret = close_ret;
+
+ return ret;
+}
+
+static struct page *vmware_panic_page;
+static bool vmware_record_panic_msg;
+
+static int vmware_panic_log_notify(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ struct kmsg_dump_iter iter;
+ char *buffer = page_address(vmware_panic_page);
+ size_t length = 0;
+
+ if (!READ_ONCE(vmware_record_panic_msg))
+ return NOTIFY_DONE;
+
+ memcpy(buffer, VMWARE_LOG_PREFIX, VMWARE_LOG_PREFIX_LEN);
+ kmsg_dump_rewind(&iter);
+ (void)kmsg_dump_get_buffer(&iter, true,
+ buffer + VMWARE_LOG_PREFIX_LEN,
+ VMWARE_LOG_BUF_SIZE - VMWARE_LOG_PREFIX_LEN,
+ &length);
+ (void)vmware_log_rpc(buffer, length + VMWARE_LOG_PREFIX_LEN);
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block vmware_panic_log_nb = {
+ .notifier_call = vmware_panic_log_notify,
+};
+
+static int __init vmware_panic_log_init(void)
+{
+ int ret;
+
+ if (!IS_ENABLED(CONFIG_PRINTK) ||
+ !hypervisor_is_type(X86_HYPER_VMWARE))
+ return 0;
+
+ vmware_record_panic_msg =
+ !cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT);
+
+ vmware_panic_page = alloc_pages(GFP_KERNEL,
+ get_order(VMWARE_LOG_BUF_SIZE));
+ if (!vmware_panic_page) {
+ pr_err("failed to allocate panic log buffer\n");
+ return 0;
+ }
+
+ ret = atomic_notifier_chain_register(&panic_notifiers_platform_list,
+ &vmware_panic_log_nb);
+ if (ret) {
+ pr_err("failed to register panic log notifier: %d\n", ret);
+ __free_pages(vmware_panic_page, get_order(VMWARE_LOG_BUF_SIZE));
+ vmware_panic_page = NULL;
+ }
+
+ return 0;
+}
+early_initcall(vmware_panic_log_init);
+
#ifdef CONFIG_PARAVIRT
static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
static bool vmw_sched_clock __initdata = true;
^ permalink raw reply related [flat|nested] 43+ messages in thread* Re: [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:18 ` sashiko-bot
-1 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:18 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan, Michael S. Tsirkin,
Eugenio Perez
> A VMware guest may be unable to save its own logs after a crash. Copy
> the newest kernel log records to the host's vmware.log before kdump,
> so they remain available if the capture kernel fails.
>
> Register the sender on the platform panic notifier list and send the
> log through the low-bandwidth register interface. Allocate a fixed
> 8 KiB buffer during early init; 4 KiB can lose useful stack-trace
> context. The callback allocates no memory and emits no printk
> messages. Limit the transfer to the buffer size and make at most three
> attempts, retrying only if a VM checkpoint interrupts the transfer.
>
> Enable logging by default only in guests without memory encryption;
> encrypted guests should send their log to the host only when an
> administrator opts in. The copy is best-effort diagnostics; kdump does
> not depend on it succeeding.
>
> Suggested-by: Michael Kelley <mhklinux@outlook.com>
> Link: https://lore.kernel.org/r/SN6PR02MB41574A11D309A0530C63E0FED4842@SN6PR02MB4157.namprd02.prod.outlook.com
> Link: https://lore.kernel.org/r/20260309235250.2611115-3-alexey.makhalov@broadcom.com
> Co-developed-by: Bo Gan <bo.gan@broadcom.com>
> Signed-off-by: Bo Gan <bo.gan@broadcom.com>
> Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender
@ 2026-11-18 6:18 ` sashiko-bot
0 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:18 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Michael S. Tsirkin, Kees Cook, Dave Hansen, Stephen Brennan,
Bo Gan, H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Eugenio Perez, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner
> A VMware guest may be unable to save its own logs after a crash. Copy
> the newest kernel log records to the host's vmware.log before kdump,
> so they remain available if the capture kernel fails.
>
> Register the sender on the platform panic notifier list and send the
> log through the low-bandwidth register interface. Allocate a fixed
> 8 KiB buffer during early init; 4 KiB can lose useful stack-trace
> context. The callback allocates no memory and emits no printk
> messages. Limit the transfer to the buffer size and make at most three
> attempts, retrying only if a VM checkpoint interrupts the transfer.
>
> Enable logging by default only in guests without memory encryption;
> encrypted guests should send their log to the host only when an
> administrator opts in. The copy is best-effort diagnostics; kdump does
> not depend on it succeeding.
>
> Suggested-by: Michael Kelley <mhklinux@outlook.com>
> Link: https://lore.kernel.org/r/SN6PR02MB41574A11D309A0530C63E0FED4842@SN6PR02MB4157.namprd02.prod.outlook.com
> Link: https://lore.kernel.org/r/20260309235250.2611115-3-alexey.makhalov@broadcom.com
> Co-developed-by: Bo Gan <bo.gan@broadcom.com>
> Signed-off-by: Bo Gan <bo.gan@broadcom.com>
> Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-20 9:10 ` Petr Mladek
-1 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 9:10 UTC (permalink / raw)
To: Zack Rusin
Cc: linux-doc, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Pasha Tatashin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Ingo Molnar, bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan,
Baoquan He, John Ogness, virtualization, Steven Rostedt,
Maaz Mombasawala, Borislav Petkov, Shuah Khan, Michael Kelley,
Pratyush Yadav, Randy Dunlap, kexec, linux-kernel, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner, Andrew Morton, Mike Rapoport
On Wed 2026-11-18 01:01:49, Zack Rusin wrote:
> A VMware guest may be unable to save its own logs after a crash. Copy
> the newest kernel log records to the host's vmware.log before kdump,
> so they remain available if the capture kernel fails.
>
> Register the sender on the platform panic notifier list and send the
> log through the low-bandwidth register interface. Allocate a fixed
> 8 KiB buffer during early init; 4 KiB can lose useful stack-trace
> context. The callback allocates no memory and emits no printk
> messages. Limit the transfer to the buffer size and make at most three
> attempts, retrying only if a VM checkpoint interrupts the transfer.
>
> Enable logging by default only in guests without memory encryption;
> encrypted guests should send their log to the host only when an
> administrator opts in. The copy is best-effort diagnostics; kdump does
> not depend on it succeeding.
>
> Suggested-by: Michael Kelley <mhklinux@outlook.com>
> Link: https://lore.kernel.org/r/SN6PR02MB41574A11D309A0530C63E0FED4842@SN6PR02MB4157.namprd02.prod.outlook.com
> Link: https://lore.kernel.org/r/20260309235250.2611115-3-alexey.makhalov@broadcom.com
> Co-developed-by: Bo Gan <bo.gan@broadcom.com>
> Signed-off-by: Bo Gan <bo.gan@broadcom.com>
> Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
I made just a quick review of the string manipulation and
kmsg_dump_get_buffer() API use. And it looks good to me:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Note that I am not familiar with the vmware hypercalls so that
I did not check this part.
Some nits below.
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -52,6 +57,23 @@
> +#define VMWARE_LOG_BUF_SIZE SZ_8K
> +#define VMWARE_LOG_ATTEMPTS 3
> +#define VMWARE_LOG_PREFIX "log "
> +#define VMWARE_LOG_PREFIX_LEN (sizeof(VMWARE_LOG_PREFIX) - 1)
[...]
> +static int vmware_log_send_once(const struct vmware_rpc_channel *channel,
> + const char *buffer, size_t length)
> +{
> + u32 info;
> +
> + vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDSIZE, length,
> + (u32)channel->id << 16, channel->cookie_high,
> + channel->cookie_low, &info);
> + if (!(info & VMWARE_MSG_STATUS_SUCCESS))
> + return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
> +
> + while (length) {
> + size_t bytes = min_t(size_t, length, sizeof(u32));
> + u32 word = 0;
> +
> + memcpy(&word, buffer, bytes);
> + vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDPAYLOAD,
> + word, (u32)channel->id << 16,
> + channel->cookie_high, channel->cookie_low,
> + &info);
> + if (!(info & VMWARE_MSG_STATUS_SUCCESS))
> + return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
> +
> + buffer += bytes;
> + length -= bytes;
> + }
> +
> + return 0;
> +}
[...]
> +static int vmware_panic_log_notify(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct kmsg_dump_iter iter;
> + char *buffer = page_address(vmware_panic_page);
> + size_t length = 0;
I would add:
BUILD_BUG_ON(VMWARE_LOG_PREFIX_LEN > VMWARE_LOG_BUF_SIZE);
just to be on the safe side.
> +
> + if (!READ_ONCE(vmware_record_panic_msg))
> + return NOTIFY_DONE;
> +
> + memcpy(buffer, VMWARE_LOG_PREFIX, VMWARE_LOG_PREFIX_LEN);
I would feel more comfortable when the trailing '\0' gets copied as
well, e.g.
strscpy(buffer, VMWARE_LOG_PREFIX);
It is not strictly needed because the length is counted
explicitly, strlen() is not used. Also vmware_log_rpc() does
not send the trailing '\0'.
So, it is a rather a defensive programming. The buffer might be handled
another way in the future, e.g. printed by some debug code, tracing, ...
> + kmsg_dump_rewind(&iter);
> + (void)kmsg_dump_get_buffer(&iter, true,
> + buffer + VMWARE_LOG_PREFIX_LEN,
> + VMWARE_LOG_BUF_SIZE - VMWARE_LOG_PREFIX_LEN,
> + &length);
> + (void)vmware_log_rpc(buffer, length + VMWARE_LOG_PREFIX_LEN);
> +
> + return NOTIFY_DONE;
> +}
Best Regards,
Petr
^ permalink raw reply [flat|nested] 43+ messages in thread* Re: [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender
@ 2026-11-20 9:10 ` Petr Mladek
0 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 9:10 UTC (permalink / raw)
To: Zack Rusin
Cc: Andrew Morton, Baoquan He, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Dave Young, Borislav Petkov, Ajay Kaher,
Alexey Makhalov, x86, Joel Granados, Thomas Gleixner, Ingo Molnar,
Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, linux-kernel, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, linux-doc, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan
On Wed 2026-11-18 01:01:49, Zack Rusin wrote:
> A VMware guest may be unable to save its own logs after a crash. Copy
> the newest kernel log records to the host's vmware.log before kdump,
> so they remain available if the capture kernel fails.
>
> Register the sender on the platform panic notifier list and send the
> log through the low-bandwidth register interface. Allocate a fixed
> 8 KiB buffer during early init; 4 KiB can lose useful stack-trace
> context. The callback allocates no memory and emits no printk
> messages. Limit the transfer to the buffer size and make at most three
> attempts, retrying only if a VM checkpoint interrupts the transfer.
>
> Enable logging by default only in guests without memory encryption;
> encrypted guests should send their log to the host only when an
> administrator opts in. The copy is best-effort diagnostics; kdump does
> not depend on it succeeding.
>
> Suggested-by: Michael Kelley <mhklinux@outlook.com>
> Link: https://lore.kernel.org/r/SN6PR02MB41574A11D309A0530C63E0FED4842@SN6PR02MB4157.namprd02.prod.outlook.com
> Link: https://lore.kernel.org/r/20260309235250.2611115-3-alexey.makhalov@broadcom.com
> Co-developed-by: Bo Gan <bo.gan@broadcom.com>
> Signed-off-by: Bo Gan <bo.gan@broadcom.com>
> Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
I made just a quick review of the string manipulation and
kmsg_dump_get_buffer() API use. And it looks good to me:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Note that I am not familiar with the vmware hypercalls so that
I did not check this part.
Some nits below.
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -52,6 +57,23 @@
> +#define VMWARE_LOG_BUF_SIZE SZ_8K
> +#define VMWARE_LOG_ATTEMPTS 3
> +#define VMWARE_LOG_PREFIX "log "
> +#define VMWARE_LOG_PREFIX_LEN (sizeof(VMWARE_LOG_PREFIX) - 1)
[...]
> +static int vmware_log_send_once(const struct vmware_rpc_channel *channel,
> + const char *buffer, size_t length)
> +{
> + u32 info;
> +
> + vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDSIZE, length,
> + (u32)channel->id << 16, channel->cookie_high,
> + channel->cookie_low, &info);
> + if (!(info & VMWARE_MSG_STATUS_SUCCESS))
> + return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
> +
> + while (length) {
> + size_t bytes = min_t(size_t, length, sizeof(u32));
> + u32 word = 0;
> +
> + memcpy(&word, buffer, bytes);
> + vmware_hypercall5(VMWARE_CMD_MESSAGE | VMWARE_MSG_SENDPAYLOAD,
> + word, (u32)channel->id << 16,
> + channel->cookie_high, channel->cookie_low,
> + &info);
> + if (!(info & VMWARE_MSG_STATUS_SUCCESS))
> + return info & VMWARE_MSG_STATUS_CPT ? -EAGAIN : -EIO;
> +
> + buffer += bytes;
> + length -= bytes;
> + }
> +
> + return 0;
> +}
[...]
> +static int vmware_panic_log_notify(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct kmsg_dump_iter iter;
> + char *buffer = page_address(vmware_panic_page);
> + size_t length = 0;
I would add:
BUILD_BUG_ON(VMWARE_LOG_PREFIX_LEN > VMWARE_LOG_BUF_SIZE);
just to be on the safe side.
> +
> + if (!READ_ONCE(vmware_record_panic_msg))
> + return NOTIFY_DONE;
> +
> + memcpy(buffer, VMWARE_LOG_PREFIX, VMWARE_LOG_PREFIX_LEN);
I would feel more comfortable when the trailing '\0' gets copied as
well, e.g.
strscpy(buffer, VMWARE_LOG_PREFIX);
It is not strictly needed because the length is counted
explicitly, strlen() is not used. Also vmware_log_rpc() does
not send the trailing '\0'.
So, it is a rather a defensive programming. The buffer might be handled
another way in the future, e.g. printed by some debug code, tracing, ...
> + kmsg_dump_rewind(&iter);
> + (void)kmsg_dump_get_buffer(&iter, true,
> + buffer + VMWARE_LOG_PREFIX_LEN,
> + VMWARE_LOG_BUF_SIZE - VMWARE_LOG_PREFIX_LEN,
> + &length);
> + (void)vmware_log_rpc(buffer, length + VMWARE_LOG_PREFIX_LEN);
> +
> + return NOTIFY_DONE;
> +}
Best Regards,
Petr
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:01 ` Zack Rusin
-1 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, linux-kernel,
John Ogness, Steven Rostedt, Sergey Senozhatsky, Kees Cook,
Jonathan Corbet, Bo Gan, Brennan Lamoreaux, kexec, linux-doc,
Guilherme G. Piccoli, Maaz Mombasawala, Shuah Khan, Randy Dunlap,
Stephen Brennan, Michael Kelley, Ian Forbes, Bradley Morgan
Allow administrators to disable host log transfer on ordinary guests or
opt in on encrypted guests. Expose the boolean recording policy through
kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
Zero disables recording, nonzero integers enable it, and reads return
0 or 1.
Register the sysctl only after the logger is ready. A registration failure
leaves the internal default in force. Document that the log is sent
before kdump, and that disable_panic_notifiers_platform_list also skips
it.
Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: No change.
v3: Document the platform list ordering and the disable switch, and fix
the short section-title underline reported by Sashiko. No code change
from v2.
Documentation/admin-guide/sysctl/kernel.rst | 20 ++++++++++++++++++++
arch/x86/kernel/cpu/vmware.c | 15 +++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 608055d7ccc4..be2d5aa52362 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1680,6 +1680,26 @@ entry will default to 2 instead of 0.
= =============================================================
+vmware_record_panic_msg
+=======================
+
+Controls whether kmsg data is written to the host's ``vmware.log`` on
+panic. This setting does not control the separate VMware guest-crash
+event. Writing zero disables recording; writing a nonzero integer
+enables it. Reads return 0 or 1.
+
+= ==============================================================
+0 Do not write kmsg data to ``vmware.log``. This is the default
+ for encrypted guests.
+1 Write kmsg data to ``vmware.log``. This is the default for
+ ordinary guests.
+= ==============================================================
+
+The data is written by a platform panic notifier: early in panic,
+before kdump, and also when a fatal oops enters kdump without a panic.
+Setting ``disable_panic_notifiers_platform_list`` skips it as well.
+
+
warn_limit
==========
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 0c6f7248a665..8c8b6dd7c3e8 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -33,6 +33,7 @@
#include <linux/reboot.h>
#include <linux/sizes.h>
#include <linux/static_call.h>
+#include <linux/sysctl.h>
#include <linux/wordpart.h>
#include <linux/sched/cputime.h>
#include <asm/div64.h>
@@ -260,6 +261,16 @@ static int vmware_log_rpc(const char *buffer, size_t length)
static struct page *vmware_panic_page;
static bool vmware_record_panic_msg;
+static const struct ctl_table vmware_panic_sysctls[] = {
+ {
+ .procname = "vmware_record_panic_msg",
+ .data = &vmware_record_panic_msg,
+ .maxlen = sizeof(vmware_record_panic_msg),
+ .mode = 0644,
+ .proc_handler = proc_dobool,
+ },
+};
+
static int vmware_panic_log_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
@@ -311,6 +322,10 @@ static int __init vmware_panic_log_init(void)
vmware_panic_page = NULL;
}
+ if (vmware_panic_page && IS_ENABLED(CONFIG_SYSCTL) &&
+ !register_sysctl("kernel", vmware_panic_sysctls))
+ pr_err("failed to register panic log sysctl\n");
+
return 0;
}
early_initcall(vmware_panic_log_init);
^ permalink raw reply related [flat|nested] 43+ messages in thread* [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 6:01 ` Zack Rusin
0 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: linux-doc, Kees Cook, Dave Hansen, Stephen Brennan, Bo Gan,
H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, linux-kernel,
Ian Forbes, Sergey Senozhatsky, Thomas Gleixner
Allow administrators to disable host log transfer on ordinary guests or
opt in on encrypted guests. Expose the boolean recording policy through
kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
Zero disables recording, nonzero integers enable it, and reads return
0 or 1.
Register the sysctl only after the logger is ready. A registration failure
leaves the internal default in force. Document that the log is sent
before kdump, and that disable_panic_notifiers_platform_list also skips
it.
Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: No change.
v3: Document the platform list ordering and the disable switch, and fix
the short section-title underline reported by Sashiko. No code change
from v2.
Documentation/admin-guide/sysctl/kernel.rst | 20 ++++++++++++++++++++
arch/x86/kernel/cpu/vmware.c | 15 +++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 608055d7ccc4..be2d5aa52362 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1680,6 +1680,26 @@ entry will default to 2 instead of 0.
= =============================================================
+vmware_record_panic_msg
+=======================
+
+Controls whether kmsg data is written to the host's ``vmware.log`` on
+panic. This setting does not control the separate VMware guest-crash
+event. Writing zero disables recording; writing a nonzero integer
+enables it. Reads return 0 or 1.
+
+= ==============================================================
+0 Do not write kmsg data to ``vmware.log``. This is the default
+ for encrypted guests.
+1 Write kmsg data to ``vmware.log``. This is the default for
+ ordinary guests.
+= ==============================================================
+
+The data is written by a platform panic notifier: early in panic,
+before kdump, and also when a fatal oops enters kdump without a panic.
+Setting ``disable_panic_notifiers_platform_list`` skips it as well.
+
+
warn_limit
==========
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 0c6f7248a665..8c8b6dd7c3e8 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -33,6 +33,7 @@
#include <linux/reboot.h>
#include <linux/sizes.h>
#include <linux/static_call.h>
+#include <linux/sysctl.h>
#include <linux/wordpart.h>
#include <linux/sched/cputime.h>
#include <asm/div64.h>
@@ -260,6 +261,16 @@ static int vmware_log_rpc(const char *buffer, size_t length)
static struct page *vmware_panic_page;
static bool vmware_record_panic_msg;
+static const struct ctl_table vmware_panic_sysctls[] = {
+ {
+ .procname = "vmware_record_panic_msg",
+ .data = &vmware_record_panic_msg,
+ .maxlen = sizeof(vmware_record_panic_msg),
+ .mode = 0644,
+ .proc_handler = proc_dobool,
+ },
+};
+
static int vmware_panic_log_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
@@ -311,6 +322,10 @@ static int __init vmware_panic_log_init(void)
vmware_panic_page = NULL;
}
+ if (vmware_panic_page && IS_ENABLED(CONFIG_SYSCTL) &&
+ !register_sysctl("kernel", vmware_panic_sysctls))
+ pr_err("failed to register panic log sysctl\n");
+
return 0;
}
early_initcall(vmware_panic_log_init);
^ permalink raw reply related [flat|nested] 43+ messages in thread* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:14 ` sashiko-bot
-1 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:14 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Michael S. Tsirkin, Kees Cook, Dave Hansen, Stephen Brennan,
Bo Gan, H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Eugenio Perez, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner
> Allow administrators to disable host log transfer on ordinary guests or
> opt in on encrypted guests. Expose the boolean recording policy through
> kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> Zero disables recording, nonzero integers enable it, and reads return
> 0 or 1.
>
> Register the sysctl only after the logger is ready. A registration failure
> leaves the internal default in force. Document that the log is sent
> before kdump, and that disable_panic_notifiers_platform_list also skips
> it.
>
> Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=3
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 6:14 ` sashiko-bot
0 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:14 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan, Michael S. Tsirkin,
Eugenio Perez
> Allow administrators to disable host log transfer on ordinary guests or
> opt in on encrypted guests. Expose the boolean recording policy through
> kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> Zero disables recording, nonzero integers enable it, and reads return
> 0 or 1.
>
> Register the sysctl only after the logger is ready. A registration failure
> leaves the internal default in force. Document that the log is sent
> before kdump, and that disable_panic_notifiers_platform_list also skips
> it.
>
> Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=3
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 6:14 ` sashiko-bot
@ 2026-11-18 6:42 ` Baoquan He
-1 siblings, 0 replies; 43+ messages in thread
From: Baoquan He @ 2026-11-18 6:42 UTC (permalink / raw)
To: sashiko-reviews
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Bradley Morgan, Pasha Tatashin,
John Ogness, virtualization, Steven Rostedt, Maaz Mombasawala,
Borislav Petkov, Shuah Khan, Michael Kelley, Randy Dunlap, kexec,
Ian Forbes, Sergey Senozhatsky, Michael S. Tsirkin,
Pratyush Yadav, Andrew Morton, Mike Rapoport
On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > Allow administrators to disable host log transfer on ordinary guests or
> > opt in on encrypted guests. Expose the boolean recording policy through
> > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > Zero disables recording, nonzero integers enable it, and reads return
> > 0 or 1.
> >
> > Register the sysctl only after the logger is ready. A registration failure
> > leaves the internal default in force. Document that the log is sent
> > before kdump, and that disable_panic_notifiers_platform_list also skips
> > it.
> >
> > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>
> Sashiko has reviewed this patch and found no issues.
It might be better to turn off this message if not issues found, just
like what LKP bot has been doing.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 6:42 ` Baoquan He
0 siblings, 0 replies; 43+ messages in thread
From: Baoquan He @ 2026-11-18 6:42 UTC (permalink / raw)
To: sashiko-reviews
Cc: Zack Rusin, Andrew Morton, Petr Mladek, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young, Borislav Petkov,
Ajay Kaher, Alexey Makhalov, x86, Joel Granados, Thomas Gleixner,
Ingo Molnar, Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, John Ogness, Steven Rostedt,
Sergey Senozhatsky, Kees Cook, Jonathan Corbet, Bo Gan,
Brennan Lamoreaux, kexec, Guilherme G. Piccoli, Maaz Mombasawala,
Shuah Khan, Randy Dunlap, Stephen Brennan, Michael Kelley,
Ian Forbes, Bradley Morgan, Michael S. Tsirkin, Eugenio Perez
On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > Allow administrators to disable host log transfer on ordinary guests or
> > opt in on encrypted guests. Expose the boolean recording policy through
> > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > Zero disables recording, nonzero integers enable it, and reads return
> > 0 or 1.
> >
> > Register the sysctl only after the logger is ready. A registration failure
> > leaves the internal default in force. Document that the log is sent
> > before kdump, and that disable_panic_notifiers_platform_list also skips
> > it.
> >
> > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>
> Sashiko has reviewed this patch and found no issues.
It might be better to turn off this message if not issues found, just
like what LKP bot has been doing.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 6:42 ` Baoquan He
@ 2026-11-18 7:02 ` Andrew Morton
-1 siblings, 0 replies; 43+ messages in thread
From: Andrew Morton @ 2026-11-18 7:02 UTC (permalink / raw)
To: Baoquan He
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, sashiko, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Bradley Morgan, Pasha Tatashin,
John Ogness, virtualization, Steven Rostedt, Maaz Mombasawala,
Borislav Petkov, Shuah Khan, Michael Kelley, sashiko-reviews,
Randy Dunlap, kexec, Ian Forbes, Sergey Senozhatsky,
Michael S. Tsirkin, Pratyush Yadav, Mike Rapoport
On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
> On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > > Allow administrators to disable host log transfer on ordinary guests or
> > > opt in on encrypted guests. Expose the boolean recording policy through
> > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > > Zero disables recording, nonzero integers enable it, and reads return
> > > 0 or 1.
> > >
> > > Register the sysctl only after the logger is ready. A registration failure
> > > leaves the internal default in force. Document that the log is sent
> > > before kdump, and that disable_panic_notifiers_platform_list also skips
> > > it.
> > >
> > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> >
> > Sashiko has reviewed this patch and found no issues.
>
> It might be better to turn off this message if not issues found, just
> like what LKP bot has been doing.
(+sashiko@lists.linux.dev)
Yes please.
These emails do have a little bit of value: they tell you that Sashiko
was able to apply the patch and to review it. I guess. Or something.
Me:
:0 D:
* ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
* B ?? ^Sashiko has reviewed this patch and found no issues\.$
/home/akpm/.nsmail-zip/Trash
hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
1140
hp2:/home/akpm>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 7:02 ` Andrew Morton
0 siblings, 0 replies; 43+ messages in thread
From: Andrew Morton @ 2026-11-18 7:02 UTC (permalink / raw)
To: Baoquan He
Cc: sashiko-reviews, Zack Rusin, Petr Mladek, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young, Borislav Petkov,
Ajay Kaher, Alexey Makhalov, x86, Joel Granados, Thomas Gleixner,
Ingo Molnar, Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, John Ogness, Steven Rostedt,
Sergey Senozhatsky, Kees Cook, Jonathan Corbet, Bo Gan,
Brennan Lamoreaux, kexec, Guilherme G. Piccoli, Maaz Mombasawala,
Shuah Khan, Randy Dunlap, Stephen Brennan, Michael Kelley,
Ian Forbes, Bradley Morgan, Michael S. Tsirkin, Eugenio Perez,
sashiko
On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
> On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > > Allow administrators to disable host log transfer on ordinary guests or
> > > opt in on encrypted guests. Expose the boolean recording policy through
> > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > > Zero disables recording, nonzero integers enable it, and reads return
> > > 0 or 1.
> > >
> > > Register the sysctl only after the logger is ready. A registration failure
> > > leaves the internal default in force. Document that the log is sent
> > > before kdump, and that disable_panic_notifiers_platform_list also skips
> > > it.
> > >
> > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> >
> > Sashiko has reviewed this patch and found no issues.
>
> It might be better to turn off this message if not issues found, just
> like what LKP bot has been doing.
(+sashiko@lists.linux.dev)
Yes please.
These emails do have a little bit of value: they tell you that Sashiko
was able to apply the patch and to review it. I guess. Or something.
Me:
:0 D:
* ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
* B ?? ^Sashiko has reviewed this patch and found no issues\.$
/home/akpm/.nsmail-zip/Trash
hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
1140
hp2:/home/akpm>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 7:02 ` Andrew Morton
@ 2026-11-18 7:51 ` Baoquan He
-1 siblings, 0 replies; 43+ messages in thread
From: Baoquan He @ 2026-11-18 7:51 UTC (permalink / raw)
To: Andrew Morton
Cc: sashiko-reviews, Zack Rusin, Petr Mladek, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young, Borislav Petkov,
Ajay Kaher, Alexey Makhalov, x86, Joel Granados, Thomas Gleixner,
Ingo Molnar, Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, John Ogness, Steven Rostedt,
Sergey Senozhatsky, Kees Cook, Jonathan Corbet, Bo Gan,
Brennan Lamoreaux, kexec, Guilherme G. Piccoli, Maaz Mombasawala,
Shuah Khan, Randy Dunlap, Stephen Brennan, Michael Kelley,
Ian Forbes, Bradley Morgan, Michael S. Tsirkin, Eugenio Perez,
sashiko
On 11/17/26 at 11:02pm, Andrew Morton wrote:
> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
>
> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > > > Allow administrators to disable host log transfer on ordinary guests or
> > > > opt in on encrypted guests. Expose the boolean recording policy through
> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > > > Zero disables recording, nonzero integers enable it, and reads return
> > > > 0 or 1.
> > > >
> > > > Register the sysctl only after the logger is ready. A registration failure
> > > > leaves the internal default in force. Document that the log is sent
> > > > before kdump, and that disable_panic_notifiers_platform_list also skips
> > > > it.
> > > >
> > > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> > >
> > > Sashiko has reviewed this patch and found no issues.
> >
> > It might be better to turn off this message if not issues found, just
> > like what LKP bot has been doing.
>
> (+sashiko@lists.linux.dev)
>
> Yes please.
>
> These emails do have a little bit of value: they tell you that Sashiko
> was able to apply the patch and to review it. I guess. Or something.
In that case a message saying Sashiko can't apply the entire patchset
is better.
>
> Me:
>
> :0 D:
> * ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
> * B ?? ^Sashiko has reviewed this patch and found no issues\.$
> /home/akpm/.nsmail-zip/Trash
>
> hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
> 1140
> hp2:/home/akpm>
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 7:51 ` Baoquan He
0 siblings, 0 replies; 43+ messages in thread
From: Baoquan He @ 2026-11-18 7:51 UTC (permalink / raw)
To: Andrew Morton
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, sashiko, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Bradley Morgan, Pasha Tatashin,
John Ogness, virtualization, Steven Rostedt, Maaz Mombasawala,
Borislav Petkov, Shuah Khan, Michael Kelley, sashiko-reviews,
Randy Dunlap, kexec, Ian Forbes, Sergey Senozhatsky,
Michael S. Tsirkin, Pratyush Yadav, Mike Rapoport
On 11/17/26 at 11:02pm, Andrew Morton wrote:
> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
>
> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > > > Allow administrators to disable host log transfer on ordinary guests or
> > > > opt in on encrypted guests. Expose the boolean recording policy through
> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > > > Zero disables recording, nonzero integers enable it, and reads return
> > > > 0 or 1.
> > > >
> > > > Register the sysctl only after the logger is ready. A registration failure
> > > > leaves the internal default in force. Document that the log is sent
> > > > before kdump, and that disable_panic_notifiers_platform_list also skips
> > > > it.
> > > >
> > > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> > >
> > > Sashiko has reviewed this patch and found no issues.
> >
> > It might be better to turn off this message if not issues found, just
> > like what LKP bot has been doing.
>
> (+sashiko@lists.linux.dev)
>
> Yes please.
>
> These emails do have a little bit of value: they tell you that Sashiko
> was able to apply the patch and to review it. I guess. Or something.
In that case a message saying Sashiko can't apply the entire patchset
is better.
>
> Me:
>
> :0 D:
> * ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
> * B ?? ^Sashiko has reviewed this patch and found no issues\.$
> /home/akpm/.nsmail-zip/Trash
>
> hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
> 1140
> hp2:/home/akpm>
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 7:51 ` Baoquan He
@ 2026-11-18 7:53 ` Bradley Morgan
-1 siblings, 0 replies; 43+ messages in thread
From: Bradley Morgan @ 2026-11-18 7:53 UTC (permalink / raw)
To: Baoquan He, Andrew Morton
Cc: sashiko-reviews, Zack Rusin, Petr Mladek, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young, Borislav Petkov,
Ajay Kaher, Alexey Makhalov, x86, Joel Granados, Thomas Gleixner,
Ingo Molnar, Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, John Ogness, Steven Rostedt,
Sergey Senozhatsky, Kees Cook, Jonathan Corbet, Bo Gan,
Brennan Lamoreaux, kexec, Guilherme G. Piccoli, Maaz Mombasawala,
Shuah Khan, Randy Dunlap, Stephen Brennan, Michael Kelley,
Ian Forbes, Michael S. Tsirkin, Eugenio Perez, sashiko
On 18 November 2026 07:51:35 GMT, Baoquan He <baoquan.he@linux.dev> wrote:
>On 11/17/26 at 11:02pm, Andrew Morton wrote:
>> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev>
>wrote:
>>
>> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
>> > > > Allow administrators to disable host log transfer on ordinary
>guests or
>> > > > opt in on encrypted guests. Expose the boolean recording policy
>through
>> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel
>suggested.
>> > > > Zero disables recording, nonzero integers enable it, and reads
>return
>> > > > 0 or 1.
>> > > >
>> > > > Register the sysctl only after the logger is ready. A registration
>failure
>> > > > leaves the internal default in force. Document that the log is
>sent
>> > > > before kdump, and that disable_panic_notifiers_platform_list also
>skips
>> > > > it.
>> > > >
>> > > > Link:
>https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
>> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>> > >
>> > > Sashiko has reviewed this patch and found no issues.
>> >
>> > It might be better to turn off this message if not issues found, just
>> > like what LKP bot has been doing.
>>
>> (+sashiko@lists.linux.dev)
>>
>> Yes please.
>>
>> These emails do have a little bit of value: they tell you that Sashiko
>> was able to apply the patch and to review it. I guess. Or something.
>
>In that case a message saying Sashiko can't apply the entire patchset
>is better.
yes my sashiko emails go to spam automatically (not cuz I set it, but
cuz I get so much "no issues!" Emails, that it clogs up my inbox.
What even is the need to have the no issues emails? If one was THAT
interested in sashiko, they could search for it?
>
>>
>> Me:
>>
>> :0 D:
>> * ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
>> * B ?? ^Sashiko has reviewed this patch and found no issues\.$
>> /home/akpm/.nsmail-zip/Trash
>>
>> hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
>> 1140
>> hp2:/home/akpm>
>>
--- Thanks!
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 7:53 ` Bradley Morgan
0 siblings, 0 replies; 43+ messages in thread
From: Bradley Morgan @ 2026-11-18 7:53 UTC (permalink / raw)
To: Baoquan He, Andrew Morton
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, sashiko, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Pasha Tatashin, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, sashiko-reviews, Randy Dunlap, kexec,
Ian Forbes, Sergey Senozhatsky, Michael S. Tsirkin,
Pratyush Yadav, Mike Rapoport
On 18 November 2026 07:51:35 GMT, Baoquan He <baoquan.he@linux.dev> wrote:
>On 11/17/26 at 11:02pm, Andrew Morton wrote:
>> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev>
>wrote:
>>
>> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
>> > > > Allow administrators to disable host log transfer on ordinary
>guests or
>> > > > opt in on encrypted guests. Expose the boolean recording policy
>through
>> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel
>suggested.
>> > > > Zero disables recording, nonzero integers enable it, and reads
>return
>> > > > 0 or 1.
>> > > >
>> > > > Register the sysctl only after the logger is ready. A registration
>failure
>> > > > leaves the internal default in force. Document that the log is
>sent
>> > > > before kdump, and that disable_panic_notifiers_platform_list also
>skips
>> > > > it.
>> > > >
>> > > > Link:
>https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
>> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>> > >
>> > > Sashiko has reviewed this patch and found no issues.
>> >
>> > It might be better to turn off this message if not issues found, just
>> > like what LKP bot has been doing.
>>
>> (+sashiko@lists.linux.dev)
>>
>> Yes please.
>>
>> These emails do have a little bit of value: they tell you that Sashiko
>> was able to apply the patch and to review it. I guess. Or something.
>
>In that case a message saying Sashiko can't apply the entire patchset
>is better.
yes my sashiko emails go to spam automatically (not cuz I set it, but
cuz I get so much "no issues!" Emails, that it clogs up my inbox.
What even is the need to have the no issues emails? If one was THAT
interested in sashiko, they could search for it?
>
>>
>> Me:
>>
>> :0 D:
>> * ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
>> * B ?? ^Sashiko has reviewed this patch and found no issues\.$
>> /home/akpm/.nsmail-zip/Trash
>>
>> hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
>> 1140
>> hp2:/home/akpm>
>>
--- Thanks!
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 7:53 ` Bradley Morgan
@ 2026-11-18 8:09 ` Baoquan He
-1 siblings, 0 replies; 43+ messages in thread
From: Baoquan He @ 2026-11-18 8:09 UTC (permalink / raw)
To: Bradley Morgan
Cc: Andrew Morton, sashiko-reviews, Zack Rusin, Petr Mladek,
Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Dave Young,
Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Michael S. Tsirkin, Eugenio Perez,
sashiko
On 11/18/26 at 07:53am, Bradley Morgan wrote:
> On 18 November 2026 07:51:35 GMT, Baoquan He <baoquan.he@linux.dev> wrote:
> >On 11/17/26 at 11:02pm, Andrew Morton wrote:
> >> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev>
> >wrote:
> >>
> >> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> >> > > > Allow administrators to disable host log transfer on ordinary
> >guests or
> >> > > > opt in on encrypted guests. Expose the boolean recording policy
> >through
> >> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel
> >suggested.
> >> > > > Zero disables recording, nonzero integers enable it, and reads
> >return
> >> > > > 0 or 1.
> >> > > >
> >> > > > Register the sysctl only after the logger is ready. A registration
> >failure
> >> > > > leaves the internal default in force. Document that the log is
> >sent
> >> > > > before kdump, and that disable_panic_notifiers_platform_list also
> >skips
> >> > > > it.
> >> > > >
> >> > > > Link:
> >https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> >> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> >> > >
> >> > > Sashiko has reviewed this patch and found no issues.
> >> >
> >> > It might be better to turn off this message if not issues found, just
> >> > like what LKP bot has been doing.
> >>
> >> (+sashiko@lists.linux.dev)
> >>
> >> Yes please.
> >>
> >> These emails do have a little bit of value: they tell you that Sashiko
> >> was able to apply the patch and to review it. I guess. Or something.
> >
> >In that case a message saying Sashiko can't apply the entire patchset
> >is better.
>
> yes my sashiko emails go to spam automatically (not cuz I set it, but
> cuz I get so much "no issues!" Emails, that it clogs up my inbox.
>
> What even is the need to have the no issues emails? If one was THAT
> interested in sashiko, they could search for it?
Yeah, searching for it is one good way. Not sure if it's convenient for
people like Andrew and Mike who need pick patch. They may need check
patchset one by one if Sashiko can't apply patch while keep silent. And
some patch authors could be new, they could mistake sashiko being silent
as no issue. I did that before until Andrew told me in a private message.
If there's a document telling people where and how to search, that's
also good.
>
> >
> >>
> >> Me:
> >>
> >> :0 D:
> >> * ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
> >> * B ?? ^Sashiko has reviewed this patch and found no issues\.$
> >> /home/akpm/.nsmail-zip/Trash
> >>
> >> hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
> >> 1140
> >> hp2:/home/akpm>
> >>
>
> --- Thanks!
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 8:09 ` Baoquan He
0 siblings, 0 replies; 43+ messages in thread
From: Baoquan He @ 2026-11-18 8:09 UTC (permalink / raw)
To: Bradley Morgan
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, sashiko, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Pasha Tatashin, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, sashiko-reviews, Randy Dunlap, kexec,
Ian Forbes, Sergey Senozhatsky, Michael S. Tsirkin, Mike Rapoport,
Andrew Morton, Pratyush Yadav
On 11/18/26 at 07:53am, Bradley Morgan wrote:
> On 18 November 2026 07:51:35 GMT, Baoquan He <baoquan.he@linux.dev> wrote:
> >On 11/17/26 at 11:02pm, Andrew Morton wrote:
> >> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev>
> >wrote:
> >>
> >> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> >> > > > Allow administrators to disable host log transfer on ordinary
> >guests or
> >> > > > opt in on encrypted guests. Expose the boolean recording policy
> >through
> >> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel
> >suggested.
> >> > > > Zero disables recording, nonzero integers enable it, and reads
> >return
> >> > > > 0 or 1.
> >> > > >
> >> > > > Register the sysctl only after the logger is ready. A registration
> >failure
> >> > > > leaves the internal default in force. Document that the log is
> >sent
> >> > > > before kdump, and that disable_panic_notifiers_platform_list also
> >skips
> >> > > > it.
> >> > > >
> >> > > > Link:
> >https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> >> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> >> > >
> >> > > Sashiko has reviewed this patch and found no issues.
> >> >
> >> > It might be better to turn off this message if not issues found, just
> >> > like what LKP bot has been doing.
> >>
> >> (+sashiko@lists.linux.dev)
> >>
> >> Yes please.
> >>
> >> These emails do have a little bit of value: they tell you that Sashiko
> >> was able to apply the patch and to review it. I guess. Or something.
> >
> >In that case a message saying Sashiko can't apply the entire patchset
> >is better.
>
> yes my sashiko emails go to spam automatically (not cuz I set it, but
> cuz I get so much "no issues!" Emails, that it clogs up my inbox.
>
> What even is the need to have the no issues emails? If one was THAT
> interested in sashiko, they could search for it?
Yeah, searching for it is one good way. Not sure if it's convenient for
people like Andrew and Mike who need pick patch. They may need check
patchset one by one if Sashiko can't apply patch while keep silent. And
some patch authors could be new, they could mistake sashiko being silent
as no issue. I did that before until Andrew told me in a private message.
If there's a document telling people where and how to search, that's
also good.
>
> >
> >>
> >> Me:
> >>
> >> :0 D:
> >> * ^From:[ ]*sashiko-bot@kernel\.org[ ]*$
> >> * B ?? ^Sashiko has reviewed this patch and found no issues\.$
> >> /home/akpm/.nsmail-zip/Trash
> >>
> >> hp2:/home/akpm> grep "From:.*sashiko-bot" .nsmail-zip/Trash | wc -l
> >> 1140
> >> hp2:/home/akpm>
> >>
>
> --- Thanks!
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 7:51 ` Baoquan He
@ 2026-11-19 11:07 ` Pratyush Yadav
-1 siblings, 0 replies; 43+ messages in thread
From: Pratyush Yadav @ 2026-11-19 11:07 UTC (permalink / raw)
To: Baoquan He
Cc: Andrew Morton, sashiko-reviews, Zack Rusin, Petr Mladek,
Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Dave Young,
Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan, Michael S. Tsirkin,
Eugenio Perez, sashiko
On Wed, Nov 18 2026, Baoquan He wrote:
> On 11/17/26 at 11:02pm, Andrew Morton wrote:
>> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
>>
>> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
>> > > > Allow administrators to disable host log transfer on ordinary guests or
>> > > > opt in on encrypted guests. Expose the boolean recording policy through
>> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
>> > > > Zero disables recording, nonzero integers enable it, and reads return
>> > > > 0 or 1.
>> > > >
>> > > > Register the sysctl only after the logger is ready. A registration failure
>> > > > leaves the internal default in force. Document that the log is sent
>> > > > before kdump, and that disable_panic_notifiers_platform_list also skips
>> > > > it.
>> > > >
>> > > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
>> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>> > >
>> > > Sashiko has reviewed this patch and found no issues.
>> >
>> > It might be better to turn off this message if not issues found, just
>> > like what LKP bot has been doing.
>>
>> (+sashiko@lists.linux.dev)
>>
>> Yes please.
>>
>> These emails do have a little bit of value: they tell you that Sashiko
>> was able to apply the patch and to review it. I guess. Or something.
>
> In that case a message saying Sashiko can't apply the entire patchset
> is better.
Yeah, sounds better.
Or, perhaps Sashiko can reply to the cover with a list of patches it
found no issues with. That should reduce the spam on big series at
least, while still keeping the signal of "Sashiko looked at this".
[...]
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-19 11:07 ` Pratyush Yadav
0 siblings, 0 replies; 43+ messages in thread
From: Pratyush Yadav @ 2026-11-19 11:07 UTC (permalink / raw)
To: Baoquan He
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, sashiko, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Bradley Morgan, Pasha Tatashin,
John Ogness, virtualization, Steven Rostedt, Maaz Mombasawala,
Borislav Petkov, Shuah Khan, Michael Kelley, sashiko-reviews,
Randy Dunlap, kexec, Ian Forbes, Sergey Senozhatsky,
Michael S. Tsirkin, Mike Rapoport, Andrew Morton, Pratyush Yadav
On Wed, Nov 18 2026, Baoquan He wrote:
> On 11/17/26 at 11:02pm, Andrew Morton wrote:
>> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
>>
>> > On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
>> > > > Allow administrators to disable host log transfer on ordinary guests or
>> > > > opt in on encrypted guests. Expose the boolean recording policy through
>> > > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
>> > > > Zero disables recording, nonzero integers enable it, and reads return
>> > > > 0 or 1.
>> > > >
>> > > > Register the sysctl only after the logger is ready. A registration failure
>> > > > leaves the internal default in force. Document that the log is sent
>> > > > before kdump, and that disable_panic_notifiers_platform_list also skips
>> > > > it.
>> > > >
>> > > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
>> > > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>> > >
>> > > Sashiko has reviewed this patch and found no issues.
>> >
>> > It might be better to turn off this message if not issues found, just
>> > like what LKP bot has been doing.
>>
>> (+sashiko@lists.linux.dev)
>>
>> Yes please.
>>
>> These emails do have a little bit of value: they tell you that Sashiko
>> was able to apply the patch and to review it. I guess. Or something.
>
> In that case a message saying Sashiko can't apply the entire patchset
> is better.
Yeah, sounds better.
Or, perhaps Sashiko can reply to the cover with a list of patches it
found no issues with. That should reduce the spam on big series at
least, while still keeping the signal of "Sashiko looked at this".
[...]
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 7:02 ` Andrew Morton
@ 2026-11-19 15:35 ` Roman Gushchin
-1 siblings, 0 replies; 43+ messages in thread
From: Roman Gushchin @ 2026-11-19 15:35 UTC (permalink / raw)
To: Andrew Morton
Cc: Baoquan He, sashiko-reviews, Zack Rusin, Petr Mladek,
Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Dave Young,
Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan, Michael S. Tsirkin,
Eugenio Perez, sashiko
Andrew Morton <akpm@linux-foundation.org> writes:
> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
>
>> On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
>> > > Allow administrators to disable host log transfer on ordinary guests or
>> > > opt in on encrypted guests. Expose the boolean recording policy through
>> > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
>> > > Zero disables recording, nonzero integers enable it, and reads return
>> > > 0 or 1.
>> > >
>> > > Register the sysctl only after the logger is ready. A registration failure
>> > > leaves the internal default in force. Document that the log is sent
>> > > before kdump, and that disable_panic_notifiers_platform_list also skips
>> > > it.
>> > >
>> > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
>> > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>> >
>> > Sashiko has reviewed this patch and found no issues.
>>
>> It might be better to turn off this message if not issues found, just
>> like what LKP bot has been doing.
>
> (+sashiko@lists.linux.dev)
>
> Yes please.
>
> These emails do have a little bit of value: they tell you that Sashiko
> was able to apply the patch and to review it. I guess. Or something.
They are opt-in and some maintainers asked for them, so Idk if globally
disabling them is a good idea. Johannes suggested to send one email per
patchset, which I like as an idea, will implement a bit later.
I like the idea (from the thread) to send an email if a patch(set)
hasn't been reviewed, e.g. not applied correctly. Will implement as
opt-in feature too.
Thanks
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-19 15:35 ` Roman Gushchin
0 siblings, 0 replies; 43+ messages in thread
From: Roman Gushchin @ 2026-11-19 15:35 UTC (permalink / raw)
To: Andrew Morton
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Baoquan He, Jonathan Corbet,
Brennan Lamoreaux, x86, sashiko, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list, Petr Mladek,
Bradley Morgan, Pasha Tatashin, John Ogness, virtualization,
Steven Rostedt, Maaz Mombasawala, Borislav Petkov, Mike Rapoport,
Shuah Khan, Michael Kelley, sashiko-reviews, Randy Dunlap, kexec,
Ian Forbes, Sergey Senozhatsky, Michael S. Tsirkin,
Thomas Gleixner, Pratyush Yadav
Andrew Morton <akpm@linux-foundation.org> writes:
> On Wed, 18 Nov 2026 14:42:00 +0800 Baoquan He <baoquan.he@linux.dev> wrote:
>
>> On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
>> > > Allow administrators to disable host log transfer on ordinary guests or
>> > > opt in on encrypted guests. Expose the boolean recording policy through
>> > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
>> > > Zero disables recording, nonzero integers enable it, and reads return
>> > > 0 or 1.
>> > >
>> > > Register the sysctl only after the logger is ready. A registration failure
>> > > leaves the internal default in force. Document that the log is sent
>> > > before kdump, and that disable_panic_notifiers_platform_list also skips
>> > > it.
>> > >
>> > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
>> > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
>> >
>> > Sashiko has reviewed this patch and found no issues.
>>
>> It might be better to turn off this message if not issues found, just
>> like what LKP bot has been doing.
>
> (+sashiko@lists.linux.dev)
>
> Yes please.
>
> These emails do have a little bit of value: they tell you that Sashiko
> was able to apply the patch and to review it. I guess. Or something.
They are opt-in and some maintainers asked for them, so Idk if globally
disabling them is a good idea. Johannes suggested to send one email per
patchset, which I like as an idea, will implement a bit later.
I like the idea (from the thread) to send an email if a patch(set)
hasn't been reviewed, e.g. not applied correctly. Will implement as
opt-in feature too.
Thanks
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 6:42 ` Baoquan He
@ 2026-11-18 14:36 ` Steven Rostedt
-1 siblings, 0 replies; 43+ messages in thread
From: Steven Rostedt @ 2026-11-18 14:36 UTC (permalink / raw)
To: Baoquan He
Cc: Ajay Kaher, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Zack Rusin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Eugenio Perez, Ingo Molnar, bcm-kernel-feedback-list,
Thomas Gleixner, Petr Mladek, Bradley Morgan, Pasha Tatashin,
John Ogness, virtualization, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, sashiko-reviews, Randy Dunlap, kexec,
Ian Forbes, Sergey Senozhatsky, Michael S. Tsirkin, Mike Rapoport,
Andrew Morton, Pratyush Yadav
On Wed, 18 Nov 2026 14:42:00 +0800
Baoquan He <baoquan.he@linux.dev> wrote:
> On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > > Allow administrators to disable host log transfer on ordinary guests or
> > > opt in on encrypted guests. Expose the boolean recording policy through
> > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > > Zero disables recording, nonzero integers enable it, and reads return
> > > 0 or 1.
> > >
> > > Register the sysctl only after the logger is ready. A registration failure
> > > leaves the internal default in force. Document that the log is sent
> > > before kdump, and that disable_panic_notifiers_platform_list also skips
> > > it.
> > >
> > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> >
> > Sashiko has reviewed this patch and found no issues.
>
> It might be better to turn off this message if not issues found, just
> like what LKP bot has been doing.
I believe that's an option per mailing list. I personally like it because
to me it does add value. It tells me it was able to apply it and it didn't
find anything wrong with it. This way I know sashiko didn't ignore it.
But I understand others may not find that useful.
-- Steve
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-18 14:36 ` Steven Rostedt
0 siblings, 0 replies; 43+ messages in thread
From: Steven Rostedt @ 2026-11-18 14:36 UTC (permalink / raw)
To: Baoquan He
Cc: sashiko-reviews, Zack Rusin, Andrew Morton, Petr Mladek,
Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Dave Young,
Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Sergey Senozhatsky, Kees Cook, Jonathan Corbet, Bo Gan,
Brennan Lamoreaux, kexec, Guilherme G. Piccoli, Maaz Mombasawala,
Shuah Khan, Randy Dunlap, Stephen Brennan, Michael Kelley,
Ian Forbes, Bradley Morgan, Michael S. Tsirkin, Eugenio Perez
On Wed, 18 Nov 2026 14:42:00 +0800
Baoquan He <baoquan.he@linux.dev> wrote:
> On 11/18/26 at 06:14am, sashiko-bot@kernel.org wrote:
> > > Allow administrators to disable host log transfer on ordinary guests or
> > > opt in on encrypted guests. Expose the boolean recording policy through
> > > kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> > > Zero disables recording, nonzero integers enable it, and reads return
> > > 0 or 1.
> > >
> > > Register the sysctl only after the logger is ready. A registration failure
> > > leaves the internal default in force. Document that the log is sent
> > > before kdump, and that disable_panic_notifiers_platform_list also skips
> > > it.
> > >
> > > Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> > > Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
> >
> > Sashiko has reviewed this patch and found no issues.
>
> It might be better to turn off this message if not issues found, just
> like what LKP bot has been doing.
I believe that's an option per mailing list. I personally like it because
to me it does add value. It tells me it was able to apply it and it didn't
find anything wrong with it. This way I know sashiko didn't ignore it.
But I understand others may not find that useful.
-- Steve
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-20 9:19 ` Petr Mladek
-1 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 9:19 UTC (permalink / raw)
To: Zack Rusin
Cc: Andrew Morton, Baoquan He, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Dave Young, Borislav Petkov, Ajay Kaher,
Alexey Makhalov, x86, Joel Granados, Thomas Gleixner, Ingo Molnar,
Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, linux-kernel, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, linux-doc, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan
On Wed 2026-11-18 01:01:50, Zack Rusin wrote:
> Allow administrators to disable host log transfer on ordinary guests or
> opt in on encrypted guests. Expose the boolean recording policy through
> kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> Zero disables recording, nonzero integers enable it, and reads return
> 0 or 1.
>
> Register the sysctl only after the logger is ready. A registration failure
> leaves the internal default in force. Document that the log is sent
> before kdump, and that disable_panic_notifiers_platform_list also skips
> it.
>
> Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
LGTM:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl
@ 2026-11-20 9:19 ` Petr Mladek
0 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 9:19 UTC (permalink / raw)
To: Zack Rusin
Cc: linux-doc, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Pasha Tatashin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Ingo Molnar, bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan,
Baoquan He, John Ogness, virtualization, Steven Rostedt,
Maaz Mombasawala, Borislav Petkov, Shuah Khan, Michael Kelley,
Pratyush Yadav, Randy Dunlap, kexec, linux-kernel, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner, Andrew Morton, Mike Rapoport
On Wed 2026-11-18 01:01:50, Zack Rusin wrote:
> Allow administrators to disable host log transfer on ordinary guests or
> opt in on encrypted guests. Expose the boolean recording policy through
> kernel.vmware_record_panic_msg using proc_dobool(), as Joel suggested.
> Zero disables recording, nonzero integers enable it, and reads return
> 0 or 1.
>
> Register the sysctl only after the logger is ready. A registration failure
> leaves the internal default in force. Document that the log is sent
> before kdump, and that disable_panic_notifiers_platform_list also skips
> it.
>
> Link: https://lore.kernel.org/r/4e73yd2ofpdzl6rptzvd74no3hnyfblknoq7wzxlw7f3zjbz7c@srfabx6lsusj
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
LGTM:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:01 ` Zack Rusin
-1 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, linux-kernel,
John Ogness, Steven Rostedt, Sergey Senozhatsky, Kees Cook,
Jonathan Corbet, Bo Gan, Brennan Lamoreaux, kexec, linux-doc,
Guilherme G. Piccoli, Maaz Mombasawala, Shuah Khan, Randy Dunlap,
Stephen Brennan, Michael Kelley, Ian Forbes, Bradley Morgan
VMware accepts a structured guest-crash event, but a host configured with
backdoor.coredumpOnCrash may terminate the VM before the hypercall
returns. Keep this event separate from the log sender, which runs
earlier in panic.
Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
dumpers registered by then. Skip the event while a crash kernel is loaded
so the host cannot terminate the guest before kdump saves its vmcore.
Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
panic notifier. An unexpected dumper registration failure with printk
enabled leaves reporting disabled rather than overtaking working dumpers.
Link: https://lore.kernel.org/r/20260309235250.2611115-4-alexey.makhalov@broadcom.com
Co-developed-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
Signed-off-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: No change.
v3: Rebase. No code change from v2.
arch/x86/include/asm/vmware.h | 1 +
arch/x86/kernel/cpu/vmware.c | 62 +++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h
index dc3cf8123914..6d3c9922c92b 100644
--- a/arch/x86/include/asm/vmware.h
+++ b/arch/x86/include/asm/vmware.h
@@ -61,6 +61,7 @@
#define VMWARE_CMD_GETHZ 45
#define VMWARE_CMD_GETVCPU_INFO 68
#define VMWARE_CMD_STEALCLOCK 91
+#define VMWARE_CMD_REPORTGUESTCRASH 102
/*
* Hypercall command mask:
* bits [6:0] command, range [0, 127]
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 8c8b6dd7c3e8..ead9f50cf89e 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -22,9 +22,12 @@
*/
#include <linux/dmi.h>
+#include <linux/atomic.h>
+#include <linux/crash_core.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/kmsg_dump.h>
+#include <linux/limits.h>
#include <linux/mm.h>
#include <linux/panic_notifier.h>
#include <linux/clocksource.h>
@@ -330,6 +333,65 @@ static int __init vmware_panic_log_init(void)
}
early_initcall(vmware_panic_log_init);
+static atomic_t vmware_crash_reported = ATOMIC_INIT(0);
+
+static void vmware_report_guest_crash(void)
+{
+ if (kexec_crash_loaded())
+ return;
+ if (atomic_xchg(&vmware_crash_reported, 1))
+ return;
+
+ vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0);
+}
+
+static void vmware_crash_report_dump(struct kmsg_dumper *dumper,
+ struct kmsg_dump_detail *detail)
+{
+ vmware_report_guest_crash();
+}
+
+static struct kmsg_dumper vmware_crash_report_dumper = {
+ .dump = vmware_crash_report_dump,
+ .max_reason = KMSG_DUMP_PANIC,
+};
+
+static int vmware_crash_report_notify(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ vmware_report_guest_crash();
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block vmware_crash_report_nb = {
+ .notifier_call = vmware_crash_report_notify,
+ .priority = INT_MIN,
+};
+
+static int __init vmware_crash_report_init(void)
+{
+ int ret;
+
+ if (!hypervisor_is_type(X86_HYPER_VMWARE))
+ return 0;
+
+ ret = kmsg_dump_register(&vmware_crash_report_dumper);
+ if (!ret)
+ return 0;
+ if (IS_ENABLED(CONFIG_PRINTK)) {
+ pr_err("failed to register crash report dumper: %d\n", ret);
+ return 0;
+ }
+
+ ret = atomic_notifier_chain_register(&panic_notifier_list,
+ &vmware_crash_report_nb);
+ if (ret)
+ pr_err("failed to register crash report notifier: %d\n", ret);
+
+ return 0;
+}
+late_initcall_sync(vmware_crash_report_init);
+
#ifdef CONFIG_PARAVIRT
static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
static bool vmw_sched_clock __initdata = true;
^ permalink raw reply related [flat|nested] 43+ messages in thread* [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
@ 2026-11-18 6:01 ` Zack Rusin
0 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-18 6:01 UTC (permalink / raw)
To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: linux-doc, Kees Cook, Dave Hansen, Stephen Brennan, Bo Gan,
H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, linux-kernel,
Ian Forbes, Sergey Senozhatsky, Thomas Gleixner
VMware accepts a structured guest-crash event, but a host configured with
backdoor.coredumpOnCrash may terminate the VM before the hypercall
returns. Keep this event separate from the log sender, which runs
earlier in panic.
Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
dumpers registered by then. Skip the event while a crash kernel is loaded
so the host cannot terminate the guest before kdump saves its vmcore.
Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
panic notifier. An unexpected dumper registration failure with printk
enabled leaves reporting disabled rather than overtaking working dumpers.
Link: https://lore.kernel.org/r/20260309235250.2611115-4-alexey.makhalov@broadcom.com
Co-developed-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
Signed-off-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
---
v4: No change.
v3: Rebase. No code change from v2.
arch/x86/include/asm/vmware.h | 1 +
arch/x86/kernel/cpu/vmware.c | 62 +++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h
index dc3cf8123914..6d3c9922c92b 100644
--- a/arch/x86/include/asm/vmware.h
+++ b/arch/x86/include/asm/vmware.h
@@ -61,6 +61,7 @@
#define VMWARE_CMD_GETHZ 45
#define VMWARE_CMD_GETVCPU_INFO 68
#define VMWARE_CMD_STEALCLOCK 91
+#define VMWARE_CMD_REPORTGUESTCRASH 102
/*
* Hypercall command mask:
* bits [6:0] command, range [0, 127]
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 8c8b6dd7c3e8..ead9f50cf89e 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -22,9 +22,12 @@
*/
#include <linux/dmi.h>
+#include <linux/atomic.h>
+#include <linux/crash_core.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/kmsg_dump.h>
+#include <linux/limits.h>
#include <linux/mm.h>
#include <linux/panic_notifier.h>
#include <linux/clocksource.h>
@@ -330,6 +333,65 @@ static int __init vmware_panic_log_init(void)
}
early_initcall(vmware_panic_log_init);
+static atomic_t vmware_crash_reported = ATOMIC_INIT(0);
+
+static void vmware_report_guest_crash(void)
+{
+ if (kexec_crash_loaded())
+ return;
+ if (atomic_xchg(&vmware_crash_reported, 1))
+ return;
+
+ vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0);
+}
+
+static void vmware_crash_report_dump(struct kmsg_dumper *dumper,
+ struct kmsg_dump_detail *detail)
+{
+ vmware_report_guest_crash();
+}
+
+static struct kmsg_dumper vmware_crash_report_dumper = {
+ .dump = vmware_crash_report_dump,
+ .max_reason = KMSG_DUMP_PANIC,
+};
+
+static int vmware_crash_report_notify(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ vmware_report_guest_crash();
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block vmware_crash_report_nb = {
+ .notifier_call = vmware_crash_report_notify,
+ .priority = INT_MIN,
+};
+
+static int __init vmware_crash_report_init(void)
+{
+ int ret;
+
+ if (!hypervisor_is_type(X86_HYPER_VMWARE))
+ return 0;
+
+ ret = kmsg_dump_register(&vmware_crash_report_dumper);
+ if (!ret)
+ return 0;
+ if (IS_ENABLED(CONFIG_PRINTK)) {
+ pr_err("failed to register crash report dumper: %d\n", ret);
+ return 0;
+ }
+
+ ret = atomic_notifier_chain_register(&panic_notifier_list,
+ &vmware_crash_report_nb);
+ if (ret)
+ pr_err("failed to register crash report notifier: %d\n", ret);
+
+ return 0;
+}
+late_initcall_sync(vmware_crash_report_init);
+
#ifdef CONFIG_PARAVIRT
static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
static bool vmw_sched_clock __initdata = true;
^ permalink raw reply related [flat|nested] 43+ messages in thread* Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-18 6:12 ` sashiko-bot
-1 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:12 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Michael S. Tsirkin, Kees Cook, Dave Hansen, Stephen Brennan,
Bo Gan, H. Peter Anvin, Jonathan Corbet, Brennan Lamoreaux, x86,
Joel Granados, Alexey Makhalov, Eugenio Perez, Ingo Molnar,
bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan, John Ogness,
virtualization, Steven Rostedt, Maaz Mombasawala, Borislav Petkov,
Shuah Khan, Michael Kelley, Randy Dunlap, kexec, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner
> VMware accepts a structured guest-crash event, but a host configured with
> backdoor.coredumpOnCrash may terminate the VM before the hypercall
> returns. Keep this event separate from the log sender, which runs
> earlier in panic.
>
> Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
> dumpers registered by then. Skip the event while a crash kernel is loaded
> so the host cannot terminate the guest before kdump saves its vmcore.
>
> Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
> panic notifier. An unexpected dumper registration failure with printk
> enabled leaves reporting disabled rather than overtaking working dumpers.
>
> Link: https://lore.kernel.org/r/20260309235250.2611115-4-alexey.makhalov@broadcom.com
> Co-developed-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
> Signed-off-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
> Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=4
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
@ 2026-11-18 6:12 ` sashiko-bot
0 siblings, 0 replies; 43+ messages in thread
From: sashiko-bot @ 2026-11-18 6:12 UTC (permalink / raw)
To: Zack Rusin, Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young
Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
virtualization, bcm-kernel-feedback-list, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan, Michael S. Tsirkin,
Eugenio Perez
> VMware accepts a structured guest-crash event, but a host configured with
> backdoor.coredumpOnCrash may terminate the VM before the hypercall
> returns. Keep this event separate from the log sender, which runs
> earlier in panic.
>
> Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
> dumpers registered by then. Skip the event while a crash kernel is loaded
> so the host cannot terminate the guest before kdump saves its vmcore.
>
> Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
> panic notifier. An unexpected dumper registration failure with printk
> enabled leaves reporting disabled rather than overtaking working dumpers.
>
> Link: https://lore.kernel.org/r/20260309235250.2611115-4-alexey.makhalov@broadcom.com
> Co-developed-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
> Signed-off-by: Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>
> Co-developed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794980455.git.zack.rusin@broadcom.com?part=4
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
2026-11-18 6:01 ` Zack Rusin
@ 2026-11-20 10:27 ` Petr Mladek
-1 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 10:27 UTC (permalink / raw)
To: Zack Rusin
Cc: Andrew Morton, Baoquan He, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Dave Young, Borislav Petkov, Ajay Kaher,
Alexey Makhalov, x86, Joel Granados, Thomas Gleixner, Ingo Molnar,
Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, linux-kernel, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, linux-doc, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan
Hi,
this patch looks a bit messy, But maybe, I just do not know enough
about VMvare.
On Wed 2026-11-18 01:01:51, Zack Rusin wrote:
> VMware accepts a structured guest-crash event, but a host configured with
> backdoor.coredumpOnCrash may terminate the VM before the hypercall
> returns. Keep this event separate from the log sender, which runs
> earlier in panic.
I am a bit lost here ;-)
What exactly means the "structured guest-crash event"?
Which hypercall are we talking about?
Is this primary about synchronization of vmware_panic_log_notify()
against termination of the crashing guest by the host?
Or is this about something else?
What exactly does vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)?
Does it _block_ or _trigger_ backdoor.coredumpOnCrash?
> Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
> dumpers registered by then.
Is this ordering important?
> Skip the event while a crash kernel is loaded
> so the host cannot terminate the guest before kdump saves its vmcore.
This suggests that vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)
actually triggers the external crash dump procedure made by the host.
> Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
> panic notifier. An unexpected dumper registration failure with printk
> enabled leaves reporting disabled rather than overtaking working dumpers.
This is another mystery. What do you want to achieve when
CONFIG_PRINTK is not defined, please?
Note that printk() is a NOP when CONFIG_PRINTK is not defined.
There is nothing to dump in this case.
Honestly, I would not complicate the code by this.
I doubt that anyone is using kernel without CONFIG_PRINTK.
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> +static int __init vmware_crash_report_init(void)
> +{
> + int ret;
> +
> + if (!hypervisor_is_type(X86_HYPER_VMWARE))
> + return 0;
> +
> + ret = kmsg_dump_register(&vmware_crash_report_dumper);
> + if (!ret)
> + return 0;
> + if (IS_ENABLED(CONFIG_PRINTK)) {
> + pr_err("failed to register crash report dumper: %d\n", ret);
> + return 0;
This is weird. As I said, printk() is a NOP when CONFIG_PRINTK
is not defined. So, you would achieve the same with:
ret = kmsg_dump_register(&vmware_crash_report_dumper);
if (ret)
pr_err("failed to register crash report dumper: %d\n", ret);
return 0;
But wait, this means that the code below is never reached.
Ah, I see, you wanted to run the code below when CONFIG_PRINTK
was disabled. It was far from obvious. And I do not understand
the motivation much.
Anyway, it won't work because kmsg_dump_register() returns -EINVAL
when CONFIG_PRINTK is not defined. err != 0 ...
Let's take a step back.
Why do you want to use kmsg_dump infrastructure for notifying
host about the crash, please?
The kmsg_dump API should be used to dump the printk messages.
But this just notifies the host about the crash. It looks like
an API misuse.
> + }
> +
> + ret = atomic_notifier_chain_register(&panic_notifier_list,
> + &vmware_crash_report_nb);
> + if (ret)
> + pr_err("failed to register crash report notifier: %d\n", ret);
> +
> + return 0;
IMHO, you either want to use the panic_notifier list.
Or you might even use the new panic_notifiers_platform_list
if you make sure that this is called as the last event
and you really want to stop the guest at this point.
My assumption is that the "host" will stop the "crashing guest"
when it gets notified about the crash.
> +}
> +late_initcall_sync(vmware_crash_report_init);
> +
> #ifdef CONFIG_PARAVIRT
> static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
> static bool vmw_sched_clock __initdata = true;
Best Regards,
Petr
PS: It looks to me like Sashiko AI completely failed here. It did not
mind if the commit message made sense. It did not see the big
picture. And it even missed that the code did not work with
CONFIG_PRINTK undefined.
^ permalink raw reply [flat|nested] 43+ messages in thread* Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
@ 2026-11-20 10:27 ` Petr Mladek
0 siblings, 0 replies; 43+ messages in thread
From: Petr Mladek @ 2026-11-20 10:27 UTC (permalink / raw)
To: Zack Rusin
Cc: linux-doc, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Pasha Tatashin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Ingo Molnar, bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan,
Baoquan He, John Ogness, virtualization, Steven Rostedt,
Maaz Mombasawala, Borislav Petkov, Shuah Khan, Michael Kelley,
Pratyush Yadav, Randy Dunlap, kexec, linux-kernel, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner, Andrew Morton, Mike Rapoport
Hi,
this patch looks a bit messy, But maybe, I just do not know enough
about VMvare.
On Wed 2026-11-18 01:01:51, Zack Rusin wrote:
> VMware accepts a structured guest-crash event, but a host configured with
> backdoor.coredumpOnCrash may terminate the VM before the hypercall
> returns. Keep this event separate from the log sender, which runs
> earlier in panic.
I am a bit lost here ;-)
What exactly means the "structured guest-crash event"?
Which hypercall are we talking about?
Is this primary about synchronization of vmware_panic_log_notify()
against termination of the crashing guest by the host?
Or is this about something else?
What exactly does vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)?
Does it _block_ or _trigger_ backdoor.coredumpOnCrash?
> Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
> dumpers registered by then.
Is this ordering important?
> Skip the event while a crash kernel is loaded
> so the host cannot terminate the guest before kdump saves its vmcore.
This suggests that vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)
actually triggers the external crash dump procedure made by the host.
> Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
> panic notifier. An unexpected dumper registration failure with printk
> enabled leaves reporting disabled rather than overtaking working dumpers.
This is another mystery. What do you want to achieve when
CONFIG_PRINTK is not defined, please?
Note that printk() is a NOP when CONFIG_PRINTK is not defined.
There is nothing to dump in this case.
Honestly, I would not complicate the code by this.
I doubt that anyone is using kernel without CONFIG_PRINTK.
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> +static int __init vmware_crash_report_init(void)
> +{
> + int ret;
> +
> + if (!hypervisor_is_type(X86_HYPER_VMWARE))
> + return 0;
> +
> + ret = kmsg_dump_register(&vmware_crash_report_dumper);
> + if (!ret)
> + return 0;
> + if (IS_ENABLED(CONFIG_PRINTK)) {
> + pr_err("failed to register crash report dumper: %d\n", ret);
> + return 0;
This is weird. As I said, printk() is a NOP when CONFIG_PRINTK
is not defined. So, you would achieve the same with:
ret = kmsg_dump_register(&vmware_crash_report_dumper);
if (ret)
pr_err("failed to register crash report dumper: %d\n", ret);
return 0;
But wait, this means that the code below is never reached.
Ah, I see, you wanted to run the code below when CONFIG_PRINTK
was disabled. It was far from obvious. And I do not understand
the motivation much.
Anyway, it won't work because kmsg_dump_register() returns -EINVAL
when CONFIG_PRINTK is not defined. err != 0 ...
Let's take a step back.
Why do you want to use kmsg_dump infrastructure for notifying
host about the crash, please?
The kmsg_dump API should be used to dump the printk messages.
But this just notifies the host about the crash. It looks like
an API misuse.
> + }
> +
> + ret = atomic_notifier_chain_register(&panic_notifier_list,
> + &vmware_crash_report_nb);
> + if (ret)
> + pr_err("failed to register crash report notifier: %d\n", ret);
> +
> + return 0;
IMHO, you either want to use the panic_notifier list.
Or you might even use the new panic_notifiers_platform_list
if you make sure that this is called as the last event
and you really want to stop the guest at this point.
My assumption is that the "host" will stop the "crashing guest"
when it gets notified about the crash.
> +}
> +late_initcall_sync(vmware_crash_report_init);
> +
> #ifdef CONFIG_PARAVIRT
> static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
> static bool vmw_sched_clock __initdata = true;
Best Regards,
Petr
PS: It looks to me like Sashiko AI completely failed here. It did not
mind if the commit message made sense. It did not see the big
picture. And it even missed that the code did not work with
CONFIG_PRINTK undefined.
^ permalink raw reply [flat|nested] 43+ messages in thread* Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
2026-11-20 10:27 ` Petr Mladek
@ 2026-11-20 16:50 ` Zack Rusin
-1 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-20 16:50 UTC (permalink / raw)
To: Petr Mladek
Cc: Andrew Morton, Baoquan He, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Dave Young, Borislav Petkov, Ajay Kaher,
Alexey Makhalov, x86, Joel Granados, Thomas Gleixner, Ingo Molnar,
Dave Hansen, H. Peter Anvin, virtualization,
bcm-kernel-feedback-list, linux-kernel, John Ogness,
Steven Rostedt, Sergey Senozhatsky, Kees Cook, Jonathan Corbet,
Bo Gan, Brennan Lamoreaux, kexec, linux-doc, Guilherme G. Piccoli,
Maaz Mombasawala, Shuah Khan, Randy Dunlap, Stephen Brennan,
Michael Kelley, Ian Forbes, Bradley Morgan
[-- Attachment #1: Type: text/plain, Size: 9294 bytes --]
On Fri, Nov 20, 2026 at 5:27 AM Petr Mladek <pmladek@suse.com> wrote:
>
> Hi,
>
> this patch looks a bit messy, But maybe, I just do not know enough
> about VMvare.
It's my fault for not explaining it better. I'm trying to find a
balance between being overly verbose and explaining only what's
necessary for review, while omitting details irrelevant outside of
VMware, and I'm failing.
> On Wed 2026-11-18 01:01:51, Zack Rusin wrote:
> > VMware accepts a structured guest-crash event, but a host configured with
> > backdoor.coredumpOnCrash may terminate the VM before the hypercall
> > returns. Keep this event separate from the log sender, which runs
> > earlier in panic.
>
> I am a bit lost here ;-)
>
> What exactly means the "structured guest-crash event"?
> Which hypercall are we talking about?
VMWARE_CMD_REPORTGUESTCRASH, the vmware_hypercall1() in
vmware_report_guest_crash(). It takes no arguments and carries no
data. It tells the host that the guest OS has crashed. The host
records that, and vSphere can raise a "Guest OS crashed" event for the
VM that management tools and alarms act on.
"Structured" was a poor way of saying "a crash state the host
understands". Patch 2, by contrast, only copies log text into the VM's
log file on the host. I can drop the word "structured".
> Is this primary about synchronization of vmware_panic_log_notify()
> against termination of the crashing guest by the host?
> Or is this about something else?
It's about ordering rather than synchronization. Patch 2 sends the log
from the platform list, before kdump, so it is done before the report
can happen. Patch 4 is about the other side: it skips the report when
a crash kernel is loaded, and otherwise tries to give the guest's own
log dumpers (pstore etc.) a chance to finish first.
> What exactly does vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)?
> Does it _block_ or _trigger_ backdoor.coredumpOnCrash?
It triggers it. Normally the call records the guest OS crash and
returns, and Linux continues its panic path. backdoor.coredumpOnCrash
is a debugging option in the VM's configuration, off by default. With
it enabled, the host attempts a dump of the guest and stops the VM
during the call, so the hypercall never returns.
So with that option set, anything panic() still has to do after the
report never happens. That always includes the kmsg dumpers that come
after the report, and, without the crash-kernel check, kdump too when
crash_kexec_post_notifiers is set. That is also why the report can't
share the platform list with the log sender.
> > Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
> > dumpers registered by then.
>
> Is this ordering important?
Yes. kmsg_dump_desc() calls the dumpers in registration order, since
kmsg_dump_register() appends with list_add_tail_rcu(). Registering
from late_initcall_sync() puts the report after the panic dumpers that
are already registered at that point, giving them a chance to save
their records before a coredumpOnCrash host stops the VM. Dumpers
registered later, by modules or late-probing drivers, end up behind
it. It only makes a difference with that option set.
> > Skip the event while a crash kernel is loaded
> > so the host cannot terminate the guest before kdump saves its vmcore.
>
> This suggests that vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)
> actually triggers the external crash dump procedure made by the host.
Yes, when the option is set. With crash_kexec_post_notifiers, kdump
runs after kmsg_dump_desc(), so the report would stop the VM before
the capture kernel started. A guest with a crash kernel loaded
therefore leaves the crash to kdump and does not report it.
> > Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
> > panic notifier. An unexpected dumper registration failure with printk
> > enabled leaves reporting disabled rather than overtaking working dumpers.
>
> This is another mystery. What do you want to achieve when
> CONFIG_PRINTK is not defined, please?
>
> Note that printk() is a NOP when CONFIG_PRINTK is not defined.
> There is nothing to dump in this case.
>
> Honestly, I would not complicate the code by this.
> I doubt that anyone is using kernel without CONFIG_PRINTK.
>
> > --- a/arch/x86/kernel/cpu/vmware.c
> > +++ b/arch/x86/kernel/cpu/vmware.c
> > +static int __init vmware_crash_report_init(void)
> > +{
> > + int ret;
> > +
> > + if (!hypervisor_is_type(X86_HYPER_VMWARE))
> > + return 0;
> > +
> > + ret = kmsg_dump_register(&vmware_crash_report_dumper);
> > + if (!ret)
> > + return 0;
> > + if (IS_ENABLED(CONFIG_PRINTK)) {
> > + pr_err("failed to register crash report dumper: %d\n", ret);
> > + return 0;
>
> This is weird. As I said, printk() is a NOP when CONFIG_PRINTK
> is not defined. So, you would achieve the same with:
>
> ret = kmsg_dump_register(&vmware_crash_report_dumper);
> if (ret)
> pr_err("failed to register crash report dumper: %d\n", ret);
> return 0;
>
> But wait, this means that the code below is never reached.
>
> Ah, I see, you wanted to run the code below when CONFIG_PRINTK
> was disabled. It was far from obvious. And I do not understand
> the motivation much.
>
> Anyway, it won't work because kmsg_dump_register() returns -EINVAL
> when CONFIG_PRINTK is not defined. err != 0 ...
That -EINVAL is what the fallback relies on. With CONFIG_PRINTK=n the
stub returns -EINVAL and IS_ENABLED(CONFIG_PRINTK) is false, so init
falls through and registers the INT_MIN panic notifier instead. The
pr_err() branch is only for a real registration failure with printk
enabled.
The motivation was that the report doesn't need the log, so a kernel
without printk could still report its crash. Now having said that, is
CONFIG_PRINTK=n actively used inside vmware? Not to my knowledge, I
did it for completness more than a very specific need so if you really
don't want it in, I can remove all the CONFIG_PRINTK=n handling, at
least until I have a specific need for it.
> Let's take a step back.
>
> Why do you want to use kmsg_dump infrastructure for notifying
> host about the crash, please?
>
> The kmsg_dump API should be used to dump the printk messages.
> But this just notifies the host about the crash. It looks like
> an API misuse.
The only reason is ordering. In vpanic() the platform list runs before
kdump, and panic_notifier_list, even at INT_MIN, runs before
kmsg_dump_desc(). Registering a late dumper is the only way to run
after the dumpers registered before it. I agree that a dumper which
never reads the log is a bit hacky :)
> > + }
> > +
> > + ret = atomic_notifier_chain_register(&panic_notifier_list,
> > + &vmware_crash_report_nb);
> > + if (ret)
> > + pr_err("failed to register crash report notifier: %d\n", ret);
> > +
> > + return 0;
>
> IMHO, you either want to use the panic_notifier list.
>
> Or you might even use the new panic_notifiers_platform_list
> if you make sure that this is called as the last event
> and you really want to stop the guest at this point.
I don't think that the platform can be last: by design it runs before
kdump, and it already holds the log sender from patch 2.
panic_notifier_list at INT_MIN would work, and it would cover
CONFIG_PRINTK=n without a special case. The cost applies only when
coredumpOnCrash is set and no crash kernel is loaded: the VM would
stop before panic_print's sys_info() output and before all of the kmsg
dumpers, pstore included. The host's dump would win over pstore. On a
default host the dumpers still run; the host just hears about the
crash a little earlier.
I'm fine with either. If you don't like this approach for v5 I can
switch to a panic_notifier_list entry at INT_MIN (still skipped while
a crash kernel is loaded), or keep the dumper and add a comment
explaining why it ignores the log. Which would you prefer?
> My assumption is that the "host" will stop the "crashing guest"
> when it gets notified about the crash.
Not by default. Normally the host records the crash and the call
returns, so the guest continues its panic path. It's stopped during
the call only when backdoor.coredumpOnCrash is enabled.
> PS: It looks to me like Sashiko AI completely failed here. It did not
> mind if the commit message made sense. It did not see the big
> picture. And it even missed that the code did not work with
> CONFIG_PRINTK undefined.
I don't know if sashiko reads commit messages, that one is on me. I'm
trying to get better at finding the right balance between oversharing
and not sharing enough and it's not easy.
The CONFIG_PRINTK=n case isn't a miss, though. As above, init falls
back to the panic notifier when kmsg_dump_register() returns -EINVAL,
so that path works. It's just a question of whether it's worth having:
for me it was easy enough to handle it but I wouldn't object to
dropping it if you find it too complex.
Thanks for the careful review!
z
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5414 bytes --]
^ permalink raw reply [flat|nested] 43+ messages in thread* Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
@ 2026-11-20 16:50 ` Zack Rusin
0 siblings, 0 replies; 43+ messages in thread
From: Zack Rusin @ 2026-11-20 16:50 UTC (permalink / raw)
To: Petr Mladek
Cc: linux-doc, Kees Cook, Dave Hansen, Dave Young, Stephen Brennan,
Bo Gan, H. Peter Anvin, Pasha Tatashin, Jonathan Corbet,
Brennan Lamoreaux, x86, Joel Granados, Alexey Makhalov,
Ingo Molnar, bcm-kernel-feedback-list, Ajay Kaher, Bradley Morgan,
Baoquan He, John Ogness, virtualization, Steven Rostedt,
Maaz Mombasawala, Borislav Petkov, Shuah Khan, Michael Kelley,
Pratyush Yadav, Randy Dunlap, kexec, linux-kernel, Ian Forbes,
Sergey Senozhatsky, Thomas Gleixner, Andrew Morton, Mike Rapoport
[-- Attachment #1: Type: text/plain, Size: 9294 bytes --]
On Fri, Nov 20, 2026 at 5:27 AM Petr Mladek <pmladek@suse.com> wrote:
>
> Hi,
>
> this patch looks a bit messy, But maybe, I just do not know enough
> about VMvare.
It's my fault for not explaining it better. I'm trying to find a
balance between being overly verbose and explaining only what's
necessary for review, while omitting details irrelevant outside of
VMware, and I'm failing.
> On Wed 2026-11-18 01:01:51, Zack Rusin wrote:
> > VMware accepts a structured guest-crash event, but a host configured with
> > backdoor.coredumpOnCrash may terminate the VM before the hypercall
> > returns. Keep this event separate from the log sender, which runs
> > earlier in panic.
>
> I am a bit lost here ;-)
>
> What exactly means the "structured guest-crash event"?
> Which hypercall are we talking about?
VMWARE_CMD_REPORTGUESTCRASH, the vmware_hypercall1() in
vmware_report_guest_crash(). It takes no arguments and carries no
data. It tells the host that the guest OS has crashed. The host
records that, and vSphere can raise a "Guest OS crashed" event for the
VM that management tools and alarms act on.
"Structured" was a poor way of saying "a crash state the host
understands". Patch 2, by contrast, only copies log text into the VM's
log file on the host. I can drop the word "structured".
> Is this primary about synchronization of vmware_panic_log_notify()
> against termination of the crashing guest by the host?
> Or is this about something else?
It's about ordering rather than synchronization. Patch 2 sends the log
from the platform list, before kdump, so it is done before the report
can happen. Patch 4 is about the other side: it skips the report when
a crash kernel is loaded, and otherwise tries to give the guest's own
log dumpers (pstore etc.) a chance to finish first.
> What exactly does vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)?
> Does it _block_ or _trigger_ backdoor.coredumpOnCrash?
It triggers it. Normally the call records the guest OS crash and
returns, and Linux continues its panic path. backdoor.coredumpOnCrash
is a debugging option in the VM's configuration, off by default. With
it enabled, the host attempts a dump of the guest and stops the VM
during the call, so the hypercall never returns.
So with that option set, anything panic() still has to do after the
report never happens. That always includes the kmsg dumpers that come
after the report, and, without the crash-kernel check, kdump too when
crash_kexec_post_notifiers is set. That is also why the report can't
share the platform list with the log sender.
> > Register a panic-only kmsg dumper with late_initcall_sync(), after built-in
> > dumpers registered by then.
>
> Is this ordering important?
Yes. kmsg_dump_desc() calls the dumpers in registration order, since
kmsg_dump_register() appends with list_add_tail_rcu(). Registering
from late_initcall_sync() puts the report after the panic dumpers that
are already registered at that point, giving them a chance to save
their records before a coredumpOnCrash host stops the VM. Dumpers
registered later, by modules or late-probing drivers, end up behind
it. It only makes a difference with that option set.
> > Skip the event while a crash kernel is loaded
> > so the host cannot terminate the guest before kdump saves its vmcore.
>
> This suggests that vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0)
> actually triggers the external crash dump procedure made by the host.
Yes, when the option is set. With crash_kexec_post_notifiers, kdump
runs after kmsg_dump_desc(), so the report would stop the VM before
the capture kernel started. A guest with a crash kernel loaded
therefore leaves the crash to kdump and does not report it.
> > Issue the event at most once. With CONFIG_PRINTK=n, use a late INT_MIN
> > panic notifier. An unexpected dumper registration failure with printk
> > enabled leaves reporting disabled rather than overtaking working dumpers.
>
> This is another mystery. What do you want to achieve when
> CONFIG_PRINTK is not defined, please?
>
> Note that printk() is a NOP when CONFIG_PRINTK is not defined.
> There is nothing to dump in this case.
>
> Honestly, I would not complicate the code by this.
> I doubt that anyone is using kernel without CONFIG_PRINTK.
>
> > --- a/arch/x86/kernel/cpu/vmware.c
> > +++ b/arch/x86/kernel/cpu/vmware.c
> > +static int __init vmware_crash_report_init(void)
> > +{
> > + int ret;
> > +
> > + if (!hypervisor_is_type(X86_HYPER_VMWARE))
> > + return 0;
> > +
> > + ret = kmsg_dump_register(&vmware_crash_report_dumper);
> > + if (!ret)
> > + return 0;
> > + if (IS_ENABLED(CONFIG_PRINTK)) {
> > + pr_err("failed to register crash report dumper: %d\n", ret);
> > + return 0;
>
> This is weird. As I said, printk() is a NOP when CONFIG_PRINTK
> is not defined. So, you would achieve the same with:
>
> ret = kmsg_dump_register(&vmware_crash_report_dumper);
> if (ret)
> pr_err("failed to register crash report dumper: %d\n", ret);
> return 0;
>
> But wait, this means that the code below is never reached.
>
> Ah, I see, you wanted to run the code below when CONFIG_PRINTK
> was disabled. It was far from obvious. And I do not understand
> the motivation much.
>
> Anyway, it won't work because kmsg_dump_register() returns -EINVAL
> when CONFIG_PRINTK is not defined. err != 0 ...
That -EINVAL is what the fallback relies on. With CONFIG_PRINTK=n the
stub returns -EINVAL and IS_ENABLED(CONFIG_PRINTK) is false, so init
falls through and registers the INT_MIN panic notifier instead. The
pr_err() branch is only for a real registration failure with printk
enabled.
The motivation was that the report doesn't need the log, so a kernel
without printk could still report its crash. Now having said that, is
CONFIG_PRINTK=n actively used inside vmware? Not to my knowledge, I
did it for completness more than a very specific need so if you really
don't want it in, I can remove all the CONFIG_PRINTK=n handling, at
least until I have a specific need for it.
> Let's take a step back.
>
> Why do you want to use kmsg_dump infrastructure for notifying
> host about the crash, please?
>
> The kmsg_dump API should be used to dump the printk messages.
> But this just notifies the host about the crash. It looks like
> an API misuse.
The only reason is ordering. In vpanic() the platform list runs before
kdump, and panic_notifier_list, even at INT_MIN, runs before
kmsg_dump_desc(). Registering a late dumper is the only way to run
after the dumpers registered before it. I agree that a dumper which
never reads the log is a bit hacky :)
> > + }
> > +
> > + ret = atomic_notifier_chain_register(&panic_notifier_list,
> > + &vmware_crash_report_nb);
> > + if (ret)
> > + pr_err("failed to register crash report notifier: %d\n", ret);
> > +
> > + return 0;
>
> IMHO, you either want to use the panic_notifier list.
>
> Or you might even use the new panic_notifiers_platform_list
> if you make sure that this is called as the last event
> and you really want to stop the guest at this point.
I don't think that the platform can be last: by design it runs before
kdump, and it already holds the log sender from patch 2.
panic_notifier_list at INT_MIN would work, and it would cover
CONFIG_PRINTK=n without a special case. The cost applies only when
coredumpOnCrash is set and no crash kernel is loaded: the VM would
stop before panic_print's sys_info() output and before all of the kmsg
dumpers, pstore included. The host's dump would win over pstore. On a
default host the dumpers still run; the host just hears about the
crash a little earlier.
I'm fine with either. If you don't like this approach for v5 I can
switch to a panic_notifier_list entry at INT_MIN (still skipped while
a crash kernel is loaded), or keep the dumper and add a comment
explaining why it ignores the log. Which would you prefer?
> My assumption is that the "host" will stop the "crashing guest"
> when it gets notified about the crash.
Not by default. Normally the host records the crash and the call
returns, so the guest continues its panic path. It's stopped during
the call only when backdoor.coredumpOnCrash is enabled.
> PS: It looks to me like Sashiko AI completely failed here. It did not
> mind if the commit message made sense. It did not see the big
> picture. And it even missed that the code did not work with
> CONFIG_PRINTK undefined.
I don't know if sashiko reads commit messages, that one is on me. I'm
trying to get better at finding the right balance between oversharing
and not sharing enough and it's not easy.
The CONFIG_PRINTK=n case isn't a miss, though. As above, init falls
back to the panic notifier when kmsg_dump_register() returns -EINVAL,
so that path works. It's just a question of whether it's worth having:
for me it was easy enough to handle it but I wouldn't object to
dropping it if you find it too complex.
Thanks for the careful review!
z
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5414 bytes --]
^ permalink raw reply [flat|nested] 43+ messages in thread