From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752305AbcHBGrX (ORCPT ); Tue, 2 Aug 2016 02:47:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:53357 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbcHBGrW (ORCPT ); Tue, 2 Aug 2016 02:47:22 -0400 From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com, david.vrabel@citrix.com, Juergen Gross Subject: [PATCH v2] xen: Make VPMU init message look less scary Date: Tue, 2 Aug 2016 08:43:33 +0200 Message-Id: <1470120213-16683-1-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.6.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The default for the Xen hypervisor is to not enable VPMU in order to avoid security issues. In this case the Linux kernel will issue the message "Could not initialize VPMU for cpu 0, error -95" which looks more like an error than a normal state. Change the message to something less scary in case the hypervisor returns EOPNOTSUPP when trying to activate VPMU. Signed-off-by: Juergen Gross --- V2: modify error message as suggested by Konrad Wilk --- arch/x86/xen/pmu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c index 32bdc2c..bfe8880 100644 --- a/arch/x86/xen/pmu.c +++ b/arch/x86/xen/pmu.c @@ -547,8 +547,11 @@ void xen_pmu_init(int cpu) return; fail: - pr_info_once("Could not initialize VPMU for cpu %d, error %d\n", - cpu, err); + if (err == -EOPNOTSUPP) + pr_info_once("VPMU disabled by hypervisor.\n"); + else + pr_info_once("Could not initialize VPMU for cpu %d, error %d\n", + cpu, err); free_pages((unsigned long)xenpmu_data, 0); } -- 2.6.6