From 362b26ca806a7bf792752b58a00dfdeb2ff311a8 Mon Sep 17 00:00:00 2001 From: Kan Liang Date: Sat, 11 Sep 2021 12:11:22 +0800 Subject: [PATCH] Intel: perf/x86: Remove pmu->pebs_no_xmm_regs mainline inclusion from mainline-v5.2-rc7 commit cd6b984f6d8cd615755b5404a51b7efe45215f28 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I47H3V CVE: NA -------------------------------- commit cd6b984f6d8cd615755b5404a51b7efe45215f28 upstream. 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Link: https://lkml.kernel.org/r/1559081314-9714-4-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar Signed-off-by: Shen, Xiaochen Signed-off-by: Jackie Liu Signed-off-by: Zheng Zengkai Reviewed-by: Yang Jihong Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- arch/x86/events/core.c | 2 +- arch/x86/events/intel/ds.c | 3 --- arch/x86/events/perf_event.h | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index d940e7bc2d25..817b53d2ce2e 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -573,7 +573,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 767606851492..5c57ea8dce6d 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c @@ -1964,8 +1964,6 @@ 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) - x86_pmu.pebs_no_xmm_regs = 1; if (x86_pmu.pebs) { char pebs_type = x86_pmu.intel_cap.pebs_trap ? '+' : '-'; char *pebs_qual = ""; @@ -2021,7 +2019,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 d639627c66de..bfd6f58d3a35 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -652,8 +652,7 @@ struct x86_pmu { pebs_active :1, pebs_broken :1, pebs_prec_dist :1, - pebs_no_tlb :1, - pebs_no_xmm_regs :1; + pebs_no_tlb :1; int pebs_record_size; int pebs_buffer_size; int max_pebs_events; -- GitLab