From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host Date: Sat, 22 Mar 2014 10:50:45 +0200 Message-ID: <20140322085045.GA5535@minantech.com> References: <4055058.qLAukpngnj@al> <1834280.dSicCcN9uU@al> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Peter Wu , Peter Zijlstra , Ingo Molnar , Andi Kleen , Linux Kernel Developers List , "H. Peter Anvin" , kvm@vger.kernel.org, Paolo Bonzini To: Venkatesh Srinivas Return-path: Received: from mail-ee0-f47.google.com ([74.125.83.47]:46614 "EHLO mail-ee0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbaCVIuv (ORCPT ); Sat, 22 Mar 2014 04:50:51 -0400 Received: by mail-ee0-f47.google.com with SMTP id b15so2567613eek.6 for ; Sat, 22 Mar 2014 01:50:50 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Mar 21, 2014 at 12:04:32PM -0700, Venkatesh Srinivas wrote: > On Fri, Mar 21, 2014 at 10:46 AM, Peter Wu wrote: [skip] > When -cpu host is used, qemu/kvm passed the host CPUID F/M/S to the > guest. intel_pmu_cpu_*() -> intel_pmu_lbr_reset() uses rdmsr() / > wrmsr(), rather than the safe variants; if KVM does not support the > particular MSRs in question, you will see a #GP(0) there. See > https://lkml.org/lkml/2014/3/13/453 for a similar bug other PMU code. > When kernel is compiled with guest support all rdmsr()/wrmsr() become _safe(), so the question for Peter is if his guest kernel has guest support enabled? -- Gleb.