linux-stable/drivers/iommu
Kan Liang a6a5006dad iommu/vt-d: Retrieve IOMMU perfmon capability information
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>
2023-02-03 11:06:04 +01:00
..
amd IOMMU Updates for Linux v6.2 2022-12-19 08:34:39 -06:00
arm Merge branches 'arm/allwinner', 'arm/exynos', 'arm/mediatek', 'arm/rockchip', 'arm/smmu', 'ppc/pamu', 's390', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-12-12 12:50:53 +01:00
intel iommu/vt-d: Retrieve IOMMU perfmon capability information 2023-02-03 11:06:04 +01:00
iommufd iommufd for 6.2 2022-12-14 09:15:43 -08:00
apple-dart.c iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
dma-iommu.c dma-mapping: reject __GFP_COMP in dma_alloc_attrs 2022-11-21 09:37:20 +01:00
dma-iommu.h iommu/dma: Make header private 2022-09-09 09:26:22 +02:00
exynos-iommu.c iommu/exynos: Fix driver initialization sequence 2022-11-19 10:33:15 +01:00
fsl_pamu.c Merge branches 'arm/allwinner', 'arm/exynos', 'arm/mediatek', 'arm/rockchip', 'arm/smmu', 'ppc/pamu', 's390', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-12-12 12:50:53 +01:00
fsl_pamu.h iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +02:00
fsl_pamu_domain.c iommu: Regulate EINVAL in ->attach_dev callback functions 2022-11-01 14:39:59 -03:00
fsl_pamu_domain.h iommu/fsl_pamu: remove the snoop_id field 2021-04-07 10:56:52 +02:00
hyperv-iommu.c iommu/hyper-v: Allow hyperv irq remapping without x2apic 2022-11-28 16:48:20 +00:00
io-pgfault.c iommu: Rename iommu-sva-lib.{c,h} 2022-11-03 15:47:54 +01:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Remove map/unmap 2022-11-19 10:44:15 +01:00
io-pgtable-arm.c iommu/io-pgtable-arm: Remove map/unmap 2022-11-19 10:44:15 +01:00
io-pgtable-arm.h
io-pgtable-dart.c iommu/io-pgtable-dart: Add DART PTE support for t6000 2022-09-26 13:49:40 +02:00
io-pgtable.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
ioasid.c iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-debugfs.c
iommu-sva.c iommu: Rename iommu-sva-lib.{c,h} 2022-11-03 15:47:54 +01:00
iommu-sva.h iommu: Rename iommu-sva-lib.{c,h} 2022-11-03 15:47:54 +01:00
iommu-sysfs.c
iommu-traces.c
iommu.c IOMMU Updates for Linux v6.2 2022-12-19 08:34:39 -06:00
iova.c iova: Remove iovad->rcaches check in iova_rcache_get() 2022-09-09 09:27:03 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Update to {map,unmap}_pages 2022-11-19 10:44:14 +01:00
irq_remapping.c
irq_remapping.h
Kconfig iommufd for 6.2 2022-12-14 09:15:43 -08:00
Makefile iommufd: File descriptor, context, kconfig and makefiles 2022-11-30 20:16:49 -04:00
msm_iommu.c iommu/msm: Update to {map,unmap}_pages 2022-11-19 10:44:14 +01:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c Merge branches 'arm/allwinner', 'arm/exynos', 'arm/mediatek', 'arm/rockchip', 'arm/smmu', 'ppc/pamu', 's390', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-12-12 12:50:53 +01:00
mtk_iommu_v1.c iommu/mediatek-v1: Update to {map,unmap}_pages 2022-11-19 10:44:12 +01:00
of_iommu.c iommu/of: Remove linux/msi.h include 2022-11-23 23:07:38 +01:00
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-09-07 10:42:28 +02:00
omap-iommu.c iommu: Use EINVAL for incompatible device/domain in ->attach_dev 2022-11-01 14:39:59 -03:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: fix permission bits in page table entries v2 2022-11-03 15:58:41 +01:00
s390-iommu.c s390/pci: use lock-free I/O translation updates 2022-11-19 10:28:18 +01:00
sprd-iommu.c iommu/sprd: Update to {map,unmap}_pages 2022-11-19 10:44:13 +01:00
sun50i-iommu.c iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY 2022-12-05 11:52:57 +01:00
tegra-gart.c iommu: Use EINVAL for incompatible device/domain in ->attach_dev 2022-11-01 14:39:59 -03:00
tegra-smmu.c iommu/tegra-smmu: Clean up bus_set_iommu() 2022-09-07 14:26:16 +02:00
virtio-iommu.c iommu: Propagate return value in ->attach_dev callback functions 2022-11-01 14:39:59 -03:00