History

Merge tag 'iommu-fixes-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel: - fix device setup failures in the Intel VT-d driver when the PASID table is shared - fix Intel VT-d device hot-add failure due to wrong device notifier order - remove the old IOMMU mailing list from the MAINTAINERS file now that it has been retired * tag 'iommu-fixes-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: MAINTAINERS: Remove iommu@lists.linux-foundation.org iommu/vt-d: Fix RID2PASID setup/teardown failure iommu/vt-d: Fix PCI bus rescan device hot add

Linus Torvalds committed 4 years ago

Commit f5645ed2 parents 2b93fe6 c51b8f86 files · +4 −106Browse files

Unified · Split

6 files
  1. MAINTAINERS +0 −11
  2. drivers/iommu/intel/dmar.c +1 −1
  3. drivers/iommu/intel/iommu.c +0 −24
  4. drivers/iommu/intel/pasid.c +3 −66
  5. drivers/iommu/intel/pasid.h +0 −1
  6. include/linux/intel-iommu.h +0 −3
MAINTAINERS+0−11
@@ -426,7 +426,6 @@ F: drivers/acpi/*thermal* · 425 unmodified lines
426426 ACPI VIOT DRIVER
427427 M: Jean-Philippe Brucker <jean-philippe@linaro.org>
428428 L: linux-acpi@vger.kernel.org
429−L: iommu@lists.linux-foundation.org
430429 L: iommu@lists.linux.dev
431430 S: Maintained
432431 F: drivers/acpi/viot.c
@@ -960,7 +959,6 @@ F: drivers/video/fbdev/geode/ · 527 unmodified lines
960959 AMD IOMMU (AMD-VI)
961960 M: Joerg Roedel <joro@8bytes.org>
962961 R: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
963−L: iommu@lists.linux-foundation.org
964962 L: iommu@lists.linux.dev
965963 S: Maintained
966964 T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@ -6055,7 +6053,6 @@ DMA MAPPING HELPERS · 5088 unmodified lines
60556053 M: Christoph Hellwig <hch@lst.de>
60566054 M: Marek Szyprowski <m.szyprowski@samsung.com>
60576055 R: Robin Murphy <robin.murphy@arm.com>
6058−L: iommu@lists.linux-foundation.org
60596056 L: iommu@lists.linux.dev
60606057 S: Supported
60616058 W: http://git.infradead.org/users/hch/dma-mapping.git
@@ -6068,7 +6065,6 @@ F: kernel/dma/ · 6 unmodified lines
60686065
60696066 DMA MAPPING BENCHMARK
60706067 M: Xiang Chen <chenxiang66@hisilicon.com>
6071−L: iommu@lists.linux-foundation.org
60726068 L: iommu@lists.linux.dev
60736069 F: kernel/dma/map_benchmark.c
60746070 F: tools/testing/selftests/dma/
@@ -7653,7 +7649,6 @@ F: drivers/gpu/drm/exynos/exynos_dp* · 1578 unmodified lines
76537649
76547650 EXYNOS SYSMMU (IOMMU) driver
76557651 M: Marek Szyprowski <m.szyprowski@samsung.com>
7656−L: iommu@lists.linux-foundation.org
76577652 L: iommu@lists.linux.dev
76587653 S: Maintained
76597654 F: drivers/iommu/exynos-iommu.c
@@ -10078,7 +10073,6 @@ F: drivers/hid/intel-ish-hid/ · 2418 unmodified lines
1007810073 INTEL IOMMU (VT-d)
1007910074 M: David Woodhouse <dwmw2@infradead.org>
1008010075 M: Lu Baolu <baolu.lu@linux.intel.com>
10081−L: iommu@lists.linux-foundation.org
1008210076 L: iommu@lists.linux.dev
1008310077 S: Supported
1008410078 T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@ -10458,7 +10452,6 @@ F: include/linux/iomap.h · 373 unmodified lines
1045810452 IOMMU DRIVERS
1045910453 M: Joerg Roedel <joro@8bytes.org>
1046010454 M: Will Deacon <will@kernel.org>
10461−L: iommu@lists.linux-foundation.org
1046210455 L: iommu@lists.linux.dev
1046310456 S: Maintained
1046410457 T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@ -12618,7 +12611,6 @@ F: drivers/i2c/busses/i2c-mt65xx.c · 2153 unmodified lines
1261812611
1261912612 MEDIATEK IOMMU DRIVER
1262012613 M: Yong Wu <yong.wu@mediatek.com>
12621−L: iommu@lists.linux-foundation.org
1262212614 L: iommu@lists.linux.dev
1262312615 L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)
1262412616 S: Supported
@@ -16670,7 +16662,6 @@ F: drivers/i2c/busses/i2c-qcom-cci.c · 4045 unmodified lines
1667016662
1667116663 QUALCOMM IOMMU
1667216664 M: Rob Clark <robdclark@gmail.com>
16673−L: iommu@lists.linux-foundation.org
1667416665 L: iommu@lists.linux.dev
1667516666 L: linux-arm-msm@vger.kernel.org
1667616667 S: Maintained
@@ -19299,7 +19290,6 @@ F: arch/x86/boot/video* · 2622 unmodified lines
1929919290
1930019291 SWIOTLB SUBSYSTEM
1930119292 M: Christoph Hellwig <hch@infradead.org>
19302−L: iommu@lists.linux-foundation.org
1930319293 L: iommu@lists.linux.dev
1930419294 S: Supported
1930519295 W: http://git.infradead.org/users/hch/dma-mapping.git
@@ -21975,7 +21965,6 @@ XEN SWIOTLB SUBSYSTEM · 2669 unmodified lines
2197521965 M: Juergen Gross <jgross@suse.com>
2197621966 M: Stefano Stabellini <sstabellini@kernel.org>
2197721967 L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
21978−L: iommu@lists.linux-foundation.org
2197921968 L: iommu@lists.linux.dev
2198021969 S: Supported
2198121970 F: arch/x86/xen/*swiotlb*
drivers/iommu/intel/dmar.c+1−1
@@ -382,7 +382,7 @@ static int dmar_pci_bus_notifier(struct notifier_block *nb, · 381 unmodified lines
382382
383383 static struct notifier_block dmar_pci_bus_nb = {
384384 .notifier_call = dmar_pci_bus_notifier,
385− .priority = INT_MIN,
385+ .priority = 1,
386386 };
387387
388388 static struct dmar_drhd_unit *
drivers/iommu/intel/iommu.c+0−24
@@ -320,30 +320,6 @@ EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); · 319 unmodified lines
320320 DEFINE_SPINLOCK(device_domain_lock);
321321 static LIST_HEAD(device_domain_list);
322322
323−/*
324− * Iterate over elements in device_domain_list and call the specified
325− * callback @fn against each element.
326− */
327−int for_each_device_domain(int (*fn)(struct device_domain_info *info,
328− void *data), void *data)
329−{
330− int ret = 0;
331− unsigned long flags;
332− struct device_domain_info *info;
333−
334− spin_lock_irqsave(&device_domain_lock, flags);
335− list_for_each_entry(info, &device_domain_list, global) {
336− ret = fn(info, data);
337− if (ret) {
338− spin_unlock_irqrestore(&device_domain_lock, flags);
339− return ret;
340− }
341− }
342− spin_unlock_irqrestore(&device_domain_lock, flags);
343−
344− return 0;
345−}
346−
347323 const struct iommu_ops intel_iommu_ops;
348324
349325 static bool translation_pre_enabled(struct intel_iommu *iommu)
drivers/iommu/intel/pasid.c+3−66
@@ -86,54 +86,6 @@ void vcmd_free_pasid(struct intel_iommu *iommu, u32 pasid) · 85 unmodified lines
8686 /*
8787 * Per device pasid table management:
8888 */
89−static inline void
90−device_attach_pasid_table(struct device_domain_info *info,
91− struct pasid_table *pasid_table)
92−{
93− info->pasid_table = pasid_table;
94− list_add(&info->table, &pasid_table->dev);
95−}
96−
97−static inline void
98−device_detach_pasid_table(struct device_domain_info *info,
99− struct pasid_table *pasid_table)
100−{
101− info->pasid_table = NULL;
102− list_del(&info->table);
103−}
104−
105−struct pasid_table_opaque {
106− struct pasid_table **pasid_table;
107− int segment;
108− int bus;
109− int devfn;
110−};
111−
112−static int search_pasid_table(struct device_domain_info *info, void *opaque)
113−{
114− struct pasid_table_opaque *data = opaque;
115−
116− if (info->iommu->segment == data->segment &&
117− info->bus == data->bus &&
118− info->devfn == data->devfn &&
119− info->pasid_table) {
120− *data->pasid_table = info->pasid_table;
121− return 1;
122− }
123−
124− return 0;
125−}
126−
127−static int get_alias_pasid_table(struct pci_dev *pdev, u16 alias, void *opaque)
128−{
129− struct pasid_table_opaque *data = opaque;
130−
131− data->segment = pci_domain_nr(pdev->bus);
132− data->bus = PCI_BUS_NUM(alias);
133− data->devfn = alias & 0xff;
134−
135− return for_each_device_domain(&search_pasid_table, data);
136−}
13789
13890 /*
13991 * Allocate a pasid table for @dev. It should be called in a
@@ -143,28 +95,18 @@ int intel_pasid_alloc_table(struct device *dev) · 3 unmodified lines
14395 {
14496 struct device_domain_info *info;
14597 struct pasid_table *pasid_table;
146− struct pasid_table_opaque data;
14798 struct page *pages;
14899 u32 max_pasid = 0;
149− int ret, order;
150− int size;
100+ int order, size;
151101
152102 might_sleep();
153103 info = dev_iommu_priv_get(dev);
154104 if (WARN_ON(!info || !dev_is_pci(dev) || info->pasid_table))
155105 return -EINVAL;
156106
157− /* DMA alias device already has a pasid table, use it: */
158− data.pasid_table = &pasid_table;
159− ret = pci_for_each_dma_alias(to_pci_dev(dev),
160− &get_alias_pasid_table, &data);
161− if (ret)
162− goto attach_out;
163−
164107 pasid_table = kzalloc(sizeof(*pasid_table), GFP_KERNEL);
165108 if (!pasid_table)
166109 return -ENOMEM;
167− INIT_LIST_HEAD(&pasid_table->dev);
168110
169111 if (info->pasid_supported)
170112 max_pasid = min_t(u32, pci_max_pasids(to_pci_dev(dev)),
@@ -182,9 +124,7 @@ int intel_pasid_alloc_table(struct device *dev) · 11 unmodified lines
182124 pasid_table->table = page_address(pages);
183125 pasid_table->order = order;
184126 pasid_table->max_pasid = 1 << (order + PAGE_SHIFT + 3);
185−
186−attach_out:
187− device_attach_pasid_table(info, pasid_table);
127+ info->pasid_table = pasid_table;
188128
189129 return 0;
190130 }
@@ -202,10 +142,7 @@ void intel_pasid_free_table(struct device *dev) · 11 unmodified lines
202142 return;
203143
204144 pasid_table = info->pasid_table;
205− device_detach_pasid_table(info, pasid_table);
206−
207− if (!list_empty(&pasid_table->dev))
208− return;
145+ info->pasid_table = NULL;
209146
210147 /* Free scalable mode PASID directory tables: */
211148 dir = pasid_table->table;
drivers/iommu/intel/pasid.h+0−1
@@ -74,7 +74,6 @@ struct pasid_table { · 73 unmodified lines
7474 void *table; /* pasid table pointer */
7575 int order; /* page order of pasid table */
7676 u32 max_pasid; /* max pasid */
77− struct list_head dev; /* device list */
7877 };
7978
8079 /* Get PRESENT bit of a PASID directory entry. */
include/linux/intel-iommu.h+0−3
@@ -612,7 +612,6 @@ struct intel_iommu { · 611 unmodified lines
612612 struct device_domain_info {
613613 struct list_head link; /* link to domain siblings */
614614 struct list_head global; /* link to global list */
615− struct list_head table; /* link to pasid table */
616615 u32 segment; /* PCI segment number */
617616 u8 bus; /* PCI bus number */
618617 u8 devfn; /* PCI devfn number */
@@ -729,8 +728,6 @@ extern int dmar_ir_support(void); · 110 unmodified lines
729728 void *alloc_pgtable_page(int node);
730729 void free_pgtable_page(void *vaddr);
731730 struct intel_iommu *domain_get_iommu(struct dmar_domain *domain);
732−int for_each_device_domain(int (*fn)(struct device_domain_info *info,
733− void *data), void *data);
734731 void iommu_flush_write_buffer(struct intel_iommu *iommu);
735732 int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct device *dev);
736733 struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn);