From: Alexander Antonov Date: Thu, 17 Nov 2022 12:28:26 +0000 (+0000) Subject: perf/x86/intel/uncore: Disable I/O stacks to PMU mapping on ICX-D X-Git-Tag: v6.2-rc1~176^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efe062705d149b20a15498cb999a9edbb8241e6f;p=thirdparty%2Fkernel%2Flinux.git perf/x86/intel/uncore: Disable I/O stacks to PMU mapping on ICX-D Current implementation of I/O stacks to PMU mapping doesn't support ICX-D. Detect ICX-D system to disable mapping. Fixes: 10337e95e04c ("perf/x86/intel/uncore: Enable I/O stacks to IIO PMON mapping on ICX") Signed-off-by: Alexander Antonov Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221117122833.3103580-5-alexander.antonov@linux.intel.com --- diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h index ef14149576238..fac3612289f1a 100644 --- a/arch/x86/events/intel/uncore.h +++ b/arch/x86/events/intel/uncore.h @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 0d06b56b8a33a..e14b963983777 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -5226,6 +5226,11 @@ static int icx_iio_get_topology(struct intel_uncore_type *type) static int icx_iio_set_mapping(struct intel_uncore_type *type) { + /* Detect ICX-D system. This case is not supported */ + if (boot_cpu_data.x86_model == INTEL_FAM6_ICELAKE_D) { + pmu_clear_mapping_attr(type->attr_update, &icx_iio_mapping_group); + return -EPERM; + } return pmu_iio_set_mapping(type, &icx_iio_mapping_group); }