From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795170453; b=M1gHExxr8HDYIc2Wb9YCCEgPYkyVnlDw9B5l58x4D8H5+LV9BT4j6V5HJOi9ixKDYk40 1K6zMbZaZu6liUfs/JcVuFvtpRU0WswpJcOhx81Qn8rc2PrO4F55i1QApmOv6Uckr62EU yc8Lv5tuUr8yZ1iCpzeANeAoptWNk8pwdR0/1HvqKwH30I2vae8A2NlgDU+eC6yNLtbVM f75FeFVupkbGpTOIwqCQRpPwE7IAb+Yjfhsd1/AVR1b5JGLiD8BLWai9OBxeKIfpm1jjn zz0d/8YTMGKKtL6wd5j0JfgGb9Uw4prygQm42ncKRuK8uQ/j4RolRXkZc1BYWyE50Vg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795170453; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=J03hAPreVl/WdlY67XpnWOO6QMbJJDuPrc/TmqPAXow=; b=2Tfs2bsecsWXOvgS9jA4XTKJOLF1xYQZ43B7v5p7a80e8JZqPCXb0g2Qxg1kMgC8O4yG HNng0o58mGuwO7TTavzuOIDHNxwnAy+t8tsUDwUUryHyh50zOoYoRylTPrYclcATUP+D0 D23YqB+HKK123sJ3PDHXCMVYWHtFp5/5/0n/wrXV2pcFvI/iUBrwyoMB8/gQc1VjGe3yh gLmS7zDpt5zP9gut+CjYtA0dICF9HRwfFKLtb5pjTUsoIOi8mqwEyB1YPSBvLdmIwvbI/ E4GnnIP5znplx9AWR4RbGdl295fiBjKgBRLFkAFDpYGkIuJEkCacV6NBlWuRMIH7oAQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=RQSSrIcH; arc=none smtp.remote-ip=209.85.128.52 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D288606A320 for ; Fri, 20 Nov 2026 10:27:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0D288606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=RQSSrIcH Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4ac95761c85so5103755e9.2 for ; Fri, 20 Nov 2026 02:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1795170451; x=1795775251; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=J03hAPreVl/WdlY67XpnWOO6QMbJJDuPrc/TmqPAXow=; b=RQSSrIcHe3nsThu/qsuyCLRVp6kBKamHvjbg0Wu/b4lbX6CZewJC366PZCYxE40TAB 6Iy4qlHNGqxtgMz+Y67CO7Pe+PkXP5BwzddMfG0OwvrThdC2iJc1KjRK2nov4QSoIR0v YNTEOAIJw81hO88t0rMWbJvNSD2anaMtRYHdCd9dqK6nP4EeSnyQQdvoQnjbteaZRXyM 4K0TXZt/kJlXBxW6515aaPUhXn3SJcvjfaNqdCyBhRnpjMMsBVY0B+WkU5pR6m16HLAa GCewYpObVjoq4lgFJaezb25HUXFm0ujZzRYFYEJ/NjQc3D7bwhwqDPz4Auj0T3IyBaSe VeNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795170451; x=1795775251; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=J03hAPreVl/WdlY67XpnWOO6QMbJJDuPrc/TmqPAXow=; b=G+yhHj9MAMa2biq7gURgq4+ApTn9ebsDzCANSlffb8UbmK/NqvnxTPDdYz+gMKnRnj XBsbqi1tyMH3cxalN2wQ1ExAkifciG8VFxHSWuo5gVOj7cT3hYCmtPeUiIqIvUww9Fd9 koXNg2GS/ltyvDTBCx6cZ1olCu7tNJajSwf7LlYxma7fSxl9294sAPIEdD9V5waMNnQk qUKTMtPJ/19egQcGV+HQi6xBT4oB5Ab6BNFczYLZjFNnue03ItDbno/zRxInhlpwaW3E lnHjzskVLzrWylE5t1lGS7iCJRRBqSGHFqrGouunLzVy6MTTyhj3Z2jL7UBPoOYmXIzb 1Xmw== X-Forwarded-Encrypted: i=1; AL+hErGoYjcbQrok23M7nyQemmP7TZQp3dPgFvKS4uYVteJlZlcIOTgqtYejoFYGZ2vU82R8o89BR9pDVAmnlO0=@vger.kernel.org X-Gm-Message-State: APuU4Z8vyC4t9LfeItwvZX0BrveGBxrgJ4wPEkhC9+ZkNrhHZZrFYD/c 3UGm+ae6phgRWJMZf0rmvySMSc1asxWFG8pN3fEixF0jF7D9jCla9VHC8Ew3TDR7t8k= X-Gm-Gg: AYBFou3RdzRdi2ERViMp87tGwonE9CYWXV6dtcBETFp+FTKDuuj2SFdNRw/OqluuoGa jvIjT+oQP98pKJvoSyNlJdzDvy0ODIL9bkD4sVgbeQXoR2QTZOolEDvVHnOutVuGVXb1dcasXmV 2/dtRwFtK2BtAmfv+dvpmiSUmEmRe1GSLTe6dIszrUZapBwBXyAslDauOBlEKnnSespz5doH5TZ Ai1xZ0MPFpnaDVGgZ0MEdlAhDg3Nw2s6VKi5E1rUjFuAkNKlDTZFK54EBnyoS587bkT7xH+X41a joTjoERCNGqq10e1McwoIZhXCnH0VO6lNO+9q/FJdaUdaYekoanE8RCu2RBC8s4xTXdj2RS5Rsq UJW4HYFI9WErruo5XaBbqcdWo6OLMOOhC/aswhhrAnuTuYtN2o2Y1tY9AiVIWPbKkEzlXUcaeya b8BAkJ6PIgmGgXAMZtN7mSCNv+S9RfQ8GFqDYxaZl6lth5bBMRq/EJqgP8NnP7xwaIOVoFrjckN GO0NdScPrhLg4OBuZ4sOIA8HR1hq8xJyOubCQS5iMct6aGP5vaZLxtvvpUNrHQfB669IlqNswTO /YQmn7hAjgcuraT8u7vO X-Received: by 2002:a05:600c:4ecd:b0:4a3:12fb:1ef1 with SMTP id 5b1f17b1804b1-4bb8881e81cmr57015215e9.29.1795170451305; Fri, 20 Nov 2026 02:27:31 -0800 (PST) Received: from pathway ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853ca452sm108779875e9.15.2026.11.20.02.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2026 02:27:30 -0800 (PST) Date: Fri, 20 Nov 2026 11:27:28 +0100 From: Petr Mladek To: Zack Rusin Cc: Andrew Morton , Baoquan He , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Dave Young , Borislav Petkov , Ajay Kaher , Alexey Makhalov , x86@kernel.org, Joel Granados , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , virtualization@lists.linux.dev, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, John Ogness , Steven Rostedt , Sergey Senozhatsky , Kees Cook , Jonathan Corbet , Bo Gan , Brennan Lamoreaux , kexec@lists.infradead.org, linux-doc@vger.kernel.org, "Guilherme G. Piccoli" , Maaz Mombasawala , Shuah Khan , Randy Dunlap , Stephen Brennan , Michael Kelley , Ian Forbes , Bradley Morgan Subject: Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers Message-ID: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.