diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2023-01-31 08:37:40 +0100 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-02-03 11:06:09 +0100 |
commit | d8a7c0cf05a2ac79d3cbd0c0ed7d01ec01f75980 (patch) | |
tree | 78fda1563883a3677537f1e3f71d9f782bb69833 /drivers/iommu/intel/dmar.c | |
parent | iommu/vt-d: Add IOMMU perfmon overflow handler support (diff) | |
download | linux-d8a7c0cf05a2ac79d3cbd0c0ed7d01ec01f75980.tar.xz linux-d8a7c0cf05a2ac79d3cbd0c0ed7d01ec01f75980.zip |
iommu/vt-d: Enable IOMMU perfmon support
Register and enable an IOMMU perfmon for each active IOMMU device.
The failure of IOMMU perfmon registration doesn't impact other
functionalities of an IOMMU device.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Link: https://lore.kernel.org/r/20230128200428.1459118-8-kan.liang@linux.intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel/dmar.c')
-rw-r--r-- | drivers/iommu/intel/dmar.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index 43db6ebe8b57..6acfe879589c 100644 --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -1144,6 +1144,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) err = iommu_device_register(&iommu->iommu, &intel_iommu_ops, NULL); if (err) goto err_sysfs; + + iommu_pmu_register(iommu); } drhd->iommu = iommu; @@ -1166,6 +1168,7 @@ error: static void free_iommu(struct intel_iommu *iommu) { if (intel_iommu_enabled && !iommu->drhd->ignored) { + iommu_pmu_unregister(iommu); iommu_device_unregister(&iommu->iommu); iommu_device_sysfs_remove(&iommu->iommu); } |