summaryrefslogtreecommitdiff
path: root/arch/x86/events/intel/uncore.h
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2020-05-28 08:19:28 -0700
committerPeter Zijlstra <peterz@infradead.org>2020-06-15 14:09:50 +0200
commit1b94d31de422399421422af0e63c9685e7485901 (patch)
treec1e1c79efd76878057d1a110adc09b36b0ee511f /arch/x86/events/intel/uncore.h
parent2af834f1faab3f1e218fcbcab70a399121620d62 (diff)
perf/x86/intel/uncore: Record the size of mapped area
Perf cannot validate an address before the actual access to MMIO space of some uncore units, e.g. IMC on TGL. Accessing an invalid address, which exceeds mapped area, can trigger oops. Perf never records the size of mapped area. Generic functions, e.g. uncore_mmio_read_counter(), cannot get the correct size for address validation. Add mmio_map_size in intel_uncore_type to record the size of mapped area. Print warning message if ioremap fails. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/1590679169-61823-2-git-send-email-kan.liang@linux.intel.com
Diffstat (limited to 'arch/x86/events/intel/uncore.h')
-rw-r--r--arch/x86/events/intel/uncore.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index b469ddd45515..79ff626b7ea6 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -61,6 +61,7 @@ struct intel_uncore_type {
unsigned msr_offset;
unsigned mmio_offset;
};
+ unsigned mmio_map_size;
unsigned num_shared_regs:8;
unsigned single_fixed:1;
unsigned pair_ctr_ctl:1;