Skip to content

Commit 1de08dc

Browse files
aeglsuryasaimadhu
authored andcommitted
x86/mce: Add a struct mce.kflags field
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Tony Luck <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 9554bfe commit 1de08dc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

arch/x86/include/asm/mce.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@
129129

130130
#define XEC(x, mask) (((x) >> 16) & mask)
131131

132+
/* mce.kflags flag bits for logging etc. */
133+
#define MCE_HANDLED_CEC BIT_ULL(0)
134+
#define MCE_HANDLED_UC BIT_ULL(1)
135+
#define MCE_HANDLED_EXTLOG BIT_ULL(2)
136+
#define MCE_HANDLED_NFIT BIT_ULL(3)
137+
#define MCE_HANDLED_EDAC BIT_ULL(4)
138+
#define MCE_HANDLED_MCELOG BIT_ULL(5)
139+
132140
/*
133141
* This structure contains all data related to the MCE log. Also
134142
* carries a signature to make it easier to find from external

arch/x86/include/uapi/asm/mce.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct mce {
3535
__u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */
3636
__u64 ppin; /* Protected Processor Inventory Number */
3737
__u32 microcode; /* Microcode revision */
38+
__u64 kflags; /* Internal kernel use. See below */
3839
};
3940

4041
#define MCE_GET_RECORD_LEN _IOR('M', 1, int)

0 commit comments

Comments
 (0)