From patchwork Tue Jun 20 21:16:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 9800291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A3D5600F5 for ; Tue, 20 Jun 2017 21:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0241E28426 for ; Tue, 20 Jun 2017 21:20:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC9AF22638; Tue, 20 Jun 2017 21:20:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 37A5728504 for ; Tue, 20 Jun 2017 21:20:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNQWH-0003o2-Kd; Tue, 20 Jun 2017 21:17:05 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNQWG-0003ns-IJ for xen-devel@lists.xenproject.org; Tue, 20 Jun 2017 21:17:04 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 3C/E3-02180-FC099495; Tue, 20 Jun 2017 21:17:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRWlGSWpSXmKPExsXCytl5VPf8BM9 Ig03XJCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozDF2eyFNzjq/j+6yRrA+Npni5GDg4JAV2J N306XYxcHEICWxklrj3/xQjh3GeSuPv8LGsXIycHm4CKxNIzt5hAbBEBaYnZz/axghQxC0xhl Fj6dR07yCRhgUiJ2+cCQGpYBFQlvsw7BlbPK2Ag0XjyOhuILSEgL3HlVz/LBEauBYwMqxjVi1 OLylKLdE31kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzECvcgABDsYv/Q7H2KU5GB SEuXNqfCMFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBq9UPlBMsSk1PrUjLzAGGE0xagoNHSYT3 agtQmre4IDG3ODMdInWK0Zhjw+r1X5g47vRt+MIkxJKXn5cqJc77sg+oVACkNKM0D24QLMwvM cpKCfMyAp0mxFOQWpSbWYIq/4pRnINRSZjXC+Qensy8Erh9r4BOYQI65cURD5BTShIRUlINjE zhwSK3N3V8/a6/MJzh+3bFWFdLjfx5HZxTfXoWWteyLv544KXLvyd+uw0j5Xg3yvI7nN1qeEZ kd/DTd2WXnqQxOnHvOxvw7deNG5fetG9VXJ1TO1ukIuWUuZbl0phEi4K5S+b8balfenp/1Q+7 Mr0GVs/1u6+u9xB8s9XyU8i3ibuOf+Zb+0qJpTgj0VCLuag4EQAiQkNjbgIAAA== X-Env-Sender: bp@alien8.de X-Msg-Ref: server-7.tower-206.messagelabs.com!1497993423!101408043!1 X-Originating-IP: [5.9.137.197] X-SpamReason: No, hits=0.5 required=7.0 tests=MAILTO_TO_SPAM_ADDR, RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6612 invoked from network); 20 Jun 2017 21:17:03 -0000 Received: from mail.skyhub.de (HELO mail.skyhub.de) (5.9.137.197) by server-7.tower-206.messagelabs.com with SMTP; 20 Jun 2017 21:17:03 -0000 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vMURvlk2Xj5Q; Tue, 20 Jun 2017 23:17:02 +0200 (CEST) Received: from pd.tnic (p2003008C2F213F00F45CBC8D67F79E47.dip0.t-ipconnect.de [IPv6:2003:8c:2f21:3f00:f45c:bc8d:67f7:9e47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 9D0991EC0987; Tue, 20 Jun 2017 23:17:02 +0200 (CEST) From: Borislav Petkov To: X86 ML Date: Tue, 20 Jun 2017 23:16:37 +0200 Message-Id: <20170620211637.2590-1-bp@alien8.de> X-Mailer: git-send-email 2.13.0 Cc: xen-devel@lists.xenproject.org, Tony Luck , LKML , linux-edac Subject: [Xen-devel] [PATCH] x86/MCE, xen/mcelog: Make /dev/mcelog registration messages more precise X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Juergen Gross 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 Cc: Tony Luck Cc: linux-edac Cc: x86-ml Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/20170614084059.19294-1-jgross@suse.com [ Massage a bit. ] Signed-off-by: Borislav Petkov Reviewed-by: Ethan Zhao --- arch/x86/kernel/cpu/mcheck/dev-mcelog.c | 8 +++++++- drivers/xen/mcelog.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c index a80427c30c93..10cec43aac38 100644 --- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c @@ -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; } 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: