History

Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull RAS updates from Ingo Molnar: "The biggest change in this cycle was an enhancement by Yazen Ghannam to reduce the number of MCE error injection related IPIs. The rest are smaller fixes" * 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Fix mce_rdmsrl() warning message x86/RAS/AMD: Reduce the number of IPIs when prepping error injection x86/mce/AMD: Increase size of the bank_map type x86/mce: Do not use bank 1 for APEI generated error logs

Linus Torvalds committed 10 years ago

Commit 89e7eb02 parents c86ad14 38c54cc4 files · +31 −33Browse files

Unified · Split

4 files
  1. arch/x86/kernel/cpu/mcheck/mce-apei.c +1 −1
  2. arch/x86/kernel/cpu/mcheck/mce.c +1 −1
  3. arch/x86/kernel/cpu/mcheck/mce_amd.c +1 −1
  4. arch/x86/ras/mce_amd_inj.c +28 −30
arch/x86/kernel/cpu/mcheck/mce-apei.c+1−1
@@ -46,7 +46,7 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err) · 45 unmodified lines
46 return;46 return;
47 47
48 mce_setup(&m);48 mce_setup(&m);
49 m.bank = 1;49 m.bank = -1;
50 /* Fake a memory read error with unknown channel */50 /* Fake a memory read error with unknown channel */
51 m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f;51 m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f;
52 52
arch/x86/kernel/cpu/mcheck/mce.c+1−1
@@ -425,7 +425,7 @@ static u64 mce_rdmsrl(u32 msr) · 424 unmodified lines
425 }425 }
426 426
427 if (rdmsrl_safe(msr, &v)) {427 if (rdmsrl_safe(msr, &v)) {
428 WARN_ONCE(1, "mce: Unable to read msr %d!\n", msr);428 WARN_ONCE(1, "mce: Unable to read MSR 0x%x!\n", msr);
429 /*429 /*
430 * Return zero in case the access faulted. This should430 * Return zero in case the access faulted. This should
431 * not happen normally but can happen if the CPU does431 * not happen normally but can happen if the CPU does
arch/x86/kernel/cpu/mcheck/mce_amd.c+1−1
@@ -93,7 +93,7 @@ const char * const amd_df_mcablock_names[] = { · 92 unmodified lines
93EXPORT_SYMBOL_GPL(amd_df_mcablock_names);93EXPORT_SYMBOL_GPL(amd_df_mcablock_names);
94 94
95static DEFINE_PER_CPU(struct threshold_bank **, threshold_banks);95static DEFINE_PER_CPU(struct threshold_bank **, threshold_banks);
96static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */96static DEFINE_PER_CPU(unsigned int, bank_map); /* see which banks are on */
97 97
98static void amd_threshold_interrupt(void);98static void amd_threshold_interrupt(void);
99static void amd_deferred_error_interrupt(void);99static void amd_deferred_error_interrupt(void);
arch/x86/ras/mce_amd_inj.c+28−30
@@ -241,6 +241,31 @@ static void toggle_nb_mca_mst_cpu(u16 nid) · 240 unmodified lines
241 __func__, PCI_FUNC(F3->devfn), NBCFG);241 __func__, PCI_FUNC(F3->devfn), NBCFG);
242}242}
243 243
244static void prepare_msrs(void *info)
245{
246 struct mce i_mce = *(struct mce *)info;
247 u8 b = i_mce.bank;
248
249 wrmsrl(MSR_IA32_MCG_STATUS, i_mce.mcgstatus);
250
251 if (boot_cpu_has(X86_FEATURE_SMCA)) {
252 if (i_mce.inject_flags == DFR_INT_INJ) {
253 wrmsrl(MSR_AMD64_SMCA_MCx_DESTAT(b), i_mce.status);
254 wrmsrl(MSR_AMD64_SMCA_MCx_DEADDR(b), i_mce.addr);
255 } else {
256 wrmsrl(MSR_AMD64_SMCA_MCx_STATUS(b), i_mce.status);
257 wrmsrl(MSR_AMD64_SMCA_MCx_ADDR(b), i_mce.addr);
258 }
259
260 wrmsrl(MSR_AMD64_SMCA_MCx_MISC(b), i_mce.misc);
261 } else {
262 wrmsrl(MSR_IA32_MCx_STATUS(b), i_mce.status);
263 wrmsrl(MSR_IA32_MCx_ADDR(b), i_mce.addr);
264 wrmsrl(MSR_IA32_MCx_MISC(b), i_mce.misc);
265 }
266
267}
268
244static void do_inject(void)269static void do_inject(void)
245{270{
246 u64 mcg_status = 0;271 u64 mcg_status = 0;
@@ -287,36 +312,9 @@ static void do_inject(void) · 40 unmodified lines
287 312
288 toggle_hw_mce_inject(cpu, true);313 toggle_hw_mce_inject(cpu, true);
289 314
290 wrmsr_on_cpu(cpu, MSR_IA32_MCG_STATUS,315 i_mce.mcgstatus = mcg_status;
291 (u32)mcg_status, (u32)(mcg_status >> 32));316 i_mce.inject_flags = inj_type;
292 317 smp_call_function_single(cpu, prepare_msrs, &i_mce, 0);
293 if (boot_cpu_has(X86_FEATURE_SMCA)) {
294 if (inj_type == DFR_INT_INJ) {
295 wrmsr_on_cpu(cpu, MSR_AMD64_SMCA_MCx_DESTAT(b),
296 (u32)i_mce.status, (u32)(i_mce.status >> 32));
297
298 wrmsr_on_cpu(cpu, MSR_AMD64_SMCA_MCx_DEADDR(b),
299 (u32)i_mce.addr, (u32)(i_mce.addr >> 32));
300 } else {
301 wrmsr_on_cpu(cpu, MSR_AMD64_SMCA_MCx_STATUS(b),
302 (u32)i_mce.status, (u32)(i_mce.status >> 32));
303
304 wrmsr_on_cpu(cpu, MSR_AMD64_SMCA_MCx_ADDR(b),
305 (u32)i_mce.addr, (u32)(i_mce.addr >> 32));
306 }
307
308 wrmsr_on_cpu(cpu, MSR_AMD64_SMCA_MCx_MISC(b),
309 (u32)i_mce.misc, (u32)(i_mce.misc >> 32));
310 } else {
311 wrmsr_on_cpu(cpu, MSR_IA32_MCx_STATUS(b),
312 (u32)i_mce.status, (u32)(i_mce.status >> 32));
313
314 wrmsr_on_cpu(cpu, MSR_IA32_MCx_ADDR(b),
315 (u32)i_mce.addr, (u32)(i_mce.addr >> 32));
316
317 wrmsr_on_cpu(cpu, MSR_IA32_MCx_MISC(b),
318 (u32)i_mce.misc, (u32)(i_mce.misc >> 32));
319 }
320 318
321 toggle_hw_mce_inject(cpu, false);319 toggle_hw_mce_inject(cpu, false);
322 320

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t