[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170613124921.12795-1-jgross@suse.com>
Date: Tue, 13 Jun 2017 14:49:21 +0200
From: Juergen Gross <jgross@...e.com>
To: linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
x86@...nel.org
Cc: boris.ostrovsky@...cle.com, hpa@...or.com, tglx@...utronix.de,
mingo@...hat.com, tony.luck@...el.com, bp@...en8.de,
Juergen Gross <jgross@...e.com>
Subject: [PATCH] xen/mce: don't issue error message for failed /dev/mcelog registration
When running under Xen as dom0 /dev/mcelog is being registered by Xen
instead of the normal mcelog driver. Avoid an error message being
issued by the mcelog driver in this case. Instead issue an informative
message that Xen has registered the device.
Signed-off-by: Juergen Gross <jgross@...e.com>
---
arch/x86/kernel/cpu/mcheck/dev-mcelog.c | 6 +++++-
drivers/xen/mcelog.c | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
index 9c632cb88546..43fbe2a70051 100644
--- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
+++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
@@ -14,6 +14,7 @@
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/poll.h>
+#include <xen/xen.h>
#include "mce-internal.h"
@@ -387,10 +388,13 @@ static __init int dev_mcelog_init_device(void)
/* register character device /dev/mcelog */
err = misc_register(&mce_chrdev_device);
- if (err) {
+ /* Xen dom0 might have registered the device already. */
+ if (err && (err != -EBUSY || !xen_initial_domain() ||
+ !IS_ENABLED(CONFIG_XEN_MCE_LOG))) {
pr_err("Unable to init device /dev/mcelog (rc: %d)\n", err);
return err;
}
+
mce_register_decode_chain(&dev_mcelog_nb);
return 0;
}
diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c
index a493c7315e94..6cc1c15bcd84 100644
--- a/drivers/xen/mcelog.c
+++ b/drivers/xen/mcelog.c
@@ -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:
--
2.12.3
Powered by blists - more mailing lists