linux_dsm_epyc7002/arch/x86/events/intel
Kan Liang f605cfca8c perf/x86/intel: Fix large period handling on Broadwell CPUs
Large fixed period values could be truncated on Broadwell, for example:

  perf record -e cycles -c 10000000000

Here the fixed period is 0x2540BE400, but the period which finally applied is
0x540BE400 - which is wrong.

The reason is that x86_pmu::limit_period() uses an u32 parameter, so the
high 32 bits of 'period' get truncated.

This bug was introduced in:

  commit 294fe0f52a ("perf/x86/intel: Add INST_RETIRED.ALL workarounds")

It's safe to use u64 instead of u32:

 - Although the 'left' is s64, the value of 'left' must be positive when
   calling limit_period().

 - bdw_limit_period() only modifies the lowest 6 bits, it doesn't touch
   the higher 32 bits.

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>
Fixes: 294fe0f52a ("perf/x86/intel: Add INST_RETIRED.ALL workarounds")
Link: http://lkml.kernel.org/r/1519926894-3520-1-git-send-email-kan.liang@linux.intel.com
[ Rewrote unacceptably bad changelog. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-03-09 08:22:05 +01:00
..
bts.c x86,perf: Disable intel_bts when PTI 2018-01-14 11:42:10 +01:00
core.c perf/x86/intel: Fix large period handling on Broadwell CPUs 2018-03-09 08:22:05 +01:00
cstate.c perf/x86/intel/cstate: Add missing CPU IDs 2017-09-25 09:36:17 +02:00
ds.c perf/x86: Fix perf,x86,cpuhp deadlock 2018-01-25 14:48:30 +01:00
knc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lbr.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-15 01:15:52 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
p4.c x86: Mark various structures and functions as 'static' 2017-08-11 14:49:43 +02:00
p6.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-15 01:15:52 +01:00
pt.c perf/core, pt, bts: Get rid of itrace_started 2017-08-29 15:09:24 +02:00
pt.h perf/x86/intel/pt: Allow the disabling of branch tracing 2017-03-30 09:53:49 +02:00
rapl.c perf/x86/rapl: Fix Haswell and Broadwell server RAPL event 2018-01-12 14:59:54 +01:00
uncore_nhmex.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uncore_snb.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uncore_snbep.c perf/x86/intel/uncore: Fix Skylake UPI event format 2018-03-04 09:59:00 +01:00
uncore.c perf/x86/intel/uncore: Cache logical pkg id in uncore driver 2017-11-17 16:22:30 +01:00
uncore.h perf/x86/intel/uncore: Cache logical pkg id in uncore driver 2017-11-17 16:22:30 +01:00