Skip to content

Commit a2316dd

Browse files
committed
Merge tag 'iommu-fixes-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux
Pull iommu fixes from Joerg Roedel: - Two cache flushing fixes for Intel and AMD drivers - AMD guest translation enabling fix - Update IOMMU tree location in MAINTAINERS file * tag 'iommu-fixes-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux: MAINTAINERS: Update IOMMU tree location iommu/amd: Fix GT feature enablement again iommu/vt-d: Fix missed device TLB cache tag iommu/amd: Invalidate cache before removing device from domain list
2 parents 1cf0668 + 09aaa2d commit a2316dd

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

MAINTAINERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ M: Joerg Roedel <[email protected]>
10441044
R: Suravee Suthikulpanit <[email protected]>
10451045
10461046
S: Maintained
1047-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
1047+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
10481048
F: drivers/iommu/amd/
10491049
F: include/linux/amd-iommu.h
10501050

@@ -11157,7 +11157,7 @@ M: David Woodhouse <[email protected]>
1115711157
M: Lu Baolu <[email protected]>
1115811158
1115911159
S: Supported
11160-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
11160+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1116111161
F: drivers/iommu/intel/
1116211162

1116311163
INTEL IPU3 CSI-2 CIO2 DRIVER
@@ -11530,7 +11530,7 @@ IOMMU DMA-API LAYER
1153011530
M: Robin Murphy <[email protected]>
1153111531
1153211532
S: Maintained
11533-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
11533+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1153411534
F: drivers/iommu/dma-iommu.c
1153511535
F: drivers/iommu/dma-iommu.h
1153611536
F: drivers/iommu/iova.c
@@ -11542,7 +11542,7 @@ M: Will Deacon <[email protected]>
1154211542
R: Robin Murphy <[email protected]>
1154311543
1154411544
S: Maintained
11545-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
11545+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1154611546
F: Documentation/devicetree/bindings/iommu/
1154711547
F: Documentation/userspace-api/iommu.rst
1154811548
F: drivers/iommu/

drivers/iommu/amd/init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,6 +2743,7 @@ static void early_enable_iommu(struct amd_iommu *iommu)
27432743
iommu_enable_command_buffer(iommu);
27442744
iommu_enable_event_buffer(iommu);
27452745
iommu_set_exclusion_range(iommu);
2746+
iommu_enable_gt(iommu);
27462747
iommu_enable_ga(iommu);
27472748
iommu_enable_xt(iommu);
27482749
iommu_enable_irtcachedis(iommu);

drivers/iommu/amd/iommu.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,6 +2061,12 @@ static void do_detach(struct iommu_dev_data *dev_data)
20612061
struct protection_domain *domain = dev_data->domain;
20622062
struct amd_iommu *iommu = get_amd_iommu_from_dev_data(dev_data);
20632063

2064+
/* Clear DTE and flush the entry */
2065+
amd_iommu_dev_update_dte(dev_data, false);
2066+
2067+
/* Flush IOTLB and wait for the flushes to finish */
2068+
amd_iommu_domain_flush_all(domain);
2069+
20642070
/* Clear GCR3 table */
20652071
if (pdom_is_sva_capable(domain))
20662072
destroy_gcr3_table(dev_data, domain);
@@ -2069,12 +2075,6 @@ static void do_detach(struct iommu_dev_data *dev_data)
20692075
dev_data->domain = NULL;
20702076
list_del(&dev_data->list);
20712077

2072-
/* Clear DTE and flush the entry */
2073-
amd_iommu_dev_update_dte(dev_data, false);
2074-
2075-
/* Flush IOTLB and wait for the flushes to finish */
2076-
amd_iommu_domain_flush_all(domain);
2077-
20782078
/* decrease reference counters - needs to happen after the flushes */
20792079
domain->dev_iommu[iommu->index] -= 1;
20802080
domain->dev_cnt -= 1;

drivers/iommu/intel/iommu.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,12 +2114,6 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
21142114
if (ret)
21152115
return ret;
21162116

2117-
ret = cache_tag_assign_domain(domain, dev, IOMMU_NO_PASID);
2118-
if (ret) {
2119-
domain_detach_iommu(domain, iommu);
2120-
return ret;
2121-
}
2122-
21232117
info->domain = domain;
21242118
spin_lock_irqsave(&domain->lock, flags);
21252119
list_add(&info->link, &domain->devices);
@@ -2137,15 +2131,21 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
21372131
else
21382132
ret = intel_pasid_setup_second_level(iommu, domain, dev, IOMMU_NO_PASID);
21392133

2140-
if (ret) {
2141-
device_block_translation(dev);
2142-
return ret;
2143-
}
2134+
if (ret)
2135+
goto out_block_translation;
21442136

21452137
if (sm_supported(info->iommu) || !domain_type_is_si(info->domain))
21462138
iommu_enable_pci_caps(info);
21472139

2140+
ret = cache_tag_assign_domain(domain, dev, IOMMU_NO_PASID);
2141+
if (ret)
2142+
goto out_block_translation;
2143+
21482144
return 0;
2145+
2146+
out_block_translation:
2147+
device_block_translation(dev);
2148+
return ret;
21492149
}
21502150

21512151
/**

0 commit comments

Comments
 (0)