perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs
authorOskar Senft <osk@google.com>
Fri, 23 Mar 2018 13:11:30 +0000 (09:11 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 20 Apr 2018 11:17:50 +0000 (13:17 +0200)
commit15a3e845b01ce2342cf187dc123c92c44c3c8170
treee06952a1062144a3a26001e74f4a347216499485
parentd7717587ac6deae00e0b66c0113a046be2c6fb1c
perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs

SBOX on some Broadwell CPUs is broken because it's enabled unconditionally
despite the fact that there are no SBOXes available.

Check the Power Control Unit CAPID4 register to determine the number of
available SBOXes on the particular CPU before trying to enable them. If
there are none, nullify the SBOX descriptor so it isn't tried to be
initialized.

Signed-off-by: Oskar Senft <osk@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Mark van Dijk <mark@voidzero.net>
Reviewed-by: Kan Liang <kan.liang@intel.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: ak@linux.intel.com
Cc: peterz@infradead.org
Cc: eranian@google.com
Link: https://lkml.kernel.org/r/1521810690-2576-2-git-send-email-kan.liang@linux.intel.com
arch/x86/events/intel/uncore_snbep.c