Skip to content

Commit 5a0b11a

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Remove iommu_v2 module
AMD GPU driver which was the only in-kernel user of iommu_v2 module removed dependency on iommu_v2 module. Also we are working on adding SVA support in AMD IOMMU driver. Device drivers are expected to use common SVA framework to enable device PASID/PRI features. Removing iommu_v2 module and then adding SVA simplifies the development. Hence remove iommu_v2 module. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Tested-by: Alex Deucher <alexander.deucher@amd.com> Link: https://lore.kernel.org/r/20231006095706.5694-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 7016b30 commit 5a0b11a

File tree

6 files changed

+0
-1145
lines changed

6 files changed

+0
-1145
lines changed

drivers/iommu/amd/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ config AMD_IOMMU
2222
your BIOS for an option to enable it or if you have an IVRS ACPI
2323
table.
2424

25-
config AMD_IOMMU_V2
26-
tristate "AMD IOMMU Version 2 driver"
27-
depends on AMD_IOMMU
28-
select MMU_NOTIFIER
29-
help
30-
This option enables support for the AMD IOMMUv2 features of the IOMMU
31-
hardware. Select this option if you want to use devices that support
32-
the PCI PRI and PASID interface.
33-
3425
config AMD_IOMMU_DEBUGFS
3526
bool "Enable AMD IOMMU internals in DebugFS"
3627
depends on AMD_IOMMU && IOMMU_DEBUGFS

drivers/iommu/amd/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
obj-$(CONFIG_AMD_IOMMU) += iommu.o init.o quirks.o io_pgtable.o io_pgtable_v2.o
33
obj-$(CONFIG_AMD_IOMMU_DEBUGFS) += debugfs.o
4-
obj-$(CONFIG_AMD_IOMMU_V2) += iommu_v2.o

drivers/iommu/amd/amd_iommu.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ extern int amd_iommu_guest_ir;
3838
extern enum io_pgtable_fmt amd_iommu_pgtable;
3939
extern int amd_iommu_gpt_level;
4040

41-
/* IOMMUv2 specific functions */
42-
struct iommu_domain;
43-
4441
bool amd_iommu_v2_supported(void);
4542
struct amd_iommu *get_amd_iommu(unsigned int idx);
4643
u8 amd_iommu_pc_get_max_banks(unsigned int idx);
@@ -57,8 +54,6 @@ void amd_iommu_pdev_disable_cap_pri(struct pci_dev *pdev);
5754

5855
int amd_iommu_register_ppr_notifier(struct notifier_block *nb);
5956
int amd_iommu_unregister_ppr_notifier(struct notifier_block *nb);
60-
void amd_iommu_domain_direct_map(struct iommu_domain *dom);
61-
int amd_iommu_domain_enable_v2(struct iommu_domain *dom, int pasids);
6257
int amd_iommu_flush_page(struct iommu_domain *dom, u32 pasid, u64 address);
6358
void amd_iommu_update_and_flush_device_table(struct protection_domain *domain);
6459
void amd_iommu_domain_update(struct protection_domain *domain);

drivers/iommu/amd/iommu.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,46 +2568,6 @@ int amd_iommu_unregister_ppr_notifier(struct notifier_block *nb)
25682568
}
25692569
EXPORT_SYMBOL(amd_iommu_unregister_ppr_notifier);
25702570

2571-
void amd_iommu_domain_direct_map(struct iommu_domain *dom)
2572-
{
2573-
struct protection_domain *domain = to_pdomain(dom);
2574-
unsigned long flags;
2575-
2576-
spin_lock_irqsave(&domain->lock, flags);
2577-
2578-
if (domain->iop.pgtbl_cfg.tlb)
2579-
free_io_pgtable_ops(&domain->iop.iop.ops);
2580-
2581-
spin_unlock_irqrestore(&domain->lock, flags);
2582-
}
2583-
EXPORT_SYMBOL(amd_iommu_domain_direct_map);
2584-
2585-
int amd_iommu_domain_enable_v2(struct iommu_domain *dom, int pasids)
2586-
{
2587-
struct protection_domain *pdom = to_pdomain(dom);
2588-
unsigned long flags;
2589-
int ret;
2590-
2591-
spin_lock_irqsave(&pdom->lock, flags);
2592-
2593-
/*
2594-
* Save us all sanity checks whether devices already in the
2595-
* domain support IOMMUv2. Just force that the domain has no
2596-
* devices attached when it is switched into IOMMUv2 mode.
2597-
*/
2598-
ret = -EBUSY;
2599-
if (pdom->dev_cnt > 0 || pdom->flags & PD_IOMMUV2_MASK)
2600-
goto out;
2601-
2602-
if (!pdom->gcr3_tbl)
2603-
ret = setup_gcr3_table(pdom, pasids);
2604-
2605-
out:
2606-
spin_unlock_irqrestore(&pdom->lock, flags);
2607-
return ret;
2608-
}
2609-
EXPORT_SYMBOL(amd_iommu_domain_enable_v2);
2610-
26112571
static int __flush_pasid(struct protection_domain *domain, u32 pasid,
26122572
u64 address, bool size)
26132573
{

0 commit comments

Comments
 (0)