linux 3.13 guest crash with -cpu host

2014-02-02 Thread Michael S. Tsirkin
I observe this with guest 3.13 and host 3.13 when running with -cpu host on my laptop: [0.043000] Call Trace: [0.043000] [] init_hw_perf_events+0x33/0x5cd [0.043000] [] ? check_bugs+0x40/0x40 [0.043000] [] do_one_initcall+0x13a/0x190 [0.043000] [] ? native_smp_prepare_cpus+

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Eduardo Habkost
On Sun, Feb 02, 2014 at 10:59:30PM +0200, Michael S. Tsirkin wrote: > I observe this with guest 3.13 and host 3.13 > when running with -cpu host on my laptop: > > [0.043000] Call Trace: > [0.043000] [] init_hw_perf_events+0x33/0x5cd > [0.043000] [] ? check_bugs+0x40/0x40 > [0.043

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Peter Zijlstra
On Mon, Feb 03, 2014 at 10:58:28AM -0200, Eduardo Habkost wrote: > Linux seems to be trying to read IA32_PERF_CAPABILITIES without checking the > PDCM flag (CPUID[1].ECX[15]). > > I can't see why this wasn't crashing before, though. That code seems to be > old. > >* v2 and above have a p

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Michael S. Tsirkin
On Mon, Feb 03, 2014 at 10:58:28AM -0200, Eduardo Habkost wrote: > On Sun, Feb 02, 2014 at 10:59:30PM +0200, Michael S. Tsirkin wrote: > > I observe this with guest 3.13 and host 3.13 > > when running with -cpu host on my laptop: > > > > [0.043000] Call Trace: > > [0.043000] [] init_hw_pe

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Paolo Bonzini
Il 03/02/2014 15:06, Michael S. Tsirkin ha scritto: Linux seems to be trying to read IA32_PERF_CAPABILITIES without checking the PDCM flag (CPUID[1].ECX[15]). I can't see why this wasn't crashing before, though. That code seems to be old. * v2 and above have a perf capabilities MSR

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Peter Zijlstra
On Mon, Feb 03, 2014 at 04:06:01PM +0200, Michael S. Tsirkin wrote: > On Mon, Feb 03, 2014 at 10:58:28AM -0200, Eduardo Habkost wrote: > > Where does the "v2 and above have a perf capabilities MSR" claim in the code > > come from? > > > But why doesn't it crash on baremetal? > Probably baremetal

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Paolo Bonzini
Il 03/02/2014 15:12, Peter Zijlstra ha scritto: > But why doesn't it crash on baremetal? > Probably baremetal simply returns 0 or something. > Let me try .. The claim "v2 and above have FEATURE_PDCM" is in fact true for real hardware. If it didn't the rdmsr() would have generated an exception a

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Peter Zijlstra
On Mon, Feb 03, 2014 at 03:19:18PM +0100, Paolo Bonzini wrote: > Il 03/02/2014 15:12, Peter Zijlstra ha scritto: > >>> But why doesn't it crash on baremetal? > >>> Probably baremetal simply returns 0 or something. > >>> Let me try .. > >The claim "v2 and above have FEATURE_PDCM" is in fact true for

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Peter Zijlstra
On Mon, Feb 03, 2014 at 03:26:42PM +0100, Peter Zijlstra wrote: > On Mon, Feb 03, 2014 at 03:19:18PM +0100, Paolo Bonzini wrote: > > Il 03/02/2014 15:12, Peter Zijlstra ha scritto: > > >>> But why doesn't it crash on baremetal? > > >>> Probably baremetal simply returns 0 or something. > > >>> Let m

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Michael S. Tsirkin
On Mon, Feb 03, 2014 at 03:07:33PM +0100, Paolo Bonzini wrote: > Il 03/02/2014 15:06, Michael S. Tsirkin ha scritto: > >>Linux seems to be trying to read IA32_PERF_CAPABILITIES without checking the > >>PDCM flag (CPUID[1].ECX[15]). > >> > >>I can't see why this wasn't crashing before, though. That

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Michael S. Tsirkin
On Mon, Feb 03, 2014 at 03:26:42PM +0100, Peter Zijlstra wrote: > On Mon, Feb 03, 2014 at 03:19:18PM +0100, Paolo Bonzini wrote: > > Il 03/02/2014 15:12, Peter Zijlstra ha scritto: > > >>> But why doesn't it crash on baremetal? > > >>> Probably baremetal simply returns 0 or something. > > >>> Let m

Re: linux 3.13 guest crash with -cpu host

2014-02-03 Thread Paolo Bonzini
Il 03/02/2014 15:28, Peter Zijlstra ha scritto: > > Right, and the virt thingy has no PEBS, so there is no correct value that we > > could return from the MSR. That's why the CPUID bit is zero. > > There's more than PEBS in there, there's also the LBR format (which you > obviously also don't ha