Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18687155ybl; Fri, 3 Jan 2020 07:10:18 -0800 (PST) X-Google-Smtp-Source: APXvYqy02xfNJ/ozRi1l9wzyK7Nw+iU5ixA2NqVZrv0aWP2Qy6c6ldM5o1KK6yU4Dnx/lCbGurv0 X-Received: by 2002:a05:6830:1e99:: with SMTP id n25mr60520359otr.67.1578064218458; Fri, 03 Jan 2020 07:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578064218; cv=none; d=google.com; s=arc-20160816; b=qSZWbvJzD6hNeKgcqZUohLHAg8ij3hvzTmhcnaHitaIva0wNIUfQSyNkPj0mVTnxkJ J0TFO9/3GacKv9GAkaUX5ZoLifu+pCBA0h3JyfJHYNJnT4k2GeZfRwGCkzfLnAxsU1gi ubipIiMP2pLLa7CHr6+otGtjpHcbnUV+3rptvEqsV0WMheeddMs/lweoXg9i5HQHcvT0 NTT5UZLM9BB4NmrLpQiBbGVAEFMVcxmU+iNZTrFOzM/TmtjD62FEzNOkNXy6o8I/Vaym 0sCokSv33UStYbNftw8ZMGHRpxffqArLt8aTOJPRrwPCcejvG9ACHL5l2kjnmwyMXjMD /nyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:dkim-signature; bh=ilxhrqiz2sA0xCthbk4rbmbS2FVPt/6iJofX5fmxfxs=; b=cPWQBCkQMbFI/sSoSME/Ef93jZoLUwcWsEFp2q1osbuA71vI9TRmxJYDd+mnqMBonf y3HuBTpZY6jkm1/v52ajwPBs1SU06dSjIYKvApssF5lCdv0eVSlG2pLpd0+kcumstOXh A/Afs5Tb2RqNOlkDdZUDRp42viN9VLO+sLBEU5JjDMLrsxGMDS0tRjnK0nmAsPj643ut TxiP0TNTDfYBbVXJO6icRkJqwyHGvooIsCQ1mg0ab6LiRRFpqK9wYHBGImWGJdK2GgAi q8iqim3tKakqKen5IzIvaHaf5Ovu0dbMXcn82pwD+0nrzc40I2cYcpV4HHly6vjJFcuq ZEfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=lmzDQfpR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si23354425oth.311.2020.01.03.07.10.06; Fri, 03 Jan 2020 07:10:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=lmzDQfpR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727965AbgACPID (ORCPT + 99 others); Fri, 3 Jan 2020 10:08:03 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:64088 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727701AbgACPID (ORCPT ); Fri, 3 Jan 2020 10:08:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1578064082; x=1609600082; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ilxhrqiz2sA0xCthbk4rbmbS2FVPt/6iJofX5fmxfxs=; b=lmzDQfpRvRrdUhojVEjvWcTJUKrDmhwiXVzihyVNvH4ai1QPD+mI4yNU nn3ZPyDR4i0EAXDJkEKJtvWoZqOF6wt8Cz2Nmbpjbizo9rKt619zkVMkZ naSDiElI+S1WkYHOOxna8apGlbNlqYQyDh3u7bVHso7u+UJYhPARRW0CB s=; IronPort-SDR: Oa/ojuSblhpUdRZMEVQrq0/DmPhELYjRcS+BsILcI1wiMfgpmZPicI7pxuGVx0EHyidjvUARu4 tDS7RvKJ+U9w== X-IronPort-AV: E=Sophos;i="5.69,391,1571702400"; d="scan'208";a="10900535" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-9ec21598.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 03 Jan 2020 15:07:44 +0000 Received: from u7588a65da6b65f.ant.amazon.com (iad7-ws-svc-lb50-vlan3.amazon.com [10.0.93.214]) by email-inbound-relay-1d-9ec21598.us-east-1.amazon.com (Postfix) with ESMTPS id 737AFA1D0E; Fri, 3 Jan 2020 15:07:39 +0000 (UTC) Received: from u7588a65da6b65f.ant.amazon.com (localhost [127.0.0.1]) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTPS id 003F7bDS020457 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Jan 2020 16:07:37 +0100 Received: (from jschoenh@localhost) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Submit) id 003F7bQ5020456; Fri, 3 Jan 2020 16:07:37 +0100 From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= To: Borislav Petkov Cc: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= , Yazen Ghannam , linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, Tony Luck , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Subject: [PATCH v2 2/6] x86/mce: Make mce=nobootlog work again Date: Fri, 3 Jan 2020 16:07:18 +0100 Message-Id: <20200103150722.20313-3-jschoenh@amazon.de> X-Mailer: git-send-email 2.22.0.3.gb49bb57c8208.dirty In-Reply-To: <20200103150722.20313-1-jschoenh@amazon.de> References: <20200103150722.20313-1-jschoenh@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 8b38937b7ab5 ("x86/mce: Do not enter deferred errors into the generic pool twice") the mce=nobootlog option has become mostly ineffective (after being only slightly ineffective before), as the code is taking actions on MCEs left over from boot when they have a usable address. Move the check for MCP_DONTLOG a bit outward to make it effective again. Also, since commit 011d82611172 ("RAS: Add a Corrected Errors Collector") the two branches of the remaining "if" the bottom of machine_check_poll() do same. Unify them. Signed-off-by: Jan H. Schönherr --- Changes v1->v2: - remove an indentation level in favor of a goto (requested by Boris) - don't mention Linux version (per remark from Boris) --- arch/x86/kernel/cpu/mce/core.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 16134ce587fd..0ccd6cf3402d 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -750,26 +750,22 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b) log_it: error_seen = true; - mce_read_aux(&m, i); + if (flags & MCP_DONTLOG) + goto clear_it; + mce_read_aux(&m, i); m.severity = mce_severity(&m, mca_cfg.tolerant, NULL, false); - /* * Don't get the IP here because it's unlikely to * have anything to do with the actual error location. */ - if (!(flags & MCP_DONTLOG) && !mca_cfg.dont_log_ce) - mce_log(&m); - else if (mce_usable_address(&m)) { - /* - * Although we skipped logging this, we still want - * to take action. Add to the pool so the registered - * notifiers will see it. - */ - if (!mce_gen_pool_add(&m)) - mce_schedule_work(); - } + if (mca_cfg.dont_log_ce && !mce_usable_address(&m)) + goto clear_it; + + mce_log(&m); + +clear_it: /* * Clear state for this bank. */ -- 2.22.0.3.gb49bb57c8208.dirty