From: Juergen Gross Date: Tue, 2 Aug 2016 07:22:12 +0000 (+0200) Subject: xen: Make VPMU init message look less scary X-Git-Tag: v4.1.12-102.0.20170601_1400~213^2~24^2~43 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5492365bfaca1695f6c3ea6a753935ddcbe0ebe7;p=users%2Fjedix%2Flinux-maple.git xen: Make VPMU init message look less scary 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 or ENOSYS when trying to activate VPMU. Signed-off-by: Juergen Gross Signed-off-by: David Vrabel OraBug: 25497392 (cherry picked from commit 0252937a87e1d46a8261da85cbd99dffe612a2d3) Signed-off-by: Boris Ostrovsky --- diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c index 04c2551c08015..3896a7fe9c433 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 || err == -ENOSYS) + 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); }