Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-26 Thread Paolo Bonzini
Il 26/03/2014 08:23, Wu, Feng ha scritto: Is there a solution for this issue right now? I also met this GPF crash. Can you attach your .config? Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo

RE: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-26 Thread Wu, Feng
st; H. Peter Anvin; k...@vger.kernel.org; Paolo Bonzini > Subject: Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host > > On Saturday 22 March 2014 14:27:59 Gleb Natapov wrote: > > > but now I have a NULL dereference (in rapl_pmu_init). Previously, when > > > `-cpu San

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread Peter Wu
On Saturday 22 March 2014 14:27:59 Gleb Natapov wrote: > > but now I have a NULL dereference (in rapl_pmu_init). Previously, when > > `-cpu SandyBridge` was passed to qemu, it would show this: > > > > [0.016995] Performance Events: unsupported p6 CPU model 42 no PMU > > driver, software e

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread H. Peter Anvin
Using _safe has it's own issues if noone checks the errors. On March 22, 2014 5:27:59 AM PDT, Gleb Natapov wrote: >On Sat, Mar 22, 2014 at 11:05:03AM +0100, Peter Wu wrote: >> On Saturday 22 March 2014 10:50:45 Gleb Natapov wrote: >> > On Fri, Mar 21, 2014 at 12:04:32PM -0700, Venkatesh Srinivas

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread Gleb Natapov
On Sat, Mar 22, 2014 at 11:05:03AM +0100, Peter Wu wrote: > On Saturday 22 March 2014 10:50:45 Gleb Natapov wrote: > > 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

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread Peter Wu
On Saturday 22 March 2014 10:50:45 Gleb Natapov wrote: > 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_*() -> int

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread Borislav Petkov
On Fri, Mar 21, 2014 at 05:34:26PM -0700, H. Peter Anvin wrote: > It's not just KVM, though. Right, there's also hw models which don't have a certain MSR all of a sudden. And yeah yeah, it is architectural so it must be there, yadda, yadda, we've heard all that already. But we want to be defensive

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread Gleb Natapov
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 v

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-22 Thread Paolo Bonzini
Il 21/03/2014 20:09, H. Peter Anvin ha scritto: Calling this a bug in the PMU code is ridiculous. If KVM tells the system it os a specific vendor-family-model-stepping but diverges in behavior then it, by definition, is broken. Yeah, this is true. On AMD there is processor support for virtual

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
On 03/21/2014 05:30 PM, Andi Kleen wrote: > > % grep -r 'rdmsr' arch/x86/* | grep -v safe | wc -l > 285 > > I assume it'll keep you all busy for a while. > > [compared to a likely one liner in KVM] > It's not just KVM, though. -hpa -- To unsubscribe from this list: send the line "

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Andi Kleen
On Fri, Mar 21, 2014 at 05:26:17PM -0700, H. Peter Anvin wrote: > On 03/21/2014 05:22 PM, Andi Kleen wrote: > >> Actually, Ingo, Borislav and I have been discussing making rdmsr_safe() > >> more of the default, especially for things like this where the error > >> handling is obvious (doesn't work?

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
On 03/21/2014 05:22 PM, Andi Kleen wrote: >> Actually, Ingo, Borislav and I have been discussing making rdmsr_safe() >> more of the default, especially for things like this where the error >> handling is obvious (doesn't work? Disable the PMU.) > > That would be completely wrong. KVM has a full a

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Andi Kleen
> Actually, Ingo, Borislav and I have been discussing making rdmsr_safe() > more of the default, especially for things like this where the error > handling is obvious (doesn't work? Disable the PMU.) That would be completely wrong. KVM has a full architectural perfmon PMU, just no model specific

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
On 03/21/2014 02:48 PM, Andi Kleen wrote: > "H. Peter Anvin" writes: >> >> That's why at least to some extent The Right Thing is not to try to >> pretend to be a CPU you don't even know how to emulate. >> >> But again, that has its own issues, too, mostly with userspace >> optimization, and making

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Andi Kleen
"H. Peter Anvin" writes: > > That's why at least to some extent The Right Thing is not to try to > pretend to be a CPU you don't even know how to emulate. > > But again, that has its own issues, too, mostly with userspace > optimization, and making the Linux code more resilient wouldn't hurt. > In

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
On 03/21/2014 02:37 PM, Andi Kleen wrote: > On Fri, Mar 21, 2014 at 01:46:04PM -0700, H. Peter Anvin wrote: >> Not really. That is equally braindamaged. The problem is that KVM is >> telling the host that our is something it simply cannot be. > > Well it has to pick something. It's unlikely it

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Andi Kleen
On Fri, Mar 21, 2014 at 01:46:04PM -0700, H. Peter Anvin wrote: > Not really. That is equally braindamaged. The problem is that KVM is > telling the host that our is something it simply cannot be. Well it has to pick something. It's unlikely it will ever implement 100% of that particular CPU.

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
Not really. That is equally braindamaged. The problem is that KVM is telling the host that our is something it simply cannot be. On March 21, 2014 12:29:38 PM PDT, Andi Kleen wrote: >On Fri, Mar 21, 2014 at 06:42:40PM +0100, Peter Wu wrote: >> Hi, >> >> While trying to run QEMU with `-enable-

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Andi Kleen
On Fri, Mar 21, 2014 at 06:42:40PM +0100, Peter Wu wrote: > Hi, > > While trying to run QEMU with `-enable-kvm -host cpu`, I get a GPF in > intel_pmu_lbr_reset(): Same problem as the RAPL problem earlier. KVM is lying to the guest that it is a host CPU, but not implementing all MSRs the host CPU

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
Calling this a bug in the PMU code is ridiculous. If KVM tells the system it os a specific vendor-family-model-stepping but diverges in behavior then it, by definition, is broken. On March 21, 2014 12:04:32 PM PDT, Venkatesh Srinivas wrote: >On Fri, Mar 21, 2014 at 10:46 AM, Peter Wu wrote:

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Venkatesh Srinivas
On Fri, Mar 21, 2014 at 10:46 AM, Peter Wu wrote: > cc'ing kvm people and list. > > On Friday 21 March 2014 18:42:40 Peter Wu wrote: >> Hi, >> >> While trying to run QEMU with `-enable-kvm -host cpu`, I get a GPF in >> intel_pmu_lbr_reset(): >> >> [0.024000] general protection fault: [#1]

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Peter Wu
cc'ing kvm people and list. On Friday 21 March 2014 18:42:40 Peter Wu wrote: > Hi, > > While trying to run QEMU with `-enable-kvm -host cpu`, I get a GPF in > intel_pmu_lbr_reset(): > > [0.024000] general protection fault: [#1] > [0.024000] CPU: 0 PID: 1 Comm: swapper Not tainted

GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Peter Wu
Hi, While trying to run QEMU with `-enable-kvm -host cpu`, I get a GPF in intel_pmu_lbr_reset(): [0.024000] general protection fault: [#1] [0.024000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.0-rc7-qemu-00059-g08edb33 #14 [0.024000] Hardware name: Bochs Bochs, BIOS Bochs 01/