Re: [RFC PATCH] perf: honouring the cpuid for number of fixed counters in hypervisors

2016-10-16 Thread Peter Zijlstra
On Thu, Oct 13, 2016 at 01:28:09AM -0700, Imre Palik wrote: > + if (version > 1) { > + unsigned int ecx = cpuid_ecx(1); > + > + if (ecx >> 31) What is this magic, undocumented gunk doing? Is that supposed to be static_cpu_has(X86_FEATURE_HYPERVISOR) ?

Re: [RFC PATCH] perf: honouring the cpuid for number of fixed counters in hypervisors

2016-10-16 Thread Peter Zijlstra
On Thu, Oct 13, 2016 at 01:28:09AM -0700, Imre Palik wrote: > + if (version > 1) { > + unsigned int ecx = cpuid_ecx(1); > + > + if (ecx >> 31) What is this magic, undocumented gunk doing? Is that supposed to be static_cpu_has(X86_FEATURE_HYPERVISOR) ?

[RFC PATCH] perf: honouring the cpuid for number of fixed counters in hypervisors

2016-10-13 Thread Imre Palik
From: Imre Palik perf doesn't seem to honour the number of fixed counters specified by cpuid leaf 0xa. It always assume that Intel CPUs have at least 3 fixed counters. So if some of the fixed counters are masked out by the hypervisor, it still tries to check/set them. This

[RFC PATCH] perf: honouring the cpuid for number of fixed counters in hypervisors

2016-10-13 Thread Imre Palik
From: Imre Palik perf doesn't seem to honour the number of fixed counters specified by cpuid leaf 0xa. It always assume that Intel CPUs have at least 3 fixed counters. So if some of the fixed counters are masked out by the hypervisor, it still tries to check/set them. This patch makes perf