Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp667629rwl; Thu, 5 Jan 2023 02:54:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8O4B4uy7CoIPwNoh/BIh2l1W5zXff4QZgHv6+pQCCZDLrC4Hm/av41oqGepcfGrGsh/E/ X-Received: by 2002:a17:906:5e04:b0:7c0:e803:4ebb with SMTP id n4-20020a1709065e0400b007c0e8034ebbmr42552535eju.70.1672916064548; Thu, 05 Jan 2023 02:54:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672916064; cv=none; d=google.com; s=arc-20160816; b=htEu0L/WrZ5Dm8lIaQro9Vm9K57YiMoXqyLo4FmDpnVHu2wvweNv8U/a0H4BUePDg4 2eChpardR8j33lCM4u4cpU8xpLjW59fyKITDUASxzAExwFLI7k0cvln3falgr1EDXUbd aC78QDiacBCBpdJ5EZ4HMvnb60RrYmU3AhnNlFvHX2pjun97ntj+jk1qFIl/n8NAmWR8 d/IRQmADXH6f+rcOd33EI6CShV4ZMuHiJUJ0YPIrC5i4+S3eubXMhkF0Og2Rh3Tn7OON fEpdExA1++0kQluJWuFfmESKocRZ9fTROk73/14xgSCbots4EwJ2b5dDJTkbt2hYGhVK odiw== 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:sender:dkim-signature; bh=ElgoEYYX4w2FGSSWb3yGwVmH3jRp5HCgJlvFyQc3564=; b=QS6jo4a34wWeFKySEuD6OGZX8zHKjAX2G+sduW/FyIgJmOJhxVzsPZr9KhE4j9u+TI 3ZHrhn4h2yYlK40XW2wloZ0F7aTMEDkiO77Af5JhbBQ3Cwqgr75sVezT5FD+BkTcSWMY U9XNzll82wEj3/WKp93WEollLUffRVjRjbAkOeY8SXbSd1jPSYNGVBuHPcPLFO8bz9w7 F4PgSfxF0NuJiszMsHWT2NLfKFNr7Y/RJqU0LybsiiNDKNt9IlFia4MATZVgM0+6A0yf 3VvHAtvEKVVeWcsaHb7bEwhSrlQugbK2eDo9AOmBh0N0ja7pqPy9/1l/tJT+Z4F2oP8C iKvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NOH89Iwk; 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 un2-20020a170907cb8200b007ade4c97618si27695931ejc.930.2023.01.05.02.54.10; Thu, 05 Jan 2023 02:54:24 -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=@gmail.com header.s=20210112 header.b=NOH89Iwk; 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 S232395AbjAEKma (ORCPT + 57 others); Thu, 5 Jan 2023 05:42:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232091AbjAEKl6 (ORCPT ); Thu, 5 Jan 2023 05:41:58 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EDF34E43A for ; Thu, 5 Jan 2023 02:40:34 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id i9so52268734edj.4 for ; Thu, 05 Jan 2023 02:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=ElgoEYYX4w2FGSSWb3yGwVmH3jRp5HCgJlvFyQc3564=; b=NOH89IwkBkrax5AB2S/wEli+A1tRI6lpy+rMrHZZUQ5JMiqZsNJkYRQOqNZuwwiiLk zxRqXHfBlKNPQoj+faAWwfrP7JXubSQYCM/xQN9XoVXThqRPTYege5hNx0etcaYgIlnM migZOMw051FTvj76yghnktRo/02OZsxzwDmBlsEt17+BaMT6YXAM7N+D963SWUhdjY4C 3jVmLozeME+ESEMOEBEUSonsczvaxMWDW+fAEIBlCP7SjlPw3OqrD8BFdZkA+ZMZS+vf aMrHR14zKZrZZm4YzDq7BEUqWBC96ynvtFoV696zu8eg6s4hPG7adU9RuWlAFNyZlEnO q3eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ElgoEYYX4w2FGSSWb3yGwVmH3jRp5HCgJlvFyQc3564=; b=UbFNTKjIRStZsA/WYyujhlk14vplP9Cva9k23osyETq7hgQsCvSFCL1akQhZ8Dc36r 7pdPPR9OcEZsQFSVN99X2VEFbOF8CwXwLpQHnKSbi7zdStQnJe0P2sdijQE6vlqh0sy7 9fgnkFbjIPAtZZz48Qx8SLaRC+CBvFp6W7yt4cBmlfH3dp9Oke1NwglnDUehTxnp3LGZ iERTnWHtidKVz9sEafg+MSKuD4V8ch4cHFcDsdpzJlM2co0eOrRDIlC3fGZMwDgFR+wL naupELQcbJIT65zf71ELBwT4ijy10KAXWHOGvi3cT3bQf3w/KCVJQgUMmd4yOk3R9yXG ZGbg== X-Gm-Message-State: AFqh2kqCzT2WP5AHMxM6hrg2f+JhDgjITfUbo8CPeXLDMPQjZbaMnQjH fr0A1CxoeCepo0NGXC0YgE0= X-Received: by 2002:aa7:cf94:0:b0:47b:16f5:61dc with SMTP id z20-20020aa7cf94000000b0047b16f561dcmr45010171edx.37.1672915232787; Thu, 05 Jan 2023 02:40:32 -0800 (PST) Received: from gmail.com (1F2EF380.nat.pool.telekom.hu. [31.46.243.128]) by smtp.gmail.com with ESMTPSA id u1-20020aa7d541000000b0046951b43e84sm15959447edr.55.2023.01.05.02.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 02:40:32 -0800 (PST) Sender: Ingo Molnar Date: Thu, 5 Jan 2023 11:40:30 +0100 From: Ingo Molnar To: "Paul E. McKenney" 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: 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: <20230105011537.1774941-2-paulmck@kernel.org> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 * 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 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. Thanks, Ingo