diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-05 21:46:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-05 21:46:26 -0400 |
commit | 3f583bc21977a608908b83d03ee2250426a5695c (patch) | |
tree | 05ddffa3804cda744d9b68796d5f2c9a0ff5e1df /drivers/iommu/amd_iommu_init.c | |
parent | 3e76b749ea09a6411ceb33e6fd47f20eb6df268b (diff) | |
parent | e172b81222548b856ecbe59b305d2cb733d512c4 (diff) |
Merge tag 'iommu-updates-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU upates from Joerg Roedel:
"This time a few more updates queued up.
- Rework VT-d code to support ACPI devices
- Improvements for memory and PCI hotplug support in the VT-d driver
- Device-tree support for OMAP IOMMU
- Convert OMAP IOMMU to use devm_* interfaces
- Fixed PASID support for AMD IOMMU
- Other random cleanups and fixes for OMAP, ARM-SMMU and SHMOBILE
IOMMU
Most of the changes are in the VT-d driver because some rework was
necessary for better hotplug and ACPI device support"
* tag 'iommu-updates-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (75 commits)
iommu/vt-d: Fix error handling in ANDD processing
iommu/vt-d: returning free pointer in get_domain_for_dev()
iommu/vt-d: Only call dmar_acpi_dev_scope_init() if DRHD units present
iommu/vt-d: Check for NULL pointer in dmar_acpi_dev_scope_init()
iommu/amd: Fix logic to determine and checking max PASID
iommu/vt-d: Include ACPI devices in iommu=pt
iommu/vt-d: Finally enable translation for non-PCI devices
iommu/vt-d: Remove to_pci_dev() in intel_map_page()
iommu/vt-d: Remove pdev from intel_iommu_attach_device()
iommu/vt-d: Remove pdev from iommu_no_mapping()
iommu/vt-d: Make domain_add_dev_info() take struct device
iommu/vt-d: Make domain_remove_one_dev_info() take struct device
iommu/vt-d: Rename 'hwdev' variables to 'dev' now that that's the norm
iommu/vt-d: Remove some pointless to_pci_dev() calls
iommu/vt-d: Make get_valid_domain_for_dev() take struct device
iommu/vt-d: Make iommu_should_identity_map() take struct device
iommu/vt-d: Handle RMRRs for non-PCI devices
iommu/vt-d: Make get_domain_for_dev() take struct device
iommu/vt-d: Make domain_context_mapp{ed,ing}() take struct device
iommu/vt-d: Make device_to_iommu() cope with non-PCI devices
...
Diffstat (limited to 'drivers/iommu/amd_iommu_init.c')
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 28b4bea7c109..b76c58dbe30c 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -150,7 +150,7 @@ int amd_iommus_present; | |||
150 | bool amd_iommu_np_cache __read_mostly; | 150 | bool amd_iommu_np_cache __read_mostly; |
151 | bool amd_iommu_iotlb_sup __read_mostly = true; | 151 | bool amd_iommu_iotlb_sup __read_mostly = true; |
152 | 152 | ||
153 | u32 amd_iommu_max_pasids __read_mostly = ~0; | 153 | u32 amd_iommu_max_pasid __read_mostly = ~0; |
154 | 154 | ||
155 | bool amd_iommu_v2_present __read_mostly; | 155 | bool amd_iommu_v2_present __read_mostly; |
156 | bool amd_iommu_pc_present __read_mostly; | 156 | bool amd_iommu_pc_present __read_mostly; |
@@ -1231,14 +1231,16 @@ static int iommu_init_pci(struct amd_iommu *iommu) | |||
1231 | 1231 | ||
1232 | if (iommu_feature(iommu, FEATURE_GT)) { | 1232 | if (iommu_feature(iommu, FEATURE_GT)) { |
1233 | int glxval; | 1233 | int glxval; |
1234 | u32 pasids; | 1234 | u32 max_pasid; |
1235 | u64 shift; | 1235 | u64 pasmax; |
1236 | 1236 | ||
1237 | shift = iommu->features & FEATURE_PASID_MASK; | 1237 | pasmax = iommu->features & FEATURE_PASID_MASK; |
1238 | shift >>= FEATURE_PASID_SHIFT; | 1238 | pasmax >>= FEATURE_PASID_SHIFT; |
1239 | pasids = (1 << shift); | 1239 | max_pasid = (1 << (pasmax + 1)) - 1; |
1240 | 1240 | ||
1241 | amd_iommu_max_pasids = min(amd_iommu_max_pasids, pasids); | 1241 | amd_iommu_max_pasid = min(amd_iommu_max_pasid, max_pasid); |
1242 | |||
1243 | BUG_ON(amd_iommu_max_pasid & ~PASID_MASK); | ||
1242 | 1244 | ||
1243 | glxval = iommu->features & FEATURE_GLXVAL_MASK; | 1245 | glxval = iommu->features & FEATURE_GLXVAL_MASK; |
1244 | glxval >>= FEATURE_GLXVAL_SHIFT; | 1246 | glxval >>= FEATURE_GLXVAL_SHIFT; |