Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4550512ybb; Tue, 7 Apr 2020 09:36:18 -0700 (PDT) X-Google-Smtp-Source: APiQypJSwo0s8fH03V1ux3SvaBm9udtcyjM4La3VuG5FRuCHUK8/9Xe6/Rm78cTyzYEqDJPrsAO8 X-Received: by 2002:aca:4e57:: with SMTP id c84mr126861oib.148.1586277378669; Tue, 07 Apr 2020 09:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586277378; cv=none; d=google.com; s=arc-20160816; b=Tq+ED64MLyiHTcmVYUhFg3PXHRkh8XR5arNbhTl9ujSp+w7OkXyNUvzBk2bI60K+Fo 3EcZEPqdAibVlc+xHk7vBHUs8y8e1k/O+Xq1ulX39wChR9dTzjWzIgyfxgYX16NcfEnC BAtziCwkYhVkPUXfJJlZwzZRhi9COigqcyX/YBXStSiXT9WXiDTirtC3Xc+3009Rvplx H7NnzSalgLMlXNjG7JU/D7TQLw1xYtvCjnQj1GN4h0VqyE4v4bURMvhqi/Z6ZShraI7E PCNNc0AdFfiDHHuB5+CVQFMIRvwq4Me+50wdGl1QybdwQn8KsgiX324Qo4xCNVI+KX02 Gifw== 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=D535GRgTfzao2ks3gudZO5Oy1QhvqY2ljmaSLAOsNHM=; b=nTkGkUZzEUa7S1hfidYXiEKMl35jsFpjgFLnbtdn4WmXFJvNuN1GSSAFxfvpy6s1sh VZlu6fzF75f3RJXB8oO1yLhiol5kNNyCeFbwZCbTind45c1VLMGXgi4Ited96irsv9Pq 6ecr591m9e3VngFQkzYxyLC73YFFYETSPkQ1ixB5rufqE03JzZ7EoHnO/5bJrtL4P26p oHXXaVCNzDr/CXA94Ne3wggdsmu6b4+saOSYyyWVbIFhOD/dhjJthTHbF0Mwtw3yBav9 1u36Oue+o6zWkmR0MdbyK9FedCmbZwWwYP1+S2fHOv/wOKqR1m3rmY2RpWN5GSa2o2Ya 8orQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Q52IL4z3; 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 i25si827126oob.39.2020.04.07.09.36.05; Tue, 07 Apr 2020 09:36:18 -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=Q52IL4z3; 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 S1728636AbgDGQep (ORCPT + 99 others); Tue, 7 Apr 2020 12:34:45 -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 S1728433AbgDGQeY (ORCPT ); Tue, 7 Apr 2020 12:34:24 -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 5D3831EC0CE5; Tue, 7 Apr 2020 18:34:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1586277263; 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=D535GRgTfzao2ks3gudZO5Oy1QhvqY2ljmaSLAOsNHM=; b=Q52IL4z37GjhD6yvJ9BR7e1TCkQukTiEOiC1Z+LMcWxeSl9BigWaFoEpMHGnmoycDnsgE7 KQoWhUOnFrkN5VEsU15CqQWWDEzRLlMVpOPaeBJ5CWs65+gTIUzPz3ifkAujIo26wxPmOy x43A+KViWmluoSIg3srg5JSIcd0Cx+4= From: Borislav Petkov To: Tony Luck Cc: Yazen Ghannam , X86 ML , LKML Subject: [PATCH 4/9] x86/mce: Add a struct mce.kflags field Date: Tue, 7 Apr 2020 18:34:09 +0200 Message-Id: <20200407163414.18058-5-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 There can be many different subsystems register on the mce handler chain. Add a new bitmask field and define values so that handlers can indicate whether they took any action to log or otherwise handle an error. The default handler at the end of the chain can use this information to decide whether to print to the console log. Boris suggested a generic name and leaving plenty of spare bits for possible future use. [ bp: Move flag bits to the internal mce.h header and use BIT_ULL(). ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200214222720.13168-4-tony.luck@intel.com --- arch/x86/include/asm/mce.h | 8 ++++++++ arch/x86/include/uapi/asm/mce.h | 1 + 2 files changed, 9 insertions(+) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 689ac6e9c65f..5f04a24f30ea 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -129,6 +129,14 @@ #define XEC(x, mask) (((x) >> 16) & mask) +/* mce.kflags flag bits for logging etc. */ +#define MCE_HANDLED_CEC BIT_ULL(0) +#define MCE_HANDLED_UC BIT_ULL(1) +#define MCE_HANDLED_EXTLOG BIT_ULL(2) +#define MCE_HANDLED_NFIT BIT_ULL(3) +#define MCE_HANDLED_EDAC BIT_ULL(4) +#define MCE_HANDLED_MCELOG BIT_ULL(5) + /* * This structure contains all data related to the MCE log. Also * carries a signature to make it easier to find from external diff --git a/arch/x86/include/uapi/asm/mce.h b/arch/x86/include/uapi/asm/mce.h index 955c2a2e1cf9..5b59d80f1d4e 100644 --- a/arch/x86/include/uapi/asm/mce.h +++ b/arch/x86/include/uapi/asm/mce.h @@ -35,6 +35,7 @@ struct mce { __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */ __u64 ppin; /* Protected Processor Inventory Number */ __u32 microcode; /* Microcode revision */ + __u64 kflags; /* Internal kernel use. See below */ }; #define MCE_GET_RECORD_LEN _IOR('M', 1, int) -- 2.21.0