Skip to content

Commit 158405e

Browse files
committed
Merge tag 'ras_core_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS updates from Borislav Petkov: - Get rid of a bunch of function pointers used in MCA land in favor of normal functions. This is in preparation of making the MCA code noinstr-aware - When the kernel copies data from user addresses and it encounters a machine check, a SIGBUS is sent to that process. Change this action to either an -EFAULT which is returned to the user or a short write, making the recovery action a lot more user-friendly * tag 'ras_core_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Sort mca_config members to get rid of unnecessary padding x86/mce: Get rid of the ->quirk_no_way_out() indirect call x86/mce: Get rid of msr_ops x86/mce: Get rid of machine_check_vector x86/mce: Get rid of the mce_severity function pointer x86/mce: Drop copyin special case for #MC x86/mce: Change to not send SIGBUS error during copy from user
2 parents 93351d2 + 1580246 commit 158405e

File tree

8 files changed

+161
-208
lines changed

8 files changed

+161
-208
lines changed

arch/x86/include/asm/mce.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,28 +205,16 @@ struct cper_ia_proc_ctx;
205205
int mcheck_init(void);
206206
void mcheck_cpu_init(struct cpuinfo_x86 *c);
207207
void mcheck_cpu_clear(struct cpuinfo_x86 *c);
208-
void mcheck_vendor_init_severity(void);
209208
int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info,
210209
u64 lapic_id);
211210
#else
212211
static inline int mcheck_init(void) { return 0; }
213212
static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
214213
static inline void mcheck_cpu_clear(struct cpuinfo_x86 *c) {}
215-
static inline void mcheck_vendor_init_severity(void) {}
216214
static inline int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info,
217215
u64 lapic_id) { return -EINVAL; }
218216
#endif
219217

220-
#ifdef CONFIG_X86_ANCIENT_MCE
221-
void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
222-
void winchip_mcheck_init(struct cpuinfo_x86 *c);
223-
static inline void enable_p5_mce(void) { mce_p5_enabled = 1; }
224-
#else
225-
static inline void intel_p5_mcheck_init(struct cpuinfo_x86 *c) {}
226-
static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {}
227-
static inline void enable_p5_mce(void) {}
228-
#endif
229-
230218
void mce_setup(struct mce *m);
231219
void mce_log(struct mce *m);
232220
DECLARE_PER_CPU(struct device *, mce_device);

arch/x86/kernel/cpu/mce/amd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static u32 get_block_address(u32 current_addr, u32 low, u32 high,
526526
/* Fall back to method we used for older processors: */
527527
switch (block) {
528528
case 0:
529-
addr = msr_ops.misc(bank);
529+
addr = mca_msr_reg(bank, MCA_MISC);
530530
break;
531531
case 1:
532532
offset = ((low & MASK_BLKPTR_LO) >> 21);
@@ -978,8 +978,8 @@ static void log_error_deferred(unsigned int bank)
978978
{
979979
bool defrd;
980980

981-
defrd = _log_error_bank(bank, msr_ops.status(bank),
982-
msr_ops.addr(bank), 0);
981+
defrd = _log_error_bank(bank, mca_msr_reg(bank, MCA_STATUS),
982+
mca_msr_reg(bank, MCA_ADDR), 0);
983983

984984
if (!mce_flags.smca)
985985
return;
@@ -1009,7 +1009,7 @@ static void amd_deferred_error_interrupt(void)
10091009

10101010
static void log_error_thresholding(unsigned int bank, u64 misc)
10111011
{
1012-
_log_error_bank(bank, msr_ops.status(bank), msr_ops.addr(bank), misc);
1012+
_log_error_bank(bank, mca_msr_reg(bank, MCA_STATUS), mca_msr_reg(bank, MCA_ADDR), misc);
10131013
}
10141014

10151015
static void log_and_reset_block(struct threshold_block *block)
@@ -1397,7 +1397,7 @@ static int threshold_create_bank(struct threshold_bank **bp, unsigned int cpu,
13971397
}
13981398
}
13991399

1400-
err = allocate_threshold_blocks(cpu, b, bank, 0, msr_ops.misc(bank));
1400+
err = allocate_threshold_blocks(cpu, b, bank, 0, mca_msr_reg(bank, MCA_MISC));
14011401
if (err)
14021402
goto out_kobj;
14031403

0 commit comments

Comments
 (0)