Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 1936863

Browse files
committed
Merge remote-tracking branch 'intel-iommu/iommu/fixes' into gvt-staging
2 parents 320cd26 + c51b8f8 commit 1936863

File tree

6 files changed

+4
-106
lines changed

6 files changed

+4
-106
lines changed

MAINTAINERS

-11
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ F: drivers/acpi/*thermal*
426426
ACPI VIOT DRIVER
427427
M: Jean-Philippe Brucker <[email protected]>
428428
429-
430429
431430
S: Maintained
432431
F: drivers/acpi/viot.c
@@ -960,7 +959,6 @@ F: drivers/video/fbdev/geode/
960959
AMD IOMMU (AMD-VI)
961960
M: Joerg Roedel <[email protected]>
962961
R: Suravee Suthikulpanit <[email protected]>
963-
964962
965963
S: Maintained
966964
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@ -5979,7 +5977,6 @@ DMA MAPPING HELPERS
59795977
M: Christoph Hellwig <[email protected]>
59805978
M: Marek Szyprowski <[email protected]>
59815979
R: Robin Murphy <[email protected]>
5982-
59835980
59845981
S: Supported
59855982
W: http://git.infradead.org/users/hch/dma-mapping.git
@@ -5992,7 +5989,6 @@ F: kernel/dma/
59925989

59935990
DMA MAPPING BENCHMARK
59945991
M: Xiang Chen <[email protected]>
5995-
59965992
59975993
F: kernel/dma/map_benchmark.c
59985994
F: tools/testing/selftests/dma/
@@ -7612,7 +7608,6 @@ F: drivers/gpu/drm/exynos/exynos_dp*
76127608

76137609
EXYNOS SYSMMU (IOMMU) driver
76147610
M: Marek Szyprowski <[email protected]>
7615-
76167611
76177612
S: Maintained
76187613
F: drivers/iommu/exynos-iommu.c
@@ -10034,7 +10029,6 @@ F: drivers/hid/intel-ish-hid/
1003410029
INTEL IOMMU (VT-d)
1003510030
M: David Woodhouse <[email protected]>
1003610031
M: Lu Baolu <[email protected]>
10037-
1003810032
1003910033
S: Supported
1004010034
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@ -10414,7 +10408,6 @@ F: include/linux/iomap.h
1041410408
IOMMU DRIVERS
1041510409
M: Joerg Roedel <[email protected]>
1041610410
M: Will Deacon <[email protected]>
10417-
1041810411
1041910412
S: Maintained
1042010413
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@ -12574,7 +12567,6 @@ F: drivers/i2c/busses/i2c-mt65xx.c
1257412567

1257512568
MEDIATEK IOMMU DRIVER
1257612569
M: Yong Wu <[email protected]>
12577-
1257812570
1257912571
L: [email protected] (moderated for non-subscribers)
1258012572
S: Supported
@@ -16626,7 +16618,6 @@ F: drivers/i2c/busses/i2c-qcom-cci.c
1662616618

1662716619
QUALCOMM IOMMU
1662816620
M: Rob Clark <[email protected]>
16629-
1663016621
1663116622
1663216623
S: Maintained
@@ -19252,7 +19243,6 @@ F: arch/x86/boot/video*
1925219243

1925319244
SWIOTLB SUBSYSTEM
1925419245
M: Christoph Hellwig <[email protected]>
19255-
1925619246
1925719247
S: Supported
1925819248
W: http://git.infradead.org/users/hch/dma-mapping.git
@@ -21928,7 +21918,6 @@ XEN SWIOTLB SUBSYSTEM
2192821918
M: Juergen Gross <[email protected]>
2192921919
M: Stefano Stabellini <[email protected]>
2193021920
L: [email protected] (moderated for non-subscribers)
21931-
2193221921
2193321922
S: Supported
2193421923
F: arch/x86/xen/*swiotlb*

drivers/iommu/intel/dmar.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ static int dmar_pci_bus_notifier(struct notifier_block *nb,
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

-24
Original file line numberDiff line numberDiff line change
@@ -320,30 +320,6 @@ EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
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
Original file line numberDiff line numberDiff line change
@@ -86,54 +86,6 @@ void vcmd_free_pasid(struct intel_iommu *iommu, u32 pasid)
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)
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)
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)
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

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ struct pasid_table {
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

-3
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ struct intel_iommu {
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);
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);

0 commit comments

Comments
 (0)