IOMMU Fixes for Linux v3.19-rc3

Including:
 
 	* A domain structure leak fix in the Intel VT-d driver
 
 	* Compile error fix for the VMSA IPMMU driver because of the
 	  IOMMU_EXEC -> IOMMU_NOEXEC conversion
 
 	* Two small cleanups as an aftermath of the merge window and the
 	  domain-leak fix
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJUrU8AAAoJECvwRC2XARrjMLwP/3bv9V+bX4JdCDb0pIY/69kC
 +7pQqrE1la4yFVYGwGrzUD8mcswkMudc0j+mgmWZAoM73AV7k9qTcPRhtOPDIijn
 nE1JezbY0CHjkW2QnKkT9HLMoC5xxESurc1FFeNnAfQD3Lx9T9ZMcsnyT5z3AxHc
 IhqWtRC1bcqEUXmnGCm+VjnzsVH4sxSWc7tGkS6gMflqjQgAd8Fla9EeStwQo0rX
 g139MuS7m1CwPLh9yXN0sQ1PWdczYy3o3p4Q0j+XUtGdJalmSS32NcoJYBHVQgJf
 IzOFqCvVgzWtaiYS9YqKSX+dOJ3sUlK1q8XPikCoDX6TcipTpEirKdzqxmEXCM8h
 WZ0GMfFzSerCfVR9imlKiTuei1SM4t/hQy0VBqA1gOwVb50RVeyUDIRlDECPpnJT
 9uZuB1B5kHGXmpiJ7cUDZjUHnx/wH/mEuJj1eSMXr+KEEMu9QQpM4JgK1eKz5Vw3
 qaaJBOQuccPj2tOgW7TN5liHL2rj+KkDtDGgeUX+sga0yenV0zNfa6Qe5gEt2BFu
 fMHJlrKjabMouPB0Vx5R221/Q1ZdzZkFZ2xsyyk02yQqNrvYB6n0ZEreuq39tPfJ
 XIfIfOTHzpw4DxrGsaK2D8mTOtlnhwFnsalE92pMhE2eU3jprpa3MRDMz9vvPRnu
 7lUl8pv2C8chfBh1miVy
 =e3/b
 -----END PGP SIGNATURE-----

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

Pull IOMMU fixes from Joerg Roedel:
 "Including:

   - a domain structure leak fix in the Intel VT-d driver

   - compile error fix for the VMSA IPMMU driver because of the
     IOMMU_EXEC -> IOMMU_NOEXEC conversion

   - two small cleanups as an aftermath of the merge window and the
     domain-leak fix"

* tag 'iommu-fixes-v3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/rockchip: Drop owner assignment from platform_drivers
  iommu/vt-d: Remove dead code in device_notifier
  iommu/vt-d: Fix dmar_domain leak in iommu_attach_device
  iommu/ipmmu-vmsa: Change IOMMU_EXEC to IOMMU_NOEXEC
This commit is contained in:
Linus Torvalds 2015-01-08 12:07:34 -08:00
commit 1c169383c8
3 changed files with 7 additions and 12 deletions

View file

@ -4029,14 +4029,6 @@ static int device_notifier(struct notifier_block *nb,
if (action != BUS_NOTIFY_REMOVED_DEVICE)
return 0;
/*
* If the device is still attached to a device driver we can't
* tear down the domain yet as DMA mappings may still be in use.
* Wait for the BUS_NOTIFY_UNBOUND_DRIVER event to do that.
*/
if (action == BUS_NOTIFY_DEL_DEVICE && dev->driver != NULL)
return 0;
domain = find_domain(dev);
if (!domain)
return 0;
@ -4428,6 +4420,10 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
domain_remove_one_dev_info(old_domain, dev);
else
domain_remove_dev_info(old_domain);
if (!domain_type_is_vm_or_si(old_domain) &&
list_empty(&old_domain->devices))
domain_exit(old_domain);
}
}

View file

@ -558,7 +558,7 @@ static pmd_t *ipmmu_alloc_pmd(struct ipmmu_vmsa_device *mmu, pgd_t *pgd,
static u64 ipmmu_page_prot(unsigned int prot, u64 type)
{
u64 pgprot = ARM_VMSA_PTE_XN | ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF
u64 pgprot = ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF
| ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV
| ARM_VMSA_PTE_NS | type;
@ -568,8 +568,8 @@ static u64 ipmmu_page_prot(unsigned int prot, u64 type)
if (prot & IOMMU_CACHE)
pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT;
if (prot & IOMMU_EXEC)
pgprot &= ~ARM_VMSA_PTE_XN;
if (prot & IOMMU_NOEXEC)
pgprot |= ARM_VMSA_PTE_XN;
else if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
/* If no access create a faulting entry to avoid TLB fills. */
pgprot &= ~ARM_VMSA_PTE_PAGE;

View file

@ -1009,7 +1009,6 @@ static struct platform_driver rk_iommu_driver = {
.remove = rk_iommu_remove,
.driver = {
.name = "rk_iommu",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(rk_iommu_dt_ids),
},
};