From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795170453; b=txDhDcBJjE19M0rMYAc0HE4PU+AYMMUNYgVkchKwGUgtpRmZVLcVfqusuSIMO8eyzK/H 03kiCOm8QQn8y1/e6ErDoQUDubFBc4rKMV+v4DDTc1wAxjvmThl8cKmEzU/cH9Axjlw+D ZzEFDilfROfWuowxgYs8o+sk7vysTbxiWPSFcmMvDl0mi1DttOC9v86utVg+kUAQFSvmq 4W0SK2tkgmoxuoh0iHpIcAX8GJEh9eeZq1PMKokrnimJkHA/jcld7+YPbYxQ6WeTGgAp1 Wf5VLvAoA0/yBvavblsTsiPAKyDvEqUD7lW5C9wgi+YvPkTJ6drnFbs3HWCBlcvxHlg== 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=5bf1zVG9ZPxXbXgBbJIy63H66+aH7imNvUmZL9aTIKWPzLWnsZa9J/plg2BlNE0iD4nR 33bvvGf8hkOvIBvVzrVqvwFy2Ta9sze4RBhxIsPTu8dIcH1B8ppA43pszY+No3ccPPbwZ i2pPm3/CQ3LKySMVEpohf8JiXjZ1tsXcD0/MIuZz1DhkSRAjD64AV05c1Eq8jZUOD3Z+B nWify6e925JpdBanK4ghNax9QdCnWAdjf2HRKrw64sTc7faueUiTYI/VEz2TtvN+b60jb Gdhb5TypQ9mZ3CRy/qWr4KEF1CScjbn0eb+tFRRvQ2H9UsXG4nmOQ4jyv+E2HUCIYvg== 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.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 2178F606A326 for ; Fri, 20 Nov 2026 10:27:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2178F606A326 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-f51.google.com with SMTP id 5b1f17b1804b1-4bb5b8ef642so6242025e9.1 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=kQ0Z9/xxi+qcT5iBYTymDX8BwurUD3hzPtC7s5e8nv4iwosVlPK3Fg0t51dyjW63X6 4zmBafb3/MMgXoMuy23WqMxndjfEgGx6a/OmplcDn4oYP88++m86LW+SjBrdd0r6zO87 bIh0KF2yE6DXzHYqS3KeyuHH070Wtehn0/0o7yTCzuJmGgnOX86+/jAkyn3XX0gZGjur wmvtdlZRb+k8C/qQJjJvporFUmrdn4adY0A4rLCMYXyuq5CuoJ8IXBGTqwGmYyTxIubo a0rBu/NC79f489ZzM7E7c9Rox1Q8zjgP87eE6ndWFoHgacIEOy4/xs/TVBEIpjFOHig5 S1Yw== X-Forwarded-Encrypted: i=1; AL+hErGM9jixqh8cUjAEA1zEFFzNnWdIcSrWmoHKRhbRk+BSYB6rb9DbE4C2z1SF5LzCYjX2OmI85eMb3Kc=@vger.kernel.org X-Gm-Message-State: APuU4Z8BRdRBAb210/yIg5oAk8Xj81e7+tXqjUZq2rzkjsh5/1DfIm77 I0kwSQEyd3e5CBlAlkfRVJHmydHiijR7GD3YXsVcH+Nn77Dc7pLk4QdsX/g8Xo8pZZ8= X-Gm-Gg: AYBFou1+/75IBgwH2rJWwXoQ7UI9K2i4Rx8QOIViHeTjX+bmpyMWV9a6Jx5dd1G5iZW YBRM1ZJD95pQLLI6FkRSNsEYh3UnyaTKeIQbCnsXVefapBwn9wf1KnYtg39yeD49LemCAuIIvrC OskoKbGl7duPUkB+z65jpBcgm2Synf0zv1ACouG5SiA81xXhNgf94i191lFO1ih1OHKMU6n6GZi O39r7+eBir6ovpm2CZ35w8xpNJ4GXlPS2DVZTOYIP5unEjOG1g3WnKg9aaMLym9xAV0mlEXt/DG 6p5Rpyl7Q20AQuXIMFnQZ938AzG0Oc+aZ6zBF9amZ6opnSDr1Fk5bX1SX6hbCgD5T61AItdv+4Z rw40FRcUuUZB3a2jGRtosWE163oE7muzry2qDeTgGOn8YlTjthl1Wt4PDk8H/WDa8Yz7UVsuUiA 8NajRVTejE7tezhkE3khnT5wmZSeI8W8u/xpENXwi6ZxC6ANc4D3UzY7u1x3jSuC59VbvwjYU5g AfNGsIFfgBJCuNqSVFjYSs2ygSFgk49vK7IT5fZHnXt093aT/nx6M+lT9OTz8Ds0oMVITITIJHC f4FabNruQt/FF/SHeoY3 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-doc@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. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F1F4606A32A for ; Fri, 20 Nov 2026 10:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pVpi8KDA; dkim=fail reason="signature verification failed" (2048-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=C5vKx0Ow DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=J03hAPreVl/WdlY67XpnWOO6QMbJJDuPrc/TmqPAXow=; b=pVpi8KDATMz7tfalbSFWxmvnOE eF/sR1kRvnKcfQZZZGo3b0jY7FsZcZTlMC1pfYWRx6ie9yIb5D1N2admmQ5WQhnitEG88fG7pvJ7d hkxeATfx7QtDRObqE2EUpD/2cjInrjFKVllfHUMqfs6VwxTDmo+tkDdBh/L+x7jGuB0lk2AcLYI7p adS6rCpAk+p1gL0UDtTAgOJklA/uP+S3VVsN/YesVPTQ5RTGjeCHO5TRvDpgBKPMf21yVrzGGJAMe K1v9Gzje5Hc/yfkJ//ZvX/kAPT7/hyskjBkydc76KC3MDHPOpqVSDEvdedHLNmg0SbdsGG5839MML jSwhEsEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xULqC-0000000Eaz2-20K2; Fri, 20 Nov 2026 10:27:36 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xULq9-0000000EayK-16uC for kexec@lists.infradead.org; Fri, 20 Nov 2026 10:27:34 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4bb6057b333so2635045e9.3 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=lists.infradead.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=C5vKx0Ow03hqC0VXWnJ7EdpsA6NxDAgoQRvUskJd93iwZSNUMl3SMnymSEuRzNN2mZ sCqjgNYxMDJSy1Mgec5GLuOP6czu96NMAZFVdLo7GM24xlQ+2BZRflVYINdA1F29sMGW 9oYCxZIhz4X8cmzZUDUPz6AMpgvvgzsz9K5D2LjWm+OTguUcyo+dVi5DmlB8BdUgmSPy FW/D5oYXpzDFxDhwU0D3dFOBqnVaAEQIyrY49BeWTaUgjpE8/t80vOwRjScJ7UkVINU6 T3Ib3b1taFNrCvtDEAAexafw9jd/80+0MFh+hBF9lI1mu4mxBD0LLTdw5BBICArAcJs9 ZtVg== 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=sjBA59+GxyRbr70HNdYmfUjgVotQSvgaDxO653s70SENpioqkauac/JG5ItmWGpjAQ sAdAeTJBRNVOFI/HD1FJbz2nRPP1SMA0ai+fv02wNg1f5R1nYPRDkR9zgATvUhd/VksI MVdwT7bgGjdxvJWaq2U8Jv0Bjvv4uWJ+obw/0pIZTKth8uZ9zuNn5naXC62debGYxH3X xPjj7g1IFcLawXJtLWjZm1lvwzhTujDfbjOWpLPGhI1bsaiI2rNeFUJ92O1Uxshny46h yJ9t2dhM7crhstvlAUuwN8Qs1Ybm32aIn9qmceWr0azUs9/yhPNdXujJ1MAZLhzxqvVN gGEg== X-Forwarded-Encrypted: i=1; AL+hErFBcxcvIuKFQds+hDqfov8Rqe0jRsXg2Tr/OkZP7AF/K0PS5qGnsSBYkVqtikNn7dPkkJG4/g==@lists.infradead.org X-Gm-Message-State: APuU4Z+Yh7o6P12u1TUCth/2OfNYBQaYMepgk2lNca+oq9K5Y4orZo6e 6dB5hsHM9zh9tK3LmcCy7wtVkAY4OsuL/OZkhA0Un1z8pfOKa4PkSxtXg4Kk1DGRIuU= X-Gm-Gg: AYBFou20iuUGDLKaAQKeJSiNGNEQTIfkWurvTNJ2HWu3K2dpuiQjNTXD6WII8TNLFOt 5B7ruZndSmfKGAh2PmI0GUXIiL0H6FA2Bgn0xsJBbLHlgbrKYn3ayW4NF2fvNHJ4enInf5a6of0 okPPJNkAXXi4Q82Qd61FJv7ZbBzNm0kp7wTn/fa0pvexDYLqTz3BxjlL3fikn8G0S8oU88lzTrz 6cWoQX/Fy8jpWPyOa3bpiCqyPDzE2YmdiJ1yJhgNuGOlIlzvNxxHoUdsJ2NItarGYLOpWGS7lXs 0MTQXseViY/z1MhN/XAx42Z6SrIS8UD3VYvutBlaejl59tOvYplE2Q2jBMg30mevn5v6VxhHUKC 2M9eVMdShryBJu+54hKxmfASvbNTlGEQufxe9a+SpwdOmBzL/WFLXFvVARgeuP6CzUNL/YYDLI9 l5nRvPn0cAgKTiTUIeXTNF6wnsTECaq8h4NO9vj4gJzIvGiAiBd9uKtc6xVd+orebimDapt8O7q 4rRu3Bb5yCv0+WjsYUbCgK+PK9Xx8Y9435x9M5c5ARxDBruncvSY+Jwdhi9lygz4RIKJ81l7h+B hDwflIrs3KhWKOBPh0mu 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 Subject: Re: [PATCH v4 4/4] x86/vmware: Report guest crashes after kmsg dumpers Message-ID: References: X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261120_022733_335178_0DE9A6C6 X-CRM114-Status: GOOD ( 30.34 ) X-Spam-Score: -2.1 (--) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, Kees Cook , Dave Hansen , Dave Young , Stephen Brennan , Bo Gan , "H. Peter Anvin" , Pasha Tatashin , Jonathan Corbet , Brennan Lamoreaux , x86@kernel.org, Joel Granados , Alexey Makhalov , Ingo Molnar , bcm-kernel-feedback-list@broadcom.com, Ajay Kaher , Bradley Morgan , Baoquan He , John Ogness , virtualization@lists.linux.dev, Steven Rostedt , Maaz Mombasawala , Borislav Petkov , Shuah Khan , Michael Kelley , Pratyush Yadav , Randy Dunlap , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Ian Forbes , Sergey Senozhatsky , Thomas Gleixner , Andrew Morton , Mike Rapoport Sender: "kexec" X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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.