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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user