IOMMU Fixes for Linux v4.14-rc4

Three fixes:
 
 	- Keep an important data structure in the Exynos driver around
 	  after kernel-init to fix a kernel-oops
 
 	- Keep SWIOTLB enabled when SME is active in the AMD IOMMU
 	  driver
 
 	- Add a missing IOTLB sync to the AMD IOMMU driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJZ4N1tAAoJECvwRC2XARrjcSUQAKCKqEdHdwDTFqePcKn/0PzY
 ES32fokdA1R12ssNTDc3yVMDSApQF0XdZ7Szz9BtGCvklT7ZFfL6hTyR8dfsnA6n
 MLH3j5cKJS6fnhUbK5wMKNHnsOanjkUIwROvtV5YLghKT9+Sf+YBeiv6yUfqrk+m
 7/VoY9k/TgKO9E37ji5kMCBOI+J/QZQONEbMLNR9OmKQkMEA/fvpxlSAEVin+9T0
 0eg8awtFjUZaSTfIQTEdLoc4Fw8PuftBYDNq4wYTSHII7TZ46qPQpfPdGrytd0Lp
 uQ75kYZEXvhaUpA8AvSRdoQqA0hLM76BUjL1u/78ZlitsqfEGSHvkFAirSGFtH4z
 D/NybUVAxvpclaBZy1qIITdM+odsNy8H/duJzwr1ETdhTzsZioYBenyzOgWjMd85
 zeu32dSyblLkYEDFNjbDZM2dvBjXlcQHZ3yoouD5AbSOF04ajzBoZInx2VlyqMVA
 v2Zjj/Vmetu+yiB+yWvfiCKH1mmfzMiQyHW6jf5A7M2yrqJ1471Jdo3bqwAKRvkN
 3b3H19a6dQWTDwW8eBTa46nt8Agb2miXs+mFuy6mC7iSD1b8/saoeXvJOjnwYfug
 Pb9m7m9wIWmPi47edzdWHNQMGx/LwMOjPFjfeXnn8oHMDjpYWPB82/5bFMczvOWK
 rsj7q10FbEjhoFa319I7
 =RLFr
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:

 - keep an important data structure in the Exynos driver around after
   kernel-init to fix a kernel-oops

 - keep SWIOTLB enabled when SME is active in the AMD IOMMU driver

 - add a missing IOTLB sync to the AMD IOMMU driver

* tag 'iommu-fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/amd: Finish TLB flush in amd_iommu_unmap()
  iommu/exynos: Remove initconst attribute to avoid potential kernel oops
  iommu/amd: Do not disable SWIOTLB if SME is active
This commit is contained in:
Linus Torvalds 2017-10-13 11:49:38 -07:00
commit 997301a860
2 changed files with 8 additions and 5 deletions

View File

@ -2773,14 +2773,16 @@ int __init amd_iommu_init_api(void)
int __init amd_iommu_init_dma_ops(void)
{
swiotlb = iommu_pass_through ? 1 : 0;
swiotlb = (iommu_pass_through || sme_me_mask) ? 1 : 0;
iommu_detected = 1;
/*
* In case we don't initialize SWIOTLB (actually the common case
* when AMD IOMMU is enabled), make sure there are global
* dma_ops set as a fall-back for devices not handled by this
* driver (for example non-PCI devices).
* when AMD IOMMU is enabled and SME is not active), make sure there
* are global dma_ops set as a fall-back for devices not handled by
* this driver (for example non-PCI devices). When SME is active,
* make sure that swiotlb variable remains set so the global dma_ops
* continue to be SWIOTLB.
*/
if (!swiotlb)
dma_ops = &nommu_dma_ops;
@ -3046,6 +3048,7 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,
mutex_unlock(&domain->api_lock);
domain_flush_tlb_pde(domain);
domain_flush_complete(domain);
return unmap_size;
}

View File

@ -709,7 +709,7 @@ static const struct dev_pm_ops sysmmu_pm_ops = {
pm_runtime_force_resume)
};
static const struct of_device_id sysmmu_of_match[] __initconst = {
static const struct of_device_id sysmmu_of_match[] = {
{ .compatible = "samsung,exynos-sysmmu", },
{ },
};