From patchwork Wed Nov 18 15:15:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paoloni, Gabriele" X-Patchwork-Id: 11915495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, LOTS_OF_MONEY,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77F62C6379D for ; Wed, 18 Nov 2020 15:16:09 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0BF724752 for ; Wed, 18 Nov 2020 15:16:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="W3HokcR1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0BF724752 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+177+5278000+9232812@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id 7GwFYY5279335xtBJtj4ePsj; Wed, 18 Nov 2020 07:16:08 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.25811.1605712566847477229 for ; Wed, 18 Nov 2020 07:16:06 -0800 IronPort-SDR: gn7SQdi7dC4hYBwmcJFLwPgJHz/L3P+yj31zrMTX6yA1U87FjGEZ6NMJ5ioxxs/oW0b86LwH3B i8UW8S5T1xKQ== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="170348287" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="170348287" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:00 -0800 IronPort-SDR: GYtp/eQEMJHox3iSJRYa0KY4b4v4TwS7rbVt7DlVD6PBO5ZpAkMbHz9LG3SGZhf51VhcE8MPWI ebHCf7THJvWg== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="359492070" X-Received: from paolonig001.ir.intel.com ([163.33.183.93]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:15:58 -0800 From: "Paoloni, Gabriele" To: tony.luck@intel.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gabriele.paoloni@intel.com, linux-safety@lists.elisa.tech Subject: [linux-safety] [PATCH 1/4] x86/mce: do not overwrite no_way_out if mce_end() fails Date: Wed, 18 Nov 2020 15:15:49 +0000 Message-Id: <20201118151552.1412-2-gabriele.paoloni@intel.com> In-Reply-To: <20201118151552.1412-1-gabriele.paoloni@intel.com> References: <20201118151552.1412-1-gabriele.paoloni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech List-Post: X-Gm-Message-State: GZ8aeICdpnUX0zzbrSArm6fpx5278000AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1605712568; bh=1lM/6sTOqF3QD+E/PbXR4pFK7x0hwGXh+OlvHueLRMg=; h=Cc:Content-Type:Date:From:Subject:To; b=W3HokcR1rNSO56Tfj+AYKJ/0JMweh81KR5XavRCJIrL1Cvpz0x9fAv5f0tze+hJoNyh d9eIyrh1OKJaIOa2k3oUU848W6pIR2KDxYDzl0MNDLd5ZwmGxw6GB2xOgGbW/0erSx79s +UtRm9mailCW0a1DSK8TV8SLI547gYkYyWo= Currently if mce_end() fails no_way_out is set equal to worst. worst is the worst severirty that was found in the MCA banks associated to the current CPU; however at this point no_way_out could be already set by mca_start() by looking at all severities of all CPUs that entered the MCE handler. if mce_end() fails we first check if no_way_out is already set and if so we stick to it, otherwise we use the local worst value Signed-off-by: Gabriele Paoloni Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/mce/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 4102b866e7c0..b990892c6766 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1385,7 +1385,7 @@ noinstr void do_machine_check(struct pt_regs *regs) */ if (!lmce) { if (mce_end(order) < 0) - no_way_out = worst >= MCE_PANIC_SEVERITY; + no_way_out = no_way_out ? no_way_out : worst >= MCE_PANIC_SEVERITY; } else { /* * If there was a fatal machine check we should have From patchwork Wed Nov 18 15:15:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paoloni, Gabriele" X-Patchwork-Id: 11915493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, LOTS_OF_MONEY,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74A98C63798 for ; Wed, 18 Nov 2020 15:16:09 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7DC924757 for ; Wed, 18 Nov 2020 15:16:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="nUUHWzWr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7DC924757 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+178+5278000+9232812@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id ZOr1YY5279335x7bSojrU1NW; Wed, 18 Nov 2020 07:16:08 -0800 X-Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web12.25539.1605712566306509535 for ; Wed, 18 Nov 2020 07:16:07 -0800 IronPort-SDR: u8yZ8bvW9zk9qLjDRzes41gW8z8meOyg+RD8YFeoEBjNln5JbM8Hsqynz8k1GKqVx2PRnsNfmA 4zN6j4AxvREQ== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="170348298" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="170348298" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:03 -0800 IronPort-SDR: YsAkNBARL3HuPONP6kRUnF11yeoR3+ZaUcpZskIYpOJG2DWYRZUtTZ+eTWadQ2Lq3sjmZnV/4z mSsF6lGpIX9Q== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="359492091" X-Received: from paolonig001.ir.intel.com ([163.33.183.93]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:01 -0800 From: "Paoloni, Gabriele" To: tony.luck@intel.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gabriele.paoloni@intel.com, linux-safety@lists.elisa.tech Subject: [linux-safety] [PATCH 2/4] x86/mce: move the mce_panic() call and kill_it assignments at the right places Date: Wed, 18 Nov 2020 15:15:50 +0000 Message-Id: <20201118151552.1412-3-gabriele.paoloni@intel.com> In-Reply-To: <20201118151552.1412-1-gabriele.paoloni@intel.com> References: <20201118151552.1412-1-gabriele.paoloni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech List-Post: X-Gm-Message-State: khGeHOmHFrJeC5QA7prJVu0Zx5278000AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1605712568; bh=MGL9kqcV1ZtnwFSiTS0cF2Zfu5ahmWUQR7pNnXGC7OQ=; h=Cc:Content-Type:Date:From:Subject:To; b=nUUHWzWri3LWKxJbaYVex5PUOx/V1xUuEErilc9UWrNptvQMvunFS6BH3CALf2nVrJS poF8mr1O4eKYJ6t2faBDXmqJRiZAv18vBmmhgHFIz0oXXC88CCRs2KA/MfP7xschRGn6T DSmFgNTfOhaZywnGUHQyoVSci24o5lBkj4Q= Right now for local MCEs we panic(),if needed, right after lmce is set. For global MCEs mce_reign() takes care of calling mce_panic(). Hence this patch: - improves readibility by moving the conditional evaluation of tolerant up to when kill_it is set first - moves the mce_panic() call up into the statement where mce_end() fails Signed-off-by: Gabriele Paoloni Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/mce/core.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index b990892c6766..e025ff04438f 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1350,8 +1350,7 @@ noinstr void do_machine_check(struct pt_regs *regs) * severity is MCE_AR_SEVERITY we have other options. */ if (!(m.mcgstatus & MCG_STATUS_RIPV)) - kill_it = 1; - + kill_it = (cfg->tolerant == 3) ? 0 : 1; /* * Check if this MCE is signaled to only this logical processor, * on Intel, Zhaoxin only. @@ -1384,8 +1383,15 @@ noinstr void do_machine_check(struct pt_regs *regs) * When there's any problem use only local no_way_out state. */ if (!lmce) { - if (mce_end(order) < 0) + if (mce_end(order) < 0) { no_way_out = no_way_out ? no_way_out : worst >= MCE_PANIC_SEVERITY; + /* + * mce_reign() has probably failed hence evaluate if we need + * to panic + */ + if (no_way_out && mca_cfg.tolerant < 3) + mce_panic("Fatal machine check on current CPU", &m, msg); + } } else { /* * If there was a fatal machine check we should have @@ -1401,15 +1407,6 @@ noinstr void do_machine_check(struct pt_regs *regs) } } - /* - * If tolerant is at an insane level we drop requests to kill - * processes and continue even when there is no way out. - */ - if (cfg->tolerant == 3) - kill_it = 0; - else if (no_way_out) - mce_panic("Fatal machine check on current CPU", &m, msg); - if (worst > 0) irq_work_queue(&mce_irq_work); From patchwork Wed Nov 18 15:15:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paoloni, Gabriele" X-Patchwork-Id: 11915489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, LOTS_OF_MONEY,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBF61C6369E for ; Wed, 18 Nov 2020 15:16:08 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C690824752 for ; Wed, 18 Nov 2020 15:16:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="AMKpJKQV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C690824752 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+176+5278000+9232812@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id tvdWYY5279335xKcYvGhwpE1; Wed, 18 Nov 2020 07:16:07 -0800 X-Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web12.25539.1605712566306509535 for ; Wed, 18 Nov 2020 07:16:06 -0800 IronPort-SDR: T2nvvqCYdE093QLteL5GNDaAv1R79h0vkxCYmMU74oiuK64KxdzOU9MuZktQiOXofsDkFJUHGA uWhOcP04BN+w== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="170348311" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="170348311" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:05 -0800 IronPort-SDR: FhT7lQxgVb3O+FEWaDT+DGgvl5M7rYr2Jw/7nkzcwdHVSZZFiGNSsXSFvavNBSBPlWoMCVPaHZ TOaOPvn+1F2A== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="359492116" X-Received: from paolonig001.ir.intel.com ([163.33.183.93]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:03 -0800 From: "Paoloni, Gabriele" To: tony.luck@intel.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gabriele.paoloni@intel.com, linux-safety@lists.elisa.tech Subject: [linux-safety] [PATCH 3/4] x86/mce: for LMCE panic only if mca_cfg.tolerant < 3 Date: Wed, 18 Nov 2020 15:15:51 +0000 Message-Id: <20201118151552.1412-4-gabriele.paoloni@intel.com> In-Reply-To: <20201118151552.1412-1-gabriele.paoloni@intel.com> References: <20201118151552.1412-1-gabriele.paoloni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech List-Post: X-Gm-Message-State: L6BcSgn9wh1relgTpKouV8uEx5278000AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1605712567; bh=ljoK+aF9waM3l9R0Qif0y/ymqcApy8MpjSIqdG5zRlU=; h=Cc:Content-Type:Date:From:Subject:To; b=AMKpJKQVV2AzBJc54JviztSirsavdgeq9mEzTzK8EE7nJ+Tkwf1ObuB3zmcE8KLbpWG ZK9h5PsEIwst4bInl53m5OHWbAbGqtGFAxQijcks1ObaHUD26nNOmmZSYg/0UdsMx5P5y 3ZnN7QGz6qAGzSUrwrRMN2GQjcKYGkcsZfA= Right now for LMCE if no_way_out is set mce_panic() is called regardless of mca_cfg.tolerant. This is not correct as if mca_cfg.tolerant = 3 we should never panic. Signed-off-by: Gabriele Paoloni Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/mce/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index e025ff04438f..d16cbb05b09c 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1367,7 +1367,7 @@ noinstr void do_machine_check(struct pt_regs *regs) * to see it will clear it. */ if (lmce) { - if (no_way_out) + if (no_way_out && mca_cfg.tolerant < 3) mce_panic("Fatal local machine check", &m, msg); } else { order = mce_start(&no_way_out); From patchwork Wed Nov 18 15:15:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paoloni, Gabriele" X-Patchwork-Id: 11915497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, LOTS_OF_MONEY,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 228F9C63777 for ; Wed, 18 Nov 2020 15:16:34 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96F232474A for ; Wed, 18 Nov 2020 15:16:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="fhGk/0PH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96F232474A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+179+5278000+9232812@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id zKZ5YY5279335xLu0rFG19OI; Wed, 18 Nov 2020 07:16:32 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.25487.1605712592432184645 for ; Wed, 18 Nov 2020 07:16:32 -0800 IronPort-SDR: TrzMG9VZL73VNRKirVcJG7GWgeZx9rUJSHQOjV6QB9h/PhGsl4vm+kc3bQuYhT3aazhvfuKhe8 qH0KtSBkikvA== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="170348326" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="170348326" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:07 -0800 IronPort-SDR: Qdj1G/BZDfUwKBd9PGrja0yEPB2y5oIR8EVsEoULTfcS+ZmJWqFhPNXha2H4xpjI3mfdLEKQTK ha0EJCyBdLKQ== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="359492130" X-Received: from paolonig001.ir.intel.com ([163.33.183.93]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:16:05 -0800 From: "Paoloni, Gabriele" To: tony.luck@intel.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gabriele.paoloni@intel.com, linux-safety@lists.elisa.tech Subject: [linux-safety] [PATCH 4/4] x86/mce: remove redundant call to irq_work_queue() Date: Wed, 18 Nov 2020 15:15:52 +0000 Message-Id: <20201118151552.1412-5-gabriele.paoloni@intel.com> In-Reply-To: <20201118151552.1412-1-gabriele.paoloni@intel.com> References: <20201118151552.1412-1-gabriele.paoloni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech List-Post: X-Gm-Message-State: niYMD9jaD8n7x4WdAaMu5vcrx5278000AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1605712592; bh=urMRSDDFuUq/ESLV4dtwlN4pczdbLZ4KzlBEmtVo32A=; h=Cc:Content-Type:Date:From:Subject:To; b=fhGk/0PHYTSoImX8Tx2ohjGcOc2YWTmZMd/NdnXQAPgqzd396zl4BXkTkUgc5Tn76cf I2gVusv/g8U9SgDLaBj1opU7gelodopVzoy7vRCD8tSuTr72te4Pb7mF6dvhKejP5baXQ EljgawccVmBaHqCDKn+mXXO6pTkd0bcsxR0= Right now in do_machine_check() we have: __mc_scan_banks()->mce_log()->irq_work_queue(&mce_irq_work) hence the call of irq_work_queue() below after __mc_scan_banks() seems redundant. Just remove it. Signed-off-by: Gabriele Paoloni Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/mce/core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index d16cbb05b09c..f2f7bfc60c67 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1407,9 +1407,6 @@ noinstr void do_machine_check(struct pt_regs *regs) } } - if (worst > 0) - irq_work_queue(&mce_irq_work); - if (worst != MCE_AR_SEVERITY && !kill_it) goto out;