Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1312060rwl; Thu, 5 Jan 2023 11:38:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXvtaaiti1VT3RypDY/AD+gF7U6PK09RFlQ0KhG5kTSmqbr+0Kt8HoHPSYZ0vn3Wy8acKTkG X-Received: by 2002:aa7:d855:0:b0:483:2ade:2414 with SMTP id f21-20020aa7d855000000b004832ade2414mr38349736eds.16.1672947526824; Thu, 05 Jan 2023 11:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672947526; cv=none; d=google.com; s=arc-20160816; b=HHi83l+idiFzC5jZ+M7OoIc6Bms2N4DYI3MEEwn1RmFbxXmUnSehmpstf9bQWfEv0b y9k3ogt+O10HxK3CUs4ZHK8ufPuWFslWI+E21dMOUUYeWk0Kve9XWyjsDc45TJCMXmcW sa5Ws1j2/BJQZtA6PY+iSeeT5MK6U0zEsiEmQe0E66CXbDjbowE0+0vIfbLuh6+oUTOb audK6q3PLjhzFNSTJzhM0cfxeDNtxiwgtDUgTrAoTaZ6V6jHbllBq2t0LTJHFv71Wi47 ORdUpdwTDAzlgbDj4FollY14IvfNV8ybpaljHxQnanIG/VnO/Ust//2PIW+d+VmTHaiE cmDw== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=hFJj6yGSnKoi5qVdls4YuojGSI1hXMWXp+Zj3Ha8Akk=; b=dIgBCAhQxRBCKHhcaCayk0eAxFxM55VxtgZBofuJTyvuC1TrAx/ut05ox7B2vKDPn/ oMZlNQUiyn2SaJthdxpzyIGn2gSfjW+VOeHAPObiDSP9xC++6OdOHgfawRGw2t74UNbX arcZWtHgvtAlBDBpec2ADwgfm9H8qzrYqYHDvFoYJxhqbtaP5P/sgnjGDobgC/xa6aSI GCL6+Ctn2EqKYyr3kA2UwP8BrA55AQjSo74KRrEeOIlmXrhFF9GhFpi9/hmQiz8M/7d+ WtqiemCZFN83eRXEeZ9kLzMPptTbJ9E7C4ORYr3Jm6uhhKorIgffSGVknNF1eygr1Fnq MKhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZHpiPx1j; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a056402274e00b00486c1b099d5si30347908edd.3.2023.01.05.11.38.33; Thu, 05 Jan 2023 11:38:46 -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=@kernel.org header.s=k20201202 header.b=ZHpiPx1j; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235572AbjAETa0 (ORCPT + 55 others); Thu, 5 Jan 2023 14:30:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235545AbjAETaE (ORCPT ); Thu, 5 Jan 2023 14:30:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CC4963F75 for ; Thu, 5 Jan 2023 11:24:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE51261BCD for ; Thu, 5 Jan 2023 19:24:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14384C433D2; Thu, 5 Jan 2023 19:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672946671; bh=8sug4N+XOkt7hHrOlUu1is4NYUzllmpcO7ETWOyO+08=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=ZHpiPx1jjkVospHkCnRuOjvxSzaRhOs8AsSyrnSF/m6CGFWiOAqzY0aIi67QWs7mS 6vNh/o/mS8aOW3nJflDyCJDk/nwh4hvOgf27yrLmv1n5XkHYVlPj2JrNXL4YY17BsF 93KeZwIEjxsud0GFzt3jPTMcgt9bD8vg+65B5bEtLkk/WLPyy2TiPnGUlTLq3syR6/ hXOATAdq+bZvWgb8VFyzorqCD0HtNDEOfAMnoE/GxtwARX6i8BltCIE0eYmhwV6lb2 X5M/NX3rcH41bSXGrKMiwk7AviUwNMxcurTI88A9wvEHrfaxS49xmzbz2NqCiHWqHr ofErHzdteW6cw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A14E85C0544; Thu, 5 Jan 2023 11:24:30 -0800 (PST) Date: Thu, 5 Jan 2023 11:24:30 -0800 From: "Paul E. McKenney" To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , x86@kernel.org Subject: Re: [PATCH x86/nmi 2/2] x86/nmi: Print reasons why backtrace NMIs are ignored Message-ID: <20230105192430.GJ4028633@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20230105011537.1774941-1-paulmck@kernel.org> <20230105011537.1774941-2-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Thu, Jan 05, 2023 at 11:40:30AM +0100, Ingo Molnar wrote: > > * Paul E. McKenney wrote: > > > +#ifdef CONFIG_NMI_CHECK_CPU > > + > > +static char *nmi_check_stall_msg[] = { > > +/* */ > > +/* +--------- nsp->idt_seq_snap & 0x1: CPU is in NMI handler. */ > > +/* | +------ cpu_is_offline(cpu) */ > > +/* | | +--- nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls): */ > > +/* | | | NMI handler has been invoked. */ > > +/* | | | */ > > +/* V V V */ > > +/* 0 0 0 */ "NMIs are not reaching exc_nmi handler", > > +/* 0 0 1 */ "exc_nmi handler is ignoring NMIs", > > +/* 0 1 0 */ "CPU is offline and NMIs are not reaching exc_nmi handler", > > +/* 0 1 1 */ "CPU is offline and exc_nmi handler is legitimately ignoring NMIs", > > +/* 1 0 0 */ "CPU is in exc_nmi handler and no further NMIs are reaching handler", > > +/* 1 0 1 */ "CPU is in exc_nmi handler which is legitimately ignoring NMIs", > > +/* 1 1 0 */ "CPU is offline in exc_nmi handler and no further NMIs are reaching exc_nmi handler", > > +/* 1 1 1 */ "CPU is offline in exc_nmi handler which is legitimately ignoring NMIs", > > That kind of disambiguation of why a CPU is stuck looks really useful: > > Reviewed-by: Ingo Molnar Glad you like it and thank you! I will apply this on the next rebase. > One small suggestion would be to do this in the messages: > > s/exc_nmi handler > /exc_nmi() handler > > ... to make it clear that it's a regular kernel function [well, hw entry > handler], not a function pointer or some other indirection? No strong > feelings though. Will do! I would balk at "DEFINE_IDTENTRY_RAW(exc_nmi)", though. ;-) Thanx, Paul