x86/mce: Add macros for corrected error count bit field
Luck, Tony
maintainerPATCH v2 2/2 x86/mce: Add macros for corrected error count bit field
From: Qiuxu Zhuo <[email protected]>
The bit field 52:38 of MCi_STATUS is for corrected error count. Add {*_SHIFT|*_MASK|*_CEC(c)} macros for the bit field.
Signed-off-by Qiuxu Zhuo <[email protected]>
Signed-off-by Tony Luck <[email protected]>
---
V2: Just the CEC change. Vertical alignment of other fields fixed in part 1
arch/x86/include/asm/mce.h | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/include/asm/mce.h +3 -0
@@ -39,6 +39,9 @@#define MCI_STATUS_PCC BIT_ULL(57)/* processor context corrupt */ #define MCI_STATUS_S BIT_ULL(56)/* Signaled machine check */ #define MCI_STATUS_AR BIT_ULL(55)/* Action required */ +#define MCI_STATUS_CEC_SHIFT 38/* Corrected Error Count */ +#define MCI_STATUS_CEC_MASK 0x1fffc000000000ULL +#define MCI_STATUS_CEC (c) (((c) & MCI_STATUS_CEC_MASK) >> MCI_STATUS_CEC_SHIFT)/* AMD-specific bits */ #define MCI_STATUS_TCC BIT_ULL(55)/* Task context corrupt */
tip-bot for Qiuxu Zhuo
merge bot[tip:ras/core] x86/mce: Add macros for the corrected error count bit field
x86/mce: Add macros for the corrected error count bit field
Commit-ID: e5276b1ffa97e3883802f40a5e3a167fe1cb1d20 Gitweb: https://git.kernel.org/tip/e5276b1ffa97e3883802f40a5e3a167fe1cb1d20 Author: Qiuxu Zhuo <[email protected]> AuthorDate: Mon, 24 Sep 2018 17:03:43 -0700 Committer: Borislav Petkov <[email protected]> CommitDate: Thu, 27 Sep 2018 16:08:18 +0200
x86/mce: Add macros for the corrected error count bit field
The bit field [52:38] of MCi_STATUS contains the corrected error count. Add {*_SHIFT|*_MASK|*_CEC(c)} macros for it.
[ bp: use GENMASK_ULL. ]
Signed-off-by Qiuxu Zhuo <[email protected]>
Signed-off-by Tony Luck <[email protected]>
Signed-off-by Borislav Petkov <[email protected]>
Cc Aristeu Rozanski <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
--- arch/x86/include/asm/mce.h | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/include/asm/mce.h +3 -0
@@ -39,6 +39,9 @@#define MCI_STATUS_PCC BIT_ULL(57)/* processor context corrupt */ #define MCI_STATUS_S BIT_ULL(56)/* Signaled machine check */ #define MCI_STATUS_AR BIT_ULL(55)/* Action required */ +#define MCI_STATUS_CEC_SHIFT 38/* Corrected Error Count */ +#define MCI_STATUS_CEC_MASK GENMASK_ULL(52,38) +#define MCI_STATUS_CEC (c) (((c) & MCI_STATUS_CEC_MASK) >> MCI_STATUS_CEC_SHIFT)/* AMD-specific bits */ #define MCI_STATUS_TCC BIT_ULL(55)/* Task context corrupt */