Skip to content

Commit 1467b49

Browse files
committed
Merge tag 'ras_core_for_v6.11_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS updates from Borislav Petkov: - A cleanup and a correction to the error injection driver to inject a MCA_MISC value only when one has actually been supplied by the user * tag 'ras_core_for_v6.11_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Remove unused variable and return value in machine_check_poll() x86/mce/inject: Only write MCA_MISC when a value has been supplied
2 parents 8028e29 + 5b9d292 commit 1467b49

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

arch/x86/include/asm/mce.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ enum mcp_flags {
261261
MCP_DONTLOG = BIT(2), /* only clear, don't log */
262262
MCP_QUEUE_LOG = BIT(3), /* only queue to genpool */
263263
};
264-
bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
264+
265+
void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
265266

266267
int mce_notify_irq(void);
267268

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,9 @@ DEFINE_PER_CPU(unsigned, mce_poll_count);
677677
* is already totally * confused. In this case it's likely it will
678678
* not fully execute the machine check handler either.
679679
*/
680-
bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
680+
void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
681681
{
682682
struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);
683-
bool error_seen = false;
684683
struct mce m;
685684
int i;
686685

@@ -754,8 +753,6 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
754753
continue;
755754

756755
log_it:
757-
error_seen = true;
758-
759756
if (flags & MCP_DONTLOG)
760757
goto clear_it;
761758

@@ -787,8 +784,6 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
787784
*/
788785

789786
sync_core();
790-
791-
return error_seen;
792787
}
793788
EXPORT_SYMBOL_GPL(machine_check_poll);
794789

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,16 @@ static void prepare_msrs(void *info)
487487
wrmsrl(MSR_AMD64_SMCA_MCx_ADDR(b), m.addr);
488488
}
489489

490-
wrmsrl(MSR_AMD64_SMCA_MCx_MISC(b), m.misc);
491490
wrmsrl(MSR_AMD64_SMCA_MCx_SYND(b), m.synd);
491+
492+
if (m.misc)
493+
wrmsrl(MSR_AMD64_SMCA_MCx_MISC(b), m.misc);
492494
} else {
493495
wrmsrl(MSR_IA32_MCx_STATUS(b), m.status);
494496
wrmsrl(MSR_IA32_MCx_ADDR(b), m.addr);
495-
wrmsrl(MSR_IA32_MCx_MISC(b), m.misc);
497+
498+
if (m.misc)
499+
wrmsrl(MSR_IA32_MCx_MISC(b), m.misc);
496500
}
497501
}
498502

0 commit comments

Comments
 (0)