linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] perf/x86: Use KERN_INFO when checking PMU fails on virtual environment
@ 2014-09-25  3:55 Wei Huang
  2014-09-30  4:19 ` Wei Huang
  2014-10-03  5:28 ` [tip:perf/core] perf/x86: Tone down kernel messages when the PMU check fails in a " tip-bot for Wei Huang
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Huang @ 2014-09-25  3:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, tglx, mingo, hpa, Wei Huang

PMU checking can fail due to various reasons. On native machine,
this is mostly caused by faulty hardware and it is reasonable to
use KERN_ERR in reporting. However, when kernel is running on
virtualized environment, this checking can fail if virtual PMU is
not supported (e.g. KVM on AMD host). It is annoying to see
an error message on splash screen, even though we know such failure
is benign on virtualized environment.

This patch checks if kernel is running in virtualized environment.
If so, it will use KERN_INFO in reporting. This patch was tested
successfully on KVM.

Signed-off-by: Wei Huang <wei@redhat.com>
---
 arch/x86/kernel/cpu/perf_event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 918d75f..16c7302 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -243,7 +243,8 @@ static bool check_hw_exists(void)
 
 msr_fail:
 	printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
-	printk(KERN_ERR "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
+	printk(boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR
+	       "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
 
 	return false;
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-28 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25  3:55 [PATCH 1/1] perf/x86: Use KERN_INFO when checking PMU fails on virtual environment Wei Huang
2014-09-30  4:19 ` Wei Huang
2014-10-03  5:28 ` [tip:perf/core] perf/x86: Tone down kernel messages when the PMU check fails in a " tip-bot for Wei Huang
2014-10-06 21:10   ` Andy Lutomirski
2014-10-07 12:47     ` Peter Zijlstra
2014-10-28 11:08       ` [tip:perf/urgent] perf: Fix bogus kernel printk tip-bot for Peter Zijlstra (Intel)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).