aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-02-14 14:11:44 +0100
committerChristoph Hellwig <hch@lst.de>2022-04-18 07:21:10 +0200
commit78013eaadf696d2105982abb4018fbae394ca08f (patch)
tree018da6dc9f81f26fc4d5ce8df7e1a9e9903593ed /drivers/iommu/amd
parentf39f8d0eb081407e470396fd4cc376c526d13066 (diff)
downloadlinux-78013eaadf696d2105982abb4018fbae394ca08f.tar.gz
x86: remove the IOMMU table infrastructure
The IOMMU table tries to separate the different IOMMUs into different backends, but actually requires various cross calls. Rewrite the code to do the generic swiotlb/swiotlb-xen setup directly in pci-dma.c and then just call into the IOMMU drivers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/iommu/amd')
-rw-r--r--drivers/iommu/amd/init.c6
-rw-r--r--drivers/iommu/amd/iommu.c5
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index b4a798c7b347..1a3ad58ba846 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -27,7 +27,6 @@
#include <asm/apic.h>
#include <asm/gart.h>
#include <asm/x86_init.h>
-#include <asm/iommu_table.h>
#include <asm/io_apic.h>
#include <asm/irq_remapping.h>
#include <asm/set_memory.h>
@@ -3257,11 +3256,6 @@ __setup("ivrs_ioapic", parse_ivrs_ioapic);
__setup("ivrs_hpet", parse_ivrs_hpet);
__setup("ivrs_acpihid", parse_ivrs_acpihid);
-IOMMU_INIT_FINISH(amd_iommu_detect,
- gart_iommu_hole_init,
- NULL,
- NULL);
-
bool amd_iommu_v2_supported(void)
{
return amd_iommu_v2_present;
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index a1ada7bff44e..b47220ac09ea 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -1840,7 +1840,10 @@ void amd_iommu_domain_update(struct protection_domain *domain)
static void __init amd_iommu_init_dma_ops(void)
{
- swiotlb = (iommu_default_passthrough() || sme_me_mask) ? 1 : 0;
+ if (iommu_default_passthrough() || sme_me_mask)
+ x86_swiotlb_enable = true;
+ else
+ x86_swiotlb_enable = false;
}
int __init amd_iommu_init_api(void)