aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/events/intel/uncore_discovery.h
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2021-03-17 10:59:36 -0700
committerPeter Zijlstra <peterz@infradead.org>2021-04-02 10:04:55 +0200
commit42839ef4a20a4bda415974ff0e7d85ff540fffa4 (patch)
tree79921666b0db435736e54a4a011156a155e489f6 /arch/x86/events/intel/uncore_discovery.h
parentperf/x86/intel/uncore: Rename uncore_notifier to uncore_pci_sub_notifier (diff)
downloadlinux-dev-42839ef4a20a4bda415974ff0e7d85ff540fffa4.tar.xz
linux-dev-42839ef4a20a4bda415974ff0e7d85ff540fffa4.zip
perf/x86/intel/uncore: Generic support for the PCI type of uncore blocks
The discovery table provides the generic uncore block information for the PCI type of uncore blocks, which is good enough to provide basic uncore support. The PCI BUS and DEVFN information can be retrieved from the box control field. Introduce the uncore_pci_pmus_register() to register all the PCICFG type of uncore blocks. The old PCI probe/remove way is dropped. The PCI BUS and DEVFN information are different among dies. Add box_ctls to store the box control field of each die. Add a new BUS notifier for the PCI type of uncore block to support the hotplug. If the device is "hot remove", the corresponding registered PMU has to be unregistered. Perf cannot locate the PMU by searching a const pci_device_id table, because the discovery tables don't provide such information. Introduce uncore_pci_find_dev_pmu_from_types() to search the whole uncore_pci_uncores for the PMU. Implement generic support for the PCI type of uncore block. 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/1616003977-90612-5-git-send-email-kan.liang@linux.intel.com
Diffstat (limited to '')
-rw-r--r--arch/x86/events/intel/uncore_discovery.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/events/intel/uncore_discovery.h b/arch/x86/events/intel/uncore_discovery.h
index 87078ba932fc..1639ff7baed8 100644
--- a/arch/x86/events/intel/uncore_discovery.h
+++ b/arch/x86/events/intel/uncore_discovery.h
@@ -23,6 +23,12 @@
/* Global discovery table size */
#define UNCORE_DISCOVERY_GLOBAL_MAP_SIZE 0x20
+#define UNCORE_DISCOVERY_PCI_DOMAIN(data) ((data >> 28) & 0x7)
+#define UNCORE_DISCOVERY_PCI_BUS(data) ((data >> 20) & 0xff)
+#define UNCORE_DISCOVERY_PCI_DEVFN(data) ((data >> 12) & 0xff)
+#define UNCORE_DISCOVERY_PCI_BOX_CTRL(data) (data & 0xfff)
+
+
#define uncore_discovery_invalid_unit(unit) \
(!unit.table1 || !unit.ctl || !unit.table3 || \
unit.table1 == -1ULL || unit.ctl == -1ULL || \
@@ -121,3 +127,4 @@ struct intel_uncore_discovery_type {
bool intel_uncore_has_discovery_tables(void);
void intel_uncore_clear_discovery_tables(void);
void intel_uncore_generic_uncore_cpu_init(void);
+int intel_uncore_generic_uncore_pci_init(void);