perf/x86: Fix uncore PCI fixed counter handling
perf/x86: Fix uncore PCI fixed counter handling

There was a bug in the handling of SNB-EP/IVB-EP uncore PCI
fixed counters, e.g., IMC.

It would cause erratic values to be returned for the IMC
clockticks event. This was due to a bogus hwc->config value
which was then written to PCI config space.

The erratic values can be seen via:

  $ perf stat -a -C 0 -e uncore_imc_0/clockticks/ -I 1000 sleep 10

The fixed counter has most fields marked as reserved with
hw reset values of 0. Yet the kernel was defaulting to a
hwc->config = ~0 and that was causing the issues.

This patch sets the hwc->config values for fixed uncore event
to 0. Now, the values of IMC clockticks is correct.

Signed-off-by: Stephane Eranian <f199ae9781930a5b94b284ca2f471140752002a7@google.com>
Reviewed-by: Andi Kleen <0474aee45985f5ae829f53849df476200e876990@linux.intel.com>
Cc: 3fddac958924aef220f202ca567388ddab3f14a8@infradead.org
Cc: 45e2ee8c8b09e76a9d512320d4eb53c0cd9925c0@intel.com
Link: 6c493e0b33d4909c165db2fa01e7ae6784703f68@google.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs