perf/x86/intel/uncore: Add event constraint for BDX PCU

Event select bit 7 'Use Occupancy' in PCU Box is not available for
counter 0 on BDX

Add a constraint to fix it.

Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: peterz@infradead.org
Cc: ak@linux.intel.com
Link: https://lkml.kernel.org/r/1510668400-301000-1-git-send-email-kan.liang@intel.com

authored by Kan Liang and committed by Thomas Gleixner bb9fbe1b 58ba4d5a

+8
+8
arch/x86/events/intel/uncore_snbep.c
··· 3035 3035 NULL, 3036 3036 }; 3037 3037 3038 + /* Bit 7 'Use Occupancy' is not available for counter 0 on BDX */ 3039 + static struct event_constraint bdx_uncore_pcu_constraints[] = { 3040 + EVENT_CONSTRAINT(0x80, 0xe, 0x80), 3041 + EVENT_CONSTRAINT_END 3042 + }; 3043 + 3038 3044 void bdx_uncore_cpu_init(void) 3039 3045 { 3040 3046 if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) 3041 3047 bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; 3042 3048 uncore_msr_uncores = bdx_msr_uncores; 3049 + 3050 + hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints; 3043 3051 } 3044 3052 3045 3053 static struct intel_uncore_type bdx_uncore_ha = {