Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7777174rwl; Tue, 10 Jan 2023 05:23:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNIgDOnbjEip/oIpOnLfBEDOgGN9tMERfWL1EuFSZ+71YZnsorCkLTmeA3FZpZwBCv/1Ee X-Received: by 2002:aa7:d410:0:b0:499:d199:6614 with SMTP id z16-20020aa7d410000000b00499d1996614mr654619edq.36.1673357036722; Tue, 10 Jan 2023 05:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673357036; cv=none; d=google.com; s=arc-20160816; b=RAox218DfwN+XaR/eaAwMscajEmH738gTDrwsBlPgM/kJNU0GK5Ej7vEjQt7OP5l3g PQTECT/7XPv2uQIhi2320eQDTbzgIo9KcNqi2g0rIxeRnQBlUQusRg9R9jve2uHlvZM2 RjWuFOUMkwAPvv5hw1mJVG+NoTPEfSU2Wa0AK95HmZ9tykRup3DGpLVfdMpd7e/ASxc8 /HSsvV+nfyjzXOaq3keRs8TbPybvAZ/NJ4H7KMF1UPcXB1KOpkgrXDW2f+Hf/p9brkvF zBM4IxLghWTA81xHkr8pkfd4eNnZ7r24Q+jICRMURrOc7w8enOBog44AqyJajo1X+qhw yplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZfOt5HDc34dr/smZxobD5IUZu0DIYXCMGlcbHhVp6Uk=; b=KsPhAst/Fhf2Et2pi5IYqlnuL2jWRHKmPbcaSRvddtgbo3ktpsySx3qjZHzL6TsssT tsmaJ1428o97IyZW5gi31+gK6Kl6UKoBsSRZ+WoaIuWqNIwVnc5BUxPt7hdJfq+WSs+3 d+xgMIz6PozEgNsUy3UmQ4nzkZgpguhEpGmxROBZjVA5xY1br9gP85fZyMSGta8fXMLY MOiluqwSsGnls8mpFGJozX6mmII8tvMP0G4ZW/5zsMl2EraMWKTHhCD6cRhaqF7B9onM 3ThRiHv8cyLyH0P6SeJBUBodACfVaD6FJxk5heaGMGHzRTUZQYMuu29eR5yCxgRqRQT7 tl2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="K/ZZSGYc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fj5-20020a0564022b8500b004607378ae65si3862628edb.160.2023.01.10.05.23.43; Tue, 10 Jan 2023 05:23:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="K/ZZSGYc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbjAJMOT (ORCPT + 53 others); Tue, 10 Jan 2023 07:14:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238177AbjAJMN0 (ORCPT ); Tue, 10 Jan 2023 07:13:26 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A9F43A0 for ; Tue, 10 Jan 2023 04:11:35 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id F04B81EC04A9; Tue, 10 Jan 2023 13:11:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1673352694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=ZfOt5HDc34dr/smZxobD5IUZu0DIYXCMGlcbHhVp6Uk=; b=K/ZZSGYc3r17rRW2Q8WTFUmOhY/+8gSzNUfNuRa/IedMQDzOxInAxjMWGsC/6uP3VdVTpT PX29LZ3Qi8l3waD95SnfzK1gUmaUws2UlDoWSlzVTcMT+1S1iRh+UEmeUjUctTQD2+aqYo sU/mgVsBnjdEsR+nmj4NIk7/t7bef6g= Date: Tue, 10 Jan 2023 13:11:29 +0100 From: Borislav Petkov To: Ingo Molnar Cc: Zeng Heng , michael.roth@amd.com, hpa@zytor.com, tglx@linutronix.de, sathyanarayanan.kuppuswamy@linux.intel.com, kirill.shutemov@linux.intel.com, jroedel@suse.de, keescook@chromium.org, mingo@redhat.com, dave.hansen@linux.intel.com, brijesh.singh@amd.com, linux-kernel@vger.kernel.org, x86@kernel.org, liwei391@huawei.com Subject: Re: [PATCH -v2] x86/boot/compressed: Register dummy NMI handler in EFI boot loader, to avoid kdump crashes Message-ID: References: <20230110102745.2514694-1-zengheng4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2023 at 01:01:06PM +0100, Ingo Molnar wrote: > From: Zeng Heng > Date: Tue, 10 Jan 2023 18:27:45 +0800 > Subject: [PATCH] x86/boot/compressed: Register dummy NMI handler in EFI boot loader, to avoid kdump crashes > > If kdump is enabled, when using mce_inject to inject errors, EFI Why does "EFI" matter here? Any boot loader would do... > boot loader would decompress & load second kernel for saving the s/&/and/ > vmcore file. > > For normal errors that is fine. Useless sentence. > However, in the MCE case, the panic > CPU that firstly enters into mce_panic() is running within NMI > interrupt context, "#MC context" it is non-maskable but that's not "NMI interrupt context" > and the processor blocks delivery of subsequent > NMIs until the next execution of the IRET instruction. > > When the panic CPU takes long time in the panic processing route, I'm still unclear on the order of events here. It sounds like 1. MCE injected 2. panic 3. kdump gets loaded If that is the case, then I presume the flow is: mce_panic -> panic -> __crash_kexec() Yes? If so, then we should make sure we have *exited* #MC context before calling panic() and not have to add hacks like this one of adding an empty NMI handler. But I'm only speculating as it is hard to make sense of all this text. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette