Skip to content

Commit 90454e4

Browse files
schnhrrsuryasaimadhu
authored andcommitted
x86/mce: Fix mce=nobootlog
Since commit 8b38937 ("x86/mce: Do not enter deferred errors into the generic pool twice") the mce=nobootlog option has become mostly ineffective (after being only slightly ineffective before), as the code is taking actions on MCEs left over from boot when they have a usable address. Move the check for MCP_DONTLOG a bit outward to make it effective again. Also, since commit 011d826 ("RAS: Add a Corrected Errors Collector") the two branches of the remaining "if" at the bottom of machine_check_poll() do same. Unify them. Signed-off-by: Jan H. Schönherr <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8438b84 commit 90454e4

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -755,26 +755,22 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
755755
log_it:
756756
error_seen = true;
757757

758-
mce_read_aux(&m, i);
758+
if (flags & MCP_DONTLOG)
759+
goto clear_it;
759760

761+
mce_read_aux(&m, i);
760762
m.severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
761-
762763
/*
763764
* Don't get the IP here because it's unlikely to
764765
* have anything to do with the actual error location.
765766
*/
766-
if (!(flags & MCP_DONTLOG) && !mca_cfg.dont_log_ce)
767-
mce_log(&m);
768-
else if (mce_usable_address(&m)) {
769-
/*
770-
* Although we skipped logging this, we still want
771-
* to take action. Add to the pool so the registered
772-
* notifiers will see it.
773-
*/
774-
if (!mce_gen_pool_add(&m))
775-
mce_schedule_work();
776-
}
777767

768+
if (mca_cfg.dont_log_ce && !mce_usable_address(&m))
769+
goto clear_it;
770+
771+
mce_log(&m);
772+
773+
clear_it:
778774
/*
779775
* Clear state for this bank.
780776
*/

0 commit comments

Comments
 (0)