Skip to content

Commit 1c81065

Browse files
committed
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (53 commits) iommu/amd: Set IOTLB invalidation timeout iommu/amd: Init stats for iommu=pt iommu/amd: Remove unnecessary cache flushes in amd_iommu_resume iommu/amd: Add invalidate-context call-back iommu/amd: Add amd_iommu_device_info() function iommu/amd: Adapt IOMMU driver to PCI register name changes iommu/amd: Add invalid_ppr callback iommu/amd: Implement notifiers for IOMMUv2 iommu/amd: Implement IO page-fault handler iommu/amd: Add routines to bind/unbind a pasid iommu/amd: Implement device aquisition code for IOMMUv2 iommu/amd: Add driver stub for AMD IOMMUv2 support iommu/amd: Add stat counter for IOMMUv2 events iommu/amd: Add device errata handling iommu/amd: Add function to get IOMMUv2 domain for pdev iommu/amd: Implement function to send PPR completions iommu/amd: Implement functions to manage GCR3 table iommu/amd: Implement IOMMUv2 TLB flushing routines iommu/amd: Add support for IOMMUv2 domain mode iommu/amd: Add amd_iommu_domain_direct_map function ...
2 parents 1a464cb + f93ea73 commit 1c81065

File tree

43 files changed

+2943
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2943
-317
lines changed

Documentation/ABI/testing/sysfs-bus-pci

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ Description:
6666
re-discover previously removed devices.
6767
Depends on CONFIG_HOTPLUG.
6868

69+
What: /sys/bus/pci/devices/.../msi_irqs/
70+
Date: September, 2011
71+
Contact: Neil Horman <[email protected]>
72+
Description:
73+
The /sys/devices/.../msi_irqs directory contains a variable set
74+
of sub-directories, with each sub-directory being named after a
75+
corresponding msi irq vector allocated to that device. Each
76+
numbered sub-directory N contains attributes of that irq.
77+
Note that this directory is not created for device drivers which
78+
do not support msi irqs
79+
80+
What: /sys/bus/pci/devices/.../msi_irqs/<N>/mode
81+
Date: September 2011
82+
Contact: Neil Horman <[email protected]>
83+
Description:
84+
This attribute indicates the mode that the irq vector named by
85+
the parent directory is in (msi vs. msix)
86+
6987
What: /sys/bus/pci/devices/.../remove
7088
Date: January 2009
7189
Contact: Linux PCI developers <[email protected]>

Documentation/kernel-parameters.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
329329
is a lot of faster
330330
off - do not initialize any AMD IOMMU found in
331331
the system
332+
force_isolation - Force device isolation for all
333+
devices. The IOMMU driver is not
334+
allowed anymore to lift isolation
335+
requirements as needed. This option
336+
does not override iommu=pt
332337

333338
amijoy.map= [HW,JOY] Amiga joystick support
334339
Map of devices attached to JOY0DAT and JOY1DAT
@@ -1059,7 +1064,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
10591064
nomerge
10601065
forcesac
10611066
soft
1062-
pt [x86, IA-64]
1067+
pt [x86, IA-64]
1068+
group_mf [x86, IA-64]
1069+
10631070

10641071
io7= [HW] IO7 for Marvel based alpha systems
10651072
See comment before marvel_specify_io7 in

arch/arm/mach-omap2/devices.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <plat/board.h>
2929
#include <plat/mcbsp.h>
3030
#include <plat/mmc.h>
31+
#include <plat/iommu.h>
3132
#include <plat/dma.h>
3233
#include <plat/omap_hwmod.h>
3334
#include <plat/omap_device.h>
@@ -211,9 +212,15 @@ static struct platform_device omap3isp_device = {
211212
.resource = omap3isp_resources,
212213
};
213214

215+
static struct omap_iommu_arch_data omap3_isp_iommu = {
216+
.name = "isp",
217+
};
218+
214219
int omap3_init_camera(struct isp_platform_data *pdata)
215220
{
216221
omap3isp_device.dev.platform_data = pdata;
222+
omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu;
223+
217224
return platform_device_register(&omap3isp_device);
218225
}
219226

arch/arm/plat-omap/include/plat/iommu.h

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,32 @@ struct iommu_platform_data {
111111
u32 da_end;
112112
};
113113

114+
/**
115+
* struct iommu_arch_data - omap iommu private data
116+
* @name: name of the iommu device
117+
* @iommu_dev: handle of the iommu device
118+
*
119+
* This is an omap iommu private data object, which binds an iommu user
120+
* to its iommu device. This object should be placed at the iommu user's
121+
* dev_archdata so generic IOMMU API can be used without having to
122+
* utilize omap-specific plumbing anymore.
123+
*/
124+
struct omap_iommu_arch_data {
125+
const char *name;
126+
struct omap_iommu *iommu_dev;
127+
};
128+
129+
/**
130+
* dev_to_omap_iommu() - retrieves an omap iommu object from a user device
131+
* @dev: iommu client device
132+
*/
133+
static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
134+
{
135+
struct omap_iommu_arch_data *arch_data = dev->archdata.iommu;
136+
137+
return arch_data->iommu_dev;
138+
}
139+
114140
/* IOMMU errors */
115141
#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
116142
#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1)
@@ -163,8 +189,8 @@ extern int omap_iommu_set_isr(const char *name,
163189
void *priv),
164190
void *isr_priv);
165191

