Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2019-07-26 13:11:21 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2019-07-26 13:11:21 +0200
commit57e14fc1e38ae6b2c368bc88356d7313dd054a0b (patch)
treec06df88fdf56571c356036a466a7bfe80f11572c
parentb62b19571f0475c01379f44dd95d4d2566bdbd68 (diff)
parent3710f3da77228aaac4e934bd52e49829dad0d217 (diff)
Merge remote-tracking branch 'origin/users/tonyj/SLE12-SP5/for-next' into SLE12-SP5
Pull perf fix from Tony Jones.
-rw-r--r--patches.arch/perf-x86-clean-up-pebs_xmm_regs.patch92
-rw-r--r--patches.arch/perf-x86-remove-pmu-pebs_no_xmm_regs.patch83
-rw-r--r--series.conf2
3 files changed, 177 insertions, 0 deletions
diff --git a/patches.arch/perf-x86-clean-up-pebs_xmm_regs.patch b/patches.arch/perf-x86-clean-up-pebs_xmm_regs.patch
new file mode 100644
index 0000000000..5ebe79fbd3
--- /dev/null
+++ b/patches.arch/perf-x86-clean-up-pebs_xmm_regs.patch
@@ -0,0 +1,92 @@
+From: Kan Liang <kan.liang@linux.intel.com>
+Date: Tue, 28 May 2019 15:08:32 -0700
+Subject: perf/x86: Clean up PEBS_XMM_REGS
+Git-commit: dce86ac75d772047e9bc606154704aa73bfd4c83
+Patch-mainline: v5.2-rc7
+References: bsc#1142421
+
+Use generic macro PERF_REG_EXTENDED_MASK to replace PEBS_XMM_REGS to
+avoid duplication.
+
+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: Stephane Eranian <eranian@google.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vince Weaver <vincent.weaver@maine.edu>
+Link: https://lkml.kernel.org/r/1559081314-9714-3-git-send-email-kan.liang@linux.intel.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Tony Jones <tonyj@suse.de>
+---
+ arch/x86/events/core.c | 4 ++--
+ arch/x86/events/intel/ds.c | 2 +-
+ arch/x86/events/perf_event.h | 18 ------------------
+ 3 files changed, 3 insertions(+), 21 deletions(-)
+
+diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
+index f315425d8468..7708a6fb5f4a 100644
+--- a/arch/x86/events/core.c
++++ b/arch/x86/events/core.c
+@@ -561,13 +561,13 @@ int x86_pmu_hw_config(struct perf_event *event)
+ }
+
+ /* sample_regs_user never support XMM registers */
+- if (unlikely(event->attr.sample_regs_user & PEBS_XMM_REGS))
++ if (unlikely(event->attr.sample_regs_user & PERF_REG_EXTENDED_MASK))
+ return -EINVAL;
+ /*
+ * Besides the general purpose registers, XMM registers may
+ * be collected in PEBS on some platforms, e.g. Icelake
+ */
+- if (unlikely(event->attr.sample_regs_intr & PEBS_XMM_REGS)) {
++ if (unlikely(event->attr.sample_regs_intr & PERF_REG_EXTENDED_MASK)) {
+ if (x86_pmu.pebs_no_xmm_regs)
+ return -EINVAL;
+
+diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
+index 6cb38ab02c8a..955b2c688f23 100644
+--- a/arch/x86/events/intel/ds.c
++++ b/arch/x86/events/intel/ds.c
+@@ -987,7 +987,7 @@ static u64 pebs_update_adaptive_cfg(struct perf_event *event)
+ pebs_data_cfg |= PEBS_DATACFG_GP;
+
+ if ((sample_type & PERF_SAMPLE_REGS_INTR) &&
+- (attr->sample_regs_intr & PEBS_XMM_REGS))
++ (attr->sample_regs_intr & PERF_REG_EXTENDED_MASK))
+ pebs_data_cfg |= PEBS_DATACFG_XMMS;
+
+ if (sample_type & PERF_SAMPLE_BRANCH_STACK) {
+diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
+index a6ac2f4f76fc..d3b6e90c80d3 100644
+--- a/arch/x86/events/perf_event.h
++++ b/arch/x86/events/perf_event.h
+@@ -121,24 +121,6 @@ struct amd_nb {
+ (1ULL << PERF_REG_X86_R14) | \
+ (1ULL << PERF_REG_X86_R15))
+
+-#define PEBS_XMM_REGS \
+- ((1ULL << PERF_REG_X86_XMM0) | \
+- (1ULL << PERF_REG_X86_XMM1) | \
+- (1ULL << PERF_REG_X86_XMM2) | \
+- (1ULL << PERF_REG_X86_XMM3) | \
+- (1ULL << PERF_REG_X86_XMM4) | \
+- (1ULL << PERF_REG_X86_XMM5) | \
+- (1ULL << PERF_REG_X86_XMM6) | \
+- (1ULL << PERF_REG_X86_XMM7) | \
+- (1ULL << PERF_REG_X86_XMM8) | \
+- (1ULL << PERF_REG_X86_XMM9) | \
+- (1ULL << PERF_REG_X86_XMM10) | \
+- (1ULL << PERF_REG_X86_XMM11) | \
+- (1ULL << PERF_REG_X86_XMM12) | \
+- (1ULL << PERF_REG_X86_XMM13) | \
+- (1ULL << PERF_REG_X86_XMM14) | \
+- (1ULL << PERF_REG_X86_XMM15))
+-
+ /*
+ * Per register state.
+ */
+
diff --git a/patches.arch/perf-x86-remove-pmu-pebs_no_xmm_regs.patch b/patches.arch/perf-x86-remove-pmu-pebs_no_xmm_regs.patch
new file mode 100644
index 0000000000..a0a307c442
--- /dev/null
+++ b/patches.arch/perf-x86-remove-pmu-pebs_no_xmm_regs.patch
@@ -0,0 +1,83 @@
+From: Kan Liang <kan.liang@linux.intel.com>
+Date: Tue, 28 May 2019 15:08:33 -0700
+Subject: perf/x86: Remove pmu->pebs_no_xmm_regs
+Git-commit: cd6b984f6d8cd615755b5404a51b7efe45215f28
+Patch-mainline: v5.2-rc7
+References: bsc#1142421
+
+We don't need pmu->pebs_no_xmm_regs anymore, the capabilities
+PERF_PMU_CAP_EXTENDED_REGS can be used to check if XMM registers
+collection is supported.
+
+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: Stephane Eranian <eranian@google.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vince Weaver <vincent.weaver@maine.edu>
+Link: https://lkml.kernel.org/r/1559081314-9714-4-git-send-email-kan.liang@linux.intel.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Tony Jones <tonyj@suse.de>
+---
+ arch/x86/events/core.c | 2 +-
+ arch/x86/events/intel/ds.c | 6 ++----
+ arch/x86/events/perf_event.h | 3 +--
+ 3 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
+index 7708a6fb5f4a..52a97463cb24 100644
+--- a/arch/x86/events/core.c
++++ b/arch/x86/events/core.c
+@@ -568,7 +568,7 @@ int x86_pmu_hw_config(struct perf_event *event)
+ * be collected in PEBS on some platforms, e.g. Icelake
+ */
+ if (unlikely(event->attr.sample_regs_intr & PERF_REG_EXTENDED_MASK)) {
+- if (x86_pmu.pebs_no_xmm_regs)
++ if (!(event->pmu->capabilities & PERF_PMU_CAP_EXTENDED_REGS))
+ return -EINVAL;
+
+ if (!event->attr.precise_ip)
+diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
+index 955b2c688f23..505c73dc6a73 100644
+--- a/arch/x86/events/intel/ds.c
++++ b/arch/x86/events/intel/ds.c
+@@ -1964,10 +1964,9 @@ void __init intel_ds_init(void)
+ x86_pmu.bts = boot_cpu_has(X86_FEATURE_BTS);
+ x86_pmu.pebs = boot_cpu_has(X86_FEATURE_PEBS);
+ x86_pmu.pebs_buffer_size = PEBS_BUFFER_SIZE;
+- if (x86_pmu.version <= 4) {
++ if (x86_pmu.version <= 4)
+ x86_pmu.pebs_no_isolation = 1;
+- x86_pmu.pebs_no_xmm_regs = 1;
+- }
++
+ if (x86_pmu.pebs) {
+ char pebs_type = x86_pmu.intel_cap.pebs_trap ? '+' : '-';
+ char *pebs_qual = "";
+@@ -2023,7 +2022,6 @@ void __init intel_ds_init(void)
+ x86_get_pmu()->capabilities |= PERF_PMU_CAP_EXTENDED_REGS;
+ } else {
+ /* Only basic record supported */
+- x86_pmu.pebs_no_xmm_regs = 1;
+ x86_pmu.large_pebs_flags &=
+ ~(PERF_SAMPLE_ADDR |
+ PERF_SAMPLE_TIME |
+diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
+index d3b6e90c80d3..4e346856ee19 100644
+--- a/arch/x86/events/perf_event.h
++++ b/arch/x86/events/perf_event.h
+@@ -650,8 +650,7 @@ struct x86_pmu {
+ pebs_broken :1,
+ pebs_prec_dist :1,
+ pebs_no_tlb :1,
+- pebs_no_isolation :1,
+- pebs_no_xmm_regs :1;
++ pebs_no_isolation :1;
+ int pebs_record_size;
+ int pebs_buffer_size;
+ int max_pebs_events;
+
diff --git a/series.conf b/series.conf
index 1adbd05073..bb554fd531 100644
--- a/series.conf
+++ b/series.conf
@@ -47926,6 +47926,8 @@
patches.fixes/mm-hugetlb-soft-offline-dissolve_free_huge_page-retu.patch
patches.arch/perf-x86-disable-extended-registers-for-non-supported-pmus.patch
patches.arch/perf-x86-regs-check-reserved-bits.patch
+ patches.arch/perf-x86-clean-up-pebs_xmm_regs.patch
+ patches.arch/perf-x86-remove-pmu-pebs_no_xmm_regs.patch
patches.fixes/Bluetooth-Fix-faulty-expression-for-minimum-encrypti.patch
patches.suse/ftrace-x86-remove-possible-deadlock-between-register_kprobe-and-ftrace_run_update_code.patch
patches.suse/tracing-snapshot-resize-spare-buffer-if-size-changed.patch