linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/x86: Disable uncore on virtualized CPU.
@ 2012-08-21  9:08 Yan, Zheng
  2012-08-21 12:55 ` Pekka Enberg
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Yan, Zheng @ 2012-08-21  9:08 UTC (permalink / raw)
  To: a.p.zijlstra, eranian, mingo, andi, avi, linux-kernel; +Cc: Yan, Zheng

From: "Yan, Zheng" <zheng.z.yan@intel.com>

Initializing uncore PMU on virtualized CPU may hang the kernel.
This is because kvm does not emulate the entire hardware. Thers
are lots of uncore related MSRs, making kvm enumerate them all
is a non-trival task. So just disable uncore on virtualized CPU.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 0a55710..2f005ba 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -2898,6 +2898,9 @@ static int __init intel_uncore_init(void)
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
 		return -ENODEV;
 
+	if (cpu_has_hypervisor)
+		return -ENODEV;
+
 	ret = uncore_pci_init();
 	if (ret)
 		goto fail;
-- 
1.7.11.2


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

end of thread, other threads:[~2012-10-20  8:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21  9:08 [PATCH] perf/x86: Disable uncore on virtualized CPU Yan, Zheng
2012-08-21 12:55 ` Pekka Enberg
2012-08-31  7:12   ` Pekka Enberg
2012-08-21 14:31 ` Andi Kleen
2012-08-21 14:42   ` Pekka Enberg
2012-09-05  6:35 ` Ingo Molnar
2012-09-05  8:47   ` Peter Zijlstra
2012-09-05  9:08     ` Ingo Molnar
2012-09-05 18:52   ` Andi Kleen
2012-10-20  8:23 ` [tip:perf/urgent] perf/x86: Disable uncore on virtualized CPUs tip-bot for Yan, Zheng

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).