166-
extern void omap_iommu_save_ctx(struct omap_iommu *obj);
167-
extern void omap_iommu_restore_ctx(struct omap_iommu *obj);
192+
extern void omap_iommu_save_ctx(struct device *dev);
193+
extern void omap_iommu_restore_ctx(struct device *dev);
168194

169195
extern int omap_install_iommu_arch(const struct iommu_functions *ops);
170196
extern void omap_uninstall_iommu_arch(const struct iommu_functions *ops);
@@ -176,6 +202,5 @@ extern ssize_t
176202
omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len);
177203
extern size_t
178204
omap_dump_tlb_entries(struct omap_iommu *obj, char *buf, ssize_t len);
179-
struct device *omap_find_iommu_device(const char *name);
180205

181206
#endif /* __MACH_IOMMU_H */

arch/arm/plat-omap/include/plat/iovmm.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ struct iovm_struct {
7272
#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT))
7373

7474

75-
extern struct iovm_struct *omap_find_iovm_area(struct omap_iommu *obj, u32 da);
75+
extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da);
7676
extern u32
77-
omap_iommu_vmap(struct iommu_domain *domain, struct omap_iommu *obj, u32 da,
77+
omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da,
7878
const struct sg_table *sgt, u32 flags);
7979
extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain,
80-
struct omap_iommu *obj, u32 da);
80+
struct device *dev, u32 da);
8181
extern u32
82-
omap_iommu_vmalloc(struct iommu_domain *domain, struct omap_iommu *obj,
82+
omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev,
8383
u32 da, size_t bytes, u32 flags);
8484
extern void
85-
omap_iommu_vfree(struct iommu_domain *domain, struct omap_iommu *obj,
85+
omap_iommu_vfree(struct iommu_domain *domain, struct device *dev,
8686
const u32 da);
87-
extern void *omap_da_to_va(struct omap_iommu *obj, u32 da);
87+
extern void *omap_da_to_va(struct device *dev, u32 da);
8888

8989
#endif /* __IOMMU_MMAP_H */

arch/ia64/include/asm/iommu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ extern void no_iommu_init(void);
1111
extern int force_iommu, no_iommu;
1212
extern int iommu_pass_through;
1313
extern int iommu_detected;
14+
extern int iommu_group_mf;
1415
#else
1516
#define iommu_pass_through (0)
1617
#define no_iommu (1)
1718
#define iommu_detected (0)
19+
#define iommu_group_mf (0)
1820
#endif
1921
extern void iommu_dma_init(void);
2022
extern void machvec_init(const char *name);

arch/ia64/kernel/pci-dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ int force_iommu __read_mostly;
3333
#endif
3434

3535
int iommu_pass_through;
36+
int iommu_group_mf;
3637

3738
/* Dummy device used for NULL arguments (normally ISA). Better would
3839
be probably a smaller DMA mask, but this is bug-to-bug compatible

arch/x86/include/asm/iommu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ extern struct dma_map_ops nommu_dma_ops;
55
extern int force_iommu, no_iommu;
66
extern int iommu_detected;
77
extern int iommu_pass_through;
8+
extern int iommu_group_mf;
89

910
/* 10 seconds */
1011
#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)

arch/x86/kernel/pci-dma.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ int iommu_detected __read_mostly = 0;
4545
*/
4646
int iommu_pass_through __read_mostly;
4747

48+
/*
49+
* Group multi-function PCI devices into a single device-group for the
50+
* iommu_device_group interface. This tells the iommu driver to pretend
51+
* it cannot distinguish between functions of a device, exposing only one
52+
* group for the device. Useful for disallowing use of individual PCI
53+
* functions from userspace drivers.
54+
*/
55+
int iommu_group_mf __read_mostly;
56+
4857
extern struct iommu_table_entry __iommu_table[], __iommu_table_end[];
4958

5059
/* Dummy device used for NULL arguments (normally ISA). */
@@ -169,6 +178,8 @@ static __init int iommu_setup(char *p)
169178
#endif
170179
if (!strncmp(p, "pt", 2))
171180
iommu_pass_through = 1;
181+
if (!strncmp(p, "group_mf", 8))
182+
iommu_group_mf = 1;
172183

173184
gart_parse_options(p);
174185

drivers/acpi/pci_root.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,13 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
596596
if (ACPI_SUCCESS(status)) {
597597
dev_info(root->bus->bridge,
598598
"ACPI _OSC control (0x%02x) granted\n", flags);
599+
if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
600+
/*
601+
* We have ASPM control, but the FADT indicates
602+
* that it's unsupported. Clear it.
603+
*/
604+
pcie_clear_aspm(root->bus);
605+
}
599606
} else {
600607
dev_info(root->bus->bridge,
601608
"ACPI _OSC request failed (%s), "

0 commit comments

Comments
 (0)