Skip to content

Commit d9c43b6

Browse files
committed
Merge tag 'ras_core_for_v6.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 RAS updates from Borislav Petkov: - Unify and refactor the MCA arch side and better separate code - Cleanup and simplify the AMD RAS side, unify code, drop unused stuff * tag 'ras_core_for_v6.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Add a clear_bank() helper x86/mce: Move machine_check_poll() status checks to helper functions x86/mce: Separate global and per-CPU quirks x86/mce: Do 'UNKNOWN' vendor check early x86/mce: Define BSP-only SMCA init x86/mce: Define BSP-only init x86/mce: Set CR4.MCE last during init x86/mce: Remove __mcheck_cpu_init_early() x86/mce: Cleanup bank processing on init x86/mce/amd: Put list_head in threshold_bank x86/mce/amd: Remove smca_banks_map x86/mce/amd: Remove return value for mce_threshold_{create,remove}_device() x86/mce/amd: Rename threshold restart function
2 parents bd91417 + 5c6f123 commit d9c43b6

6 files changed

Lines changed: 236 additions & 281 deletions

File tree

arch/x86/include/asm/mce.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,14 @@ struct cper_ia_proc_ctx;
241241

242242
#ifdef CONFIG_X86_MCE
243243
int mcheck_init(void);
244+
void mca_bsp_init(struct cpuinfo_x86 *c);
244245
void mcheck_cpu_init(struct cpuinfo_x86 *c);
245246
void mcheck_cpu_clear(struct cpuinfo_x86 *c);
246247
int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info,
247248
u64 lapic_id);
248249
#else
249250
static inline int mcheck_init(void) { return 0; }
251+
static inline void mca_bsp_init(struct cpuinfo_x86 *c) {}
250252
static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
251253
static inline void mcheck_cpu_clear(struct cpuinfo_x86 *c) {}
252254
static inline int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info,
@@ -290,8 +292,7 @@ DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
290292
enum mcp_flags {
291293
MCP_TIMESTAMP = BIT(0), /* log time stamp */
292294
MCP_UC = BIT(1), /* log uncorrected errors */
293-
MCP_DONTLOG = BIT(2), /* only clear, don't log */
294-
MCP_QUEUE_LOG = BIT(3), /* only queue to genpool */
295+
MCP_QUEUE_LOG = BIT(2), /* only queue to genpool */
295296
};
296297

297298
void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
@@ -371,15 +372,9 @@ enum smca_bank_types {
371372

372373
extern bool amd_mce_is_memory_error(struct mce *m);
373374

374-
extern int mce_threshold_create_device(unsigned int cpu);
375-
extern int mce_threshold_remove_device(unsigned int cpu);
376-
377375
void mce_amd_feature_init(struct cpuinfo_x86 *c);
378376
enum smca_bank_types smca_get_bank_type(unsigned int cpu, unsigned int bank);
379377
#else
380-
381-
static inline int mce_threshold_create_device(unsigned int cpu) { return 0; };
382-
static inline int mce_threshold_remove_device(unsigned int cpu) { return 0; };
383378
static inline bool amd_mce_is_memory_error(struct mce *m) { return false; };
384379
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
385380
#endif

arch/x86/kernel/cpu/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
18081808
setup_clear_cpu_cap(X86_FEATURE_LA57);
18091809

18101810
detect_nopl();
1811+
mca_bsp_init(c);
18111812
}
18121813

18131814
void __init init_cpu_devs(void)

0 commit comments

Comments
 (0)