Skip to content

Commit

Permalink
x86/MCE, xen/mcelog: Make /dev/mcelog registration messages more precise
Browse files Browse the repository at this point in the history
When running under Xen as dom0, /dev/mcelog is being provided by Xen
instead of the normal mcelog character device of the MCE core. Convert
an error message being issued by the MCE core in this case to an
informative message that Xen has registered the device.

Signed-off-by: Juergen Gross <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: Tony Luck <[email protected]>
Cc: linux-edac <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
  • Loading branch information
jgross1 authored and KAGA-KOKO committed Jun 20, 2017
1 parent 6057077 commit b867059
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/x86/kernel/cpu/mcheck/dev-mcelog.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,15 @@ static __init int dev_mcelog_init_device(void)
/* register character device /dev/mcelog */
err = misc_register(&mce_chrdev_device);
if (err) {
pr_err("Unable to init device /dev/mcelog (rc: %d)\n", err);
if (err == -EBUSY)
/* Xen dom0 might have registered the device already. */
pr_info("Unable to init device /dev/mcelog, already registered");
else
pr_err("Unable to init device /dev/mcelog (rc: %d)\n", err);

return err;
}

mce_register_decode_chain(&dev_mcelog_nb);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/xen/mcelog.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ static int __init xen_late_init_mcelog(void)
if (ret)
goto deregister;

pr_info("/dev/mcelog registered by Xen\n");

return 0;

deregister:
Expand Down

0 comments on commit b867059

Please sign in to comment.