Skip to content

Commit 0252937

Browse files
jgross1David Vrabel
authored andcommitted
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 <[email protected]> Signed-off-by: David Vrabel <[email protected]>
1 parent 5b00b50 commit 0252937

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/x86/xen/pmu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
547547
return;
548548

549549
fail:
550-
pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
551-
cpu, err);
550+
if (err == -EOPNOTSUPP || err == -ENOSYS)
551+
pr_info_once("VPMU disabled by hypervisor.\n");
552+
else
553+
pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
554+
cpu, err);
552555
free_pages((unsigned long)xenpmu_data, 0);
553556
}
554557

0 commit comments

Comments
 (0)