Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5025440iob; Mon, 9 May 2022 07:09:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUFSb+NSqKRjnP4ovOxTo1c5SGteKrNKjb9olRvDKnDe2duSdETvPX0u5Ii0zgOCqO9dgD X-Received: by 2002:a17:90a:7c4c:b0:1dc:26a1:b82f with SMTP id e12-20020a17090a7c4c00b001dc26a1b82fmr18203628pjl.148.1652105378496; Mon, 09 May 2022 07:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652105378; cv=none; d=google.com; s=arc-20160816; b=lUk1xobC+lsh44FkK4tBMfrOBp2quNhA4+NkmhdPBqqFHfvi3452+TD0wCuvUXCmGH Oa3Bjy8eseHpVIhYmlM3eYznDcuMEFc2dQ8MntF5aXtH4h/0oS4MDSuilx/jz3hhIVit emklx72ryiNlGepHMfcdjSd7Sr/qiCiKtL4xRCq7z2xPVFYBv9tX6F5C7AaDn4eyLdx9 1UnBhmifxxhKCDaKpLS4qYky4wOLi9uKb5gEXnOjXEsZeRDyAeglIzxl+3Yfe9dCort7 9Kr5xtar8Z20huWU50IRwZk0hCXDujXho+b++DcFHwdZFSe/2slM7dp8HcpEHzl57cAm Bsgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=FDSynU42H0ANPTpjgbswkYJXVZufPOPf8nzkhHqjA9g=; b=mO2pYqTTi0W7EgDZB1f2n+M8TbRWxk6DJd/gF/1ZYtlmQBkAJSgkscKGnCxte2ThJP Q1x3iCCNbnbht+8cMUjSuCD6kuy0RAbnpVax1683aTEE/4maeA1Tmn4yWUuWX7TYnctR cqGg9mSIT3IWdKSvnWZqEole4v05775W+vIHjutmCcFXxZHz8pb0mDnTKaQORWTel3hd EezPuSHmrcou8Dg6xfmKhpIXUvZYxtlulQFpFog06HfwojupFYtiEGzAZr3DyYhIC7V2 4WTCpiwuhSeS2UekKWKILxgXEJKYuRSH/Yemd6isGWgdecyn4l5ndYe+oA5TQcZ79df5 DmOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vmKUlABh; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ck8-20020a056a00328800b0050d429bb67esi12517182pfb.82.2022.05.09.07.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 07:09:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vmKUlABh; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7EAFB173364; Mon, 9 May 2022 06:59:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236657AbiEIODn (ORCPT + 99 others); Mon, 9 May 2022 10:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236626AbiEIODg (ORCPT ); Mon, 9 May 2022 10:03:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEB9716D5CC for ; Mon, 9 May 2022 06:59:42 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652104781; 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: in-reply-to:in-reply-to:references:references; bh=FDSynU42H0ANPTpjgbswkYJXVZufPOPf8nzkhHqjA9g=; b=vmKUlABhaBvEYz0X9LA3g5SRs3q6NK9pjEq5HDfdrkv8DNhJiu+xhSkMA6zdgQEprlDzCg uQWR46Hiz1n5Y0hzLAPihWXSh1PrxlSYk2hsuQTYX1OFGec+wVrZGK7qp4we6RqTX+Qakh BSagp92ogKOfiZ4quMyZMILbTxMIr02LfddqQvQLeX/k6xcU1kjTJJJN9L3wNd+67mHM8m 16UrGlt5n8Yz3RlqdYJT1GHL7F4HJ3T/aHL+iOWbDqGgRE84ihDkeISbp4UTxCINqutLyz 0i120YG1QFJBnP0HMncXXV9Af4R86Xe56Ls8BflDNQUL6C1XIO8Zsz+kiLneKg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652104781; 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: in-reply-to:in-reply-to:references:references; bh=FDSynU42H0ANPTpjgbswkYJXVZufPOPf8nzkhHqjA9g=; b=VlTE3d1mTqdZW3KhBs4KorVfZhqO0/Xdh68Ua4w6Qxm6hC/qsLC7dU9afDjI28gB3NaJhD xlvkhK2X24Pr7XCw== To: Ricardo Neri , x86@kernel.org Cc: Tony Luck , Andi Kleen , Stephane Eranian , Andrew Morton , Joerg Roedel , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Nicholas Piggin , "Ravi V. Shankar" , Ricardo Neri , iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: Re: [PATCH v6 21/29] x86/nmi: Add an NMI_WATCHDOG NMI handler category In-Reply-To: <20220506000008.30892-22-ricardo.neri-calderon@linux.intel.com> References: <20220506000008.30892-1-ricardo.neri-calderon@linux.intel.com> <20220506000008.30892-22-ricardo.neri-calderon@linux.intel.com> Date: Mon, 09 May 2022 15:59:40 +0200 Message-ID: <87a6bqrelv.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 On Thu, May 05 2022 at 17:00, Ricardo Neri wrote: > Add a NMI_WATCHDOG as a new category of NMI handler. This new category > is to be used with the HPET-based hardlockup detector. This detector > does not have a direct way of checking if the HPET timer is the source of > the NMI. Instead, it indirectly estimates it using the time-stamp counter. > > Therefore, we may have false-positives in case another NMI occurs within > the estimated time window. For this reason, we want the handler of the > detector to be called after all the NMI_LOCAL handlers. A simple way > of achieving this with a new NMI handler category. > > @@ -379,6 +385,10 @@ static noinstr void default_do_nmi(struct pt_regs *regs) > } > raw_spin_unlock(&nmi_reason_lock); > > + handled = nmi_handle(NMI_WATCHDOG, regs); > + if (handled == NMI_HANDLED) > + goto out; > + How is this supposed to work reliably? If perf is active and the HPET NMI and the perf NMI come in around the same time, then nmi_handle(LOCAL) can swallow the NMI and the watchdog won't be checked. Because MSI is strictly edge and the message is only sent once, this can result in a stale watchdog, no? Thanks, tglx