Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:29 +0100
commit8f87c73ec8b9927571c3147473e5a1e125ab78c2 (patch)
treec583ef00c1636ae29cb43cf3c3f3e8b406acf72c
parent6cbd1a93af17a20ca16df90774797f075ffa2d92 (diff)
perf/x86/intel/uncore: Add Node ID mask (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.8-334-perf-x86-intel-uncore-Add-Node-ID-mask.patch68
-rw-r--r--series.conf1
2 files changed, 69 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-334-perf-x86-intel-uncore-Add-Node-ID-mask.patch b/patches.kernel.org/4.20.8-334-perf-x86-intel-uncore-Add-Node-ID-mask.patch
new file mode 100644
index 0000000000..3f63d5b96b
--- /dev/null
+++ b/patches.kernel.org/4.20.8-334-perf-x86-intel-uncore-Add-Node-ID-mask.patch
@@ -0,0 +1,68 @@
+From: Kan Liang <kan.liang@linux.intel.com>
+Date: Sun, 27 Jan 2019 06:53:14 -0800
+Subject: [PATCH] perf/x86/intel/uncore: Add Node ID mask
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 9e63a7894fd302082cf3627fe90844421a6cbe7f
+
+commit 9e63a7894fd302082cf3627fe90844421a6cbe7f upstream.
+
+Some PCI uncore PMUs cannot be registered on an 8-socket system (HPE
+Superdome Flex).
+
+To understand which Socket the PCI uncore PMUs belongs to, perf retrieves
+the local Node ID of the uncore device from CPUNODEID(0xC0) of the PCI
+configuration space, and the mapping between Socket ID and Node ID from
+GIDNIDMAP(0xD4). The Socket ID can be calculated accordingly.
+
+The local Node ID is only available at bit 2:0, but current code doesn't
+mask it. If a BIOS doesn't clear the rest of the bits, an incorrect Node ID
+will be fetched.
+
+Filter the Node ID by adding a mask.
+
+Reported-by: Song Liu <songliubraving@fb.com>
+Tested-by: Song Liu <songliubraving@fb.com>
+Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: <stable@vger.kernel.org> # v3.7+
+Fixes: 7c94ee2e0917 ("perf/x86: Add Intel Nehalem and Sandy Bridge-EP uncore support")
+Link: https://lkml.kernel.org/r/1548600794-33162-1-git-send-email-kan.liang@linux.intel.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ arch/x86/events/intel/uncore_snbep.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
+index c07bee31abe8..b10e04387f38 100644
+--- a/arch/x86/events/intel/uncore_snbep.c
++++ b/arch/x86/events/intel/uncore_snbep.c
+@@ -1222,6 +1222,8 @@ static struct pci_driver snbep_uncore_pci_driver = {
+ .id_table = snbep_uncore_pci_ids,
+ };
+
++#define NODE_ID_MASK 0x7
++
+ /*
+ * build pci bus to socket mapping
+ */
+@@ -1243,7 +1245,7 @@ static int snbep_pci2phy_map_init(int devid, int nodeid_loc, int idmap_loc, bool
+ err = pci_read_config_dword(ubox_dev, nodeid_loc, &config);
+ if (err)
+ break;
+- nodeid = config;
++ nodeid = config & NODE_ID_MASK;
+ /* get the Node ID mapping */
+ err = pci_read_config_dword(ubox_dev, idmap_loc, &config);
+ if (err)
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 38a5fa5cba..fbe8595143 100644
--- a/series.conf
+++ b/series.conf
@@ -1070,6 +1070,7 @@
patches.kernel.org/4.20.8-331-kvm-fix-kvm_ioctl_create_device-reference-coun.patch
patches.kernel.org/4.20.8-332-KVM-nVMX-unconditionally-cancel-preemption-tim.patch
patches.kernel.org/4.20.8-333-cpu-hotplug-Fix-SMT-disabled-by-BIOS-detection.patch
+ patches.kernel.org/4.20.8-334-perf-x86-intel-uncore-Add-Node-ID-mask.patch
########################################################
# Build fixes that apply to the vanilla kernel too.