From: Petr Mladek <pmladek@suse.com>
To: Zack Rusin <zack.rusin@broadcom.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <baoquan.he@linux.dev>,
Mike Rapoport <rppt@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
Dave Young <ruirui.yang@linux.dev>,
Borislav Petkov <bp@alien8.de>,
Ajay Kaher <ajay.kaher@broadcom.com>,
Alexey Makhalov <alexey.makhalov@broadcom.com>,
x86@kernel.org, Joel Granados <joel.granados@kernel.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
virtualization@lists.linux.dev,
bcm-kernel-feedback-list@broadcom.com,
linux-kernel@vger.kernel.org,
John Ogness <john.ogness@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Kees Cook <kees@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Bo Gan <bo.gan@broadcom.com>,
Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>,
kexec@lists.infradead.org, linux-doc@vger.kernel.org,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
Maaz Mombasawala <maaz.mombasawala@broadcom.com>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Stephen Brennan <stephen.s.brennan@oracle.com>,
Michael Kelley <mhklinux@outlook.com>,
Ian Forbes <ian.forbes@broadcom.com>,
Bradley Morgan <brads@mainlining.org>
Subject: Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers
Date: Fri, 20 Nov 2026 11:27:28 +0100 [thread overview]
Message-ID: <awAgkNoIKpFx764w@pathway> (raw)
In-Reply-To: <d0f9c1188b5f78bb20bb43737b3cf80c5c0f94f4.1794980455.git.zack.rusin@broadcom.com>
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.
prev parent reply other threads:[~2026-11-20 10:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 6:01 [PATCH v4 0/4] panic, x86/vmware: Preserve crash logs before kdump Zack Rusin
2026-11-18 6:01 ` [PATCH v4 1/4] panic: Add a platform panic notifier list Zack Rusin
2026-11-20 8:36 ` Petr Mladek
2026-11-18 6:01 ` [PATCH v4 2/4] x86/vmware: Add a bounded panic log sender Zack Rusin
2026-11-20 9:10 ` Petr Mladek
2026-11-18 6:01 ` [PATCH v4 3/4] x86/vmware: Add the vmware_record_panic_msg sysctl Zack Rusin
2026-11-20 9:19 ` Petr Mladek
2026-11-18 6:01 ` [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers Zack Rusin
2026-11-20 10:27 ` Petr Mladek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awAgkNoIKpFx764w@pathway \
--to=pmladek@suse.com \
--cc=ajay.kaher@broadcom.com \
--cc=akpm@linux-foundation.org \
--cc=alexey.makhalov@broadcom.com \
--cc=baoquan.he@linux.dev \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bo.gan@broadcom.com \
--cc=bp@alien8.de \
--cc=brads@mainlining.org \
--cc=brennan.lamoreaux@broadcom.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=gpiccoli@igalia.com \
--cc=hpa@zytor.com \
--cc=ian.forbes@broadcom.com \
--cc=joel.granados@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=kees@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maaz.mombasawala@broadcom.com \
--cc=mhklinux@outlook.com \
--cc=mingo@redhat.com \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
--cc=senozhatsky@chromium.org \
--cc=skhan@linuxfoundation.org \
--cc=stephen.s.brennan@oracle.com \
--cc=tglx@kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=x86@kernel.org \
--cc=zack.rusin@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox