Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4549678ybb; Tue, 7 Apr 2020 09:35:20 -0700 (PDT) X-Google-Smtp-Source: APiQypLDhZUrrbejBpLn8hQZQpRvPhl/5I2W8GKnsJcPBndmv79ZOPq6dlDWW1b3ie8bqaikMdAW X-Received: by 2002:a9d:1a2:: with SMTP id e31mr2457506ote.30.1586277320008; Tue, 07 Apr 2020 09:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586277319; cv=none; d=google.com; s=arc-20160816; b=dw+s+b/4wVbg0GGWumvWZYNpJKXlCyaeWpfMbcwaL52+bunsh8KX1RIyPBY8BW7ayC sFyQHWAOMfBkbDaGuiOz7o/gxWajkHNcHDvhW6AoJQMYtboF5JRwVsOpr0rB97NTJyEG hSnfWIwYPM8XXv5U1DdgTJDUXX9tgL5LAjDHzuZD98X1ZItYiaT5yrYTXfhXOqIGq8Zc tVuhhE6Lli6cpyhICpq+I4ajwIwxiHgC67xjTrGXYwKjKvIjgFjUonlbgphIfPS+qbDb qLw+H7CJ1cWYmpxCim38wnxs5iH+DktoCArrcybsIupGnrGKkCBUZC5KZA8eiJjge769 haBg== 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 :dkim-signature; bh=PVePcEN5rX9U+YD9qBHBAUyHWvNU8DcClDL4UV8p+fY=; b=qkjUrK1upPODr61D66POE/3mA0H/XR3mDjw207/wLEuoB+ps8nq6jpSFQXzduVwe7/ jQIyfuC3hHLefn4F4r1MltkPmZMe9dTtSg3ZA7LCxK5ri8tZFK25TgpZfcfhRoyBlf+q azGiocgVcq97UQIaxzlZcl/5n7tU4lL9Wy3MHaIpLokMHFm2aqVd+A4+I2QC/LttHDLY soCh/iXSlicajVVQ3F1ne7rAHhCMewsLLnBBXgDFDt8kol+2Daul/PyRQNc23/WnJR6b 8pHGhUA0nyRODP2+jOh+NOufpFYIg9bOLsqGHiCBCs3PxivoT6yoGQOtwzg/rUhtEvYz rSHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=kkL9eZNa; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d63si828258oib.224.2020.04.07.09.35.07; Tue, 07 Apr 2020 09:35:19 -0700 (PDT) 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=@alien8.de header.s=dkim header.b=kkL9eZNa; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728452AbgDGQeY (ORCPT + 99 others); Tue, 7 Apr 2020 12:34:24 -0400 Received: from mail.skyhub.de ([5.9.137.197]:53930 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728259AbgDGQeW (ORCPT ); Tue, 7 Apr 2020 12:34:22 -0400 Received: from zn.tnic (p200300EC2F0B2700A94266E658FF3DDD.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:2700:a942:66e6:58ff:3ddd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 998E21EC0CE1; Tue, 7 Apr 2020 18:34:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1586277261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PVePcEN5rX9U+YD9qBHBAUyHWvNU8DcClDL4UV8p+fY=; b=kkL9eZNaHHZzl6W3n2iZZVUV3XVfDptN24k+dQYIBEnLiS9DZwjF4rGZ0ZHbiYKrJ5BeTU zm6+A2jK8fVLIpjXda7MFbs1/7HkdaOCtAxleTI0gbvy339AOk+cFy7FxEOfESNBUdh2Eg upLcALRoyv/oB0mlykq3VxaxMJy9sNQ= From: Borislav Petkov To: Tony Luck Cc: Yazen Ghannam , X86 ML , LKML Subject: [PATCH 2/9] x86/mce: Rename "first" function as "early" Date: Tue, 7 Apr 2020 18:34:07 +0200 Message-Id: <20200407163414.18058-3-bp@alien8.de> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200407163414.18058-1-bp@alien8.de> References: <20200212204652.1489-1-tony.luck@intel.com> <20200407163414.18058-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Luck It isn't going to be first on the notifier chain when the CEC is moved to be a normal user of the notifier chain. Fix the enum for the MCE_PRIO symbols to list them in reverse order so that the compiler can give them numbers from low to high priority. Add an entry for MCE_PRIO_CEC as the highest priority. [ bp: Use passive voice, add comments. ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200214222720.13168-2-tony.luck@intel.com --- arch/x86/include/asm/mce.h | 16 +++++++++------- arch/x86/kernel/cpu/mce/core.c | 10 +++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 83b6ddafa032..689ac6e9c65f 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -144,14 +144,16 @@ struct mce_log_buffer { struct mce entry[]; }; +/* Highest last */ enum mce_notifier_prios { - MCE_PRIO_FIRST = INT_MAX, - MCE_PRIO_UC = INT_MAX - 1, - MCE_PRIO_EXTLOG = INT_MAX - 2, - MCE_PRIO_NFIT = INT_MAX - 3, - MCE_PRIO_EDAC = INT_MAX - 4, - MCE_PRIO_MCELOG = 1, - MCE_PRIO_LOWEST = 0, + MCE_PRIO_LOWEST, + MCE_PRIO_MCELOG, + MCE_PRIO_EDAC, + MCE_PRIO_NFIT, + MCE_PRIO_EXTLOG, + MCE_PRIO_UC, + MCE_PRIO_EARLY, + MCE_PRIO_CEC }; struct notifier_block; diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index a6009efdfe2b..43b1519ad4e5 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -559,7 +559,7 @@ static bool cec_add_mce(struct mce *m) return false; } -static int mce_first_notifier(struct notifier_block *nb, unsigned long val, +static int mce_early_notifier(struct notifier_block *nb, unsigned long val, void *data) { struct mce *m = (struct mce *)data; @@ -580,9 +580,9 @@ static int mce_first_notifier(struct notifier_block *nb, unsigned long val, return NOTIFY_DONE; } -static struct notifier_block first_nb = { - .notifier_call = mce_first_notifier, - .priority = MCE_PRIO_FIRST, +static struct notifier_block early_nb = { + .notifier_call = mce_early_notifier, + .priority = MCE_PRIO_EARLY, }; static int uc_decode_notifier(struct notifier_block *nb, unsigned long val, @@ -2041,7 +2041,7 @@ __setup("mce", mcheck_enable); int __init mcheck_init(void) { mcheck_intel_therm_init(); - mce_register_decode_chain(&first_nb); + mce_register_decode_chain(&early_nb); mce_register_decode_chain(&mce_uc_nb); mce_register_decode_chain(&mce_default_nb); mcheck_vendor_init_severity(); -- 2.21.0