Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757569Ab2HUMzZ (ORCPT ); Tue, 21 Aug 2012 08:55:25 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:56725 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757518Ab2HUMzV (ORCPT ); Tue, 21 Aug 2012 08:55:21 -0400 MIME-Version: 1.0 In-Reply-To: <1345540117-14164-1-git-send-email-zheng.z.yan@intel.com> References: <1345540117-14164-1-git-send-email-zheng.z.yan@intel.com> Date: Tue, 21 Aug 2012 15:55:19 +0300 X-Google-Sender-Auth: iFy1i9pR5OT1EtMGvNOZxXu5r6A Message-ID: Subject: Re: [PATCH] perf/x86: Disable uncore on virtualized CPU. From: Pekka Enberg To: "Yan, Zheng" Cc: a.p.zijlstra@chello.nl, eranian@google.com, mingo@elte.hu, andi@firstfloor.org, avi@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1398 Lines: 34 On Tue, Aug 21, 2012 at 12:08 PM, Yan, Zheng wrote: > From: "Yan, Zheng" > > 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 > --- > 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; Tested-by: Pekka Enberg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/