IOMMU Fixes for Linux v5.7-rc3

Including:
 
 	- Fix for a memory leak when dev_iommu gets freed and a
 	  sub-pointer does not.
 
 	- Build dependency fixes for Mediatek, spapr_tce, and
 	  Intel IOMMU driver.
 
 	- Export iommu_group_get_for_dev() only for GPLed modules
 
 	- Fix for AMD IOMMU interrupt remapping when x2apic is
 	  enabled
 
 	- Fix for error path in the QCOM IOMMU driver probe function
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAl6utJ0ACgkQK/BELZcB
 GuN0tBAAt2ceqERBSsoAzHQ9pYuttFd3r+pXyzaXtJocyMf+cLPRVGHrfSDp0ISw
 nri3h0bZaf1uuYOCGyk9QDoQBXfQpmb5GVq0ynd0d4R2/H/40POWGa1+tzTMyuAX
 JzzMz2TFAecOUrUi4lGztvPV7MKyXdllg633cmu3OOwx368aucfxl+wNrfFsJGld
 wrQtoDqSgcpL7g/1lKMExOk5rDS4v2J+qmWdMpaKoxojf2imyEETb5MQSS4Zj/q0
 QAtV5WE1vG5JEwR70A+ztJU/38puzV5avJZxhaCCx81Xc33ymiDFJWvn31fVS50M
 2I4WPNCrtYrClKBpXycM4pM2sNFXh8KM0RO3Uc+PlsxMk4yW5wwfzdX6htmLmxPk
 eGT2BJelwxac6DKUjt1c87W1eHQJIa1bKjdvMchC2TjkZm8AITK7cGaTKVTJsT90
 8YSmDrTqnqj/+DUp+Du+MR8s0gMidfys4hK1i8U4mSt5x/eZff1FgwYA4jZO+0ZX
 x+plV+ZxqYZyOJRY8mHA+qj0gprFSMOuoN8xe/54MQTb06vdSpvybpA5TWKSQ/gg
 LFDjweB6cL26s8/MGjwkQNF9JLRkiETbXAXqmO4PUxOsTEDCTYXjq8fgq0eioVbZ
 /nKQaoRcZWlL+dN20Pbjs3ELEZOPzdt8fqyHNmwXtJ0OIIl3N/M=
 =UhNC
 -----END PGP SIGNATURE-----

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

Pull IOMMU fixes from Joerg Roedel:

 - Fix a memory leak when dev_iommu gets freed and a sub-pointer does
   not

 - Build dependency fixes for Mediatek, spapr_tce, and Intel IOMMU
   driver

 - Export iommu_group_get_for_dev() only for GPLed modules

 - Fix AMD IOMMU interrupt remapping when x2apic is enabled

 - Fix error path in the QCOM IOMMU driver probe function

* tag 'iommu-fixes-v5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/qcom: Fix local_base status check
  iommu: Properly export iommu_group_get_for_dev()
  iommu/vt-d: Use right Kconfig option name
  iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system
  iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config
  iommu/mediatek: Fix MTK_IOMMU dependencies
  iommu: Fix the memory leak in dev_iommu_free()
This commit is contained in:
Linus Torvalds 2020-05-03 11:04:57 -07:00
commit ea91593350
5 changed files with 11 additions and 7 deletions

View File

@ -362,7 +362,7 @@ config IPMMU_VMSA
config SPAPR_TCE_IOMMU config SPAPR_TCE_IOMMU
bool "sPAPR TCE IOMMU Support" bool "sPAPR TCE IOMMU Support"
depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST) depends on PPC_POWERNV || PPC_PSERIES
select IOMMU_API select IOMMU_API
help help
Enables bits of IOMMU API required by VFIO. The iommu_ops Enables bits of IOMMU API required by VFIO. The iommu_ops
@ -457,7 +457,7 @@ config S390_AP_IOMMU
config MTK_IOMMU config MTK_IOMMU
bool "MTK IOMMU Support" bool "MTK IOMMU Support"
depends on ARM || ARM64 || COMPILE_TEST depends on HAS_DMA
depends on ARCH_MEDIATEK || COMPILE_TEST depends on ARCH_MEDIATEK || COMPILE_TEST
select ARM_DMA_USE_IOMMU select ARM_DMA_USE_IOMMU
select IOMMU_API select IOMMU_API

View File

@ -2936,7 +2936,7 @@ static int __init parse_amd_iommu_intr(char *str)
{ {
for (; *str; ++str) { for (; *str; ++str) {
if (strncmp(str, "legacy", 6) == 0) { if (strncmp(str, "legacy", 6) == 0) {
amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY; amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY_GA;
break; break;
} }
if (strncmp(str, "vapic", 5) == 0) { if (strncmp(str, "vapic", 5) == 0) {

View File

@ -371,11 +371,11 @@ int dmar_disabled = 0;
int dmar_disabled = 1; int dmar_disabled = 1;
#endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */ #endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */
#ifdef INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON #ifdef CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
int intel_iommu_sm = 1; int intel_iommu_sm = 1;
#else #else
int intel_iommu_sm; int intel_iommu_sm;
#endif /* INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */ #endif /* CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
int intel_iommu_enabled = 0; int intel_iommu_enabled = 0;
EXPORT_SYMBOL_GPL(intel_iommu_enabled); EXPORT_SYMBOL_GPL(intel_iommu_enabled);

View File

@ -170,6 +170,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev)
static void dev_iommu_free(struct device *dev) static void dev_iommu_free(struct device *dev)
{ {
iommu_fwspec_free(dev);
kfree(dev->iommu); kfree(dev->iommu);
dev->iommu = NULL; dev->iommu = NULL;
} }
@ -1428,7 +1429,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
return group; return group;
} }
EXPORT_SYMBOL(iommu_group_get_for_dev); EXPORT_SYMBOL_GPL(iommu_group_get_for_dev);
struct iommu_domain *iommu_group_default_domain(struct iommu_group *group) struct iommu_domain *iommu_group_default_domain(struct iommu_group *group)
{ {

View File

@ -824,8 +824,11 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
qcom_iommu->dev = dev; qcom_iommu->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res) if (res) {
qcom_iommu->local_base = devm_ioremap_resource(dev, res); qcom_iommu->local_base = devm_ioremap_resource(dev, res);
if (IS_ERR(qcom_iommu->local_base))
return PTR_ERR(qcom_iommu->local_base);
}
qcom_iommu->iface_clk = devm_clk_get(dev, "iface"); qcom_iommu->iface_clk = devm_clk_get(dev, "iface");
if (IS_ERR(qcom_iommu->iface_clk)) { if (IS_ERR(qcom_iommu->iface_clk)) {