linux-stable/drivers/iommu/intel
Kan Liang 586e19c88a iommu/vt-d: Retrieve IOMMU perfmon capability information
[ Upstream commit a6a5006dad ]

The performance monitoring infrastructure, perfmon, is to support
collection of information about key events occurring during operation of
the remapping hardware, to aid performance tuning and debug. Each
remapping hardware unit has capability registers that indicate support
for performance monitoring features and enumerate the capabilities.

Add alloc_iommu_pmu() to retrieve IOMMU perfmon capability information
for each iommu unit. The information is stored in the iommu->pmu data
structure. Capability registers are read-only, so it's safe to prefetch
and store them in the pmu structure. This could avoid unnecessary VMEXIT
when this code is running in the virtualization environment.

Add free_iommu_pmu() to free the saved capability information when
freeing the iommu unit.

Add a kernel config option for the IOMMU perfmon feature. Unless a user
explicitly uses the perf tool to monitor the IOMMU perfmon event, there
isn't any impact for the existing IOMMU. Enable it by default.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Link: https://lore.kernel.org/r/20230128200428.1459118-3-kan.liang@linux.intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Stable-dep-of: 70bad345e6 ("iommu: Fix compilation without CONFIG_IOMMU_INTEL")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:20:41 -04:00
..
cap_audit.c iommu/vt-d: Rename cap_5lp_support to cap_fl5lp_support 2022-09-26 15:52:25 +02:00
cap_audit.h iommu/vt-d: Check FL and SL capability sanity in scalable mode 2021-10-18 12:31:48 +02:00
debugfs.c iommu/vt-d: Replace spin_lock_irqsave() with spin_lock() 2022-07-15 10:21:36 +02:00
dmar.c iommu/vt-d: Retrieve IOMMU perfmon capability information 2024-03-26 18:20:41 -04:00
iommu.c iommu/vt-d: Make context clearing consistent with context mapping 2023-12-08 08:51:19 +01:00
iommu.h iommu/vt-d: Retrieve IOMMU perfmon capability information 2024-03-26 18:20:41 -04:00
irq_remapping.c iommu/vt-d: Avoid unnecessary global IRTE cache invalidation 2022-09-26 15:52:26 +02:00
Kconfig iommu/vt-d: Retrieve IOMMU perfmon capability information 2024-03-26 18:20:41 -04:00
Makefile iommu/vt-d: Retrieve IOMMU perfmon capability information 2024-03-26 18:20:41 -04:00
pasid.c iommu/vt-d: Don't issue ATS Invalidation request when device is disconnected 2024-03-26 18:20:39 -04:00
pasid.h iommu/vt-d: Remove clearing translation data in disable_dmar_iommu() 2022-07-15 10:21:34 +02:00
perf.c iommu/vt-d: Move include/linux/intel-iommu.h under iommu 2022-07-15 10:21:31 +02:00
perf.h
perfmon.c iommu/vt-d: Retrieve IOMMU perfmon capability information 2024-03-26 18:20:41 -04:00
perfmon.h iommu/vt-d: Retrieve IOMMU perfmon capability information 2024-03-26 18:20:41 -04:00
svm.c iommu/vt-d: Fix PCI device refcount leak in prq_event_thread() 2022-12-02 11:45:32 +01:00
trace.c iommu/vt-d: Move trace/events/intel_iommu.h under iommu 2022-07-15 10:21:28 +02:00
trace.h iommu/vt-d: Move include/linux/intel-iommu.h under iommu 2022-07-15 10:21:31 +02:00