Re: [PATCH 0/6] iommu/vt-d: Fixes and cleanups for linux-next
From: Qian Cai
Date: Tue Jun 11 2019 - 12:59:37 EST
On Sun, 2019-06-09 at 10:37 +0800, Lu Baolu wrote:
> Hi Joerg,
>
> This series includes several fixes and cleanups after delegating
> DMA domain to generic iommu. Please review and consider them for
> linux-next.
>
> Best regards,
> Baolu
>
> Lu Baolu (5):
> Â iommu/vt-d: Don't return error when device gets right domain
> Â iommu/vt-d: Set domain type for a private domain
> Â iommu/vt-d: Don't enable iommu's which have been ignored
> Â iommu/vt-d: Fix suspicious RCU usage in probe_acpi_namespace_devices()
> Â iommu/vt-d: Consolidate domain_init() to avoid duplication
>
> Sai Praneeth Prakhya (1):
> Â iommu/vt-d: Cleanup after delegating DMA domain to generic iommu
>
> Âdrivers/iommu/intel-iommu.c | 210 +++++++++---------------------------
> Â1 file changed, 53 insertions(+), 157 deletions(-)
>
BTW, the linux-next commit "iommu/vt-d: Expose ISA direct mapping region via
iommu_get_resv_regions" [1] also introduced a memory leak below, as it forgets
to ask intel_iommu_put_resv_regions() to call kfree() when
CONFIG_INTEL_IOMMU_FLOPPY_WA=y.
[1] https://lore.kernel.org/patchwork/patch/1078963/
unreferenced object 0xffff88912ef789c8 (size 64):
 comm "swapper/0", pid 1, jiffies 4294946232 (age 5399.530s)
 hex dump (first 32 bytes):
ÂÂÂÂ48 83 f7 2e 91 88 ff ff 30 fa e3 00 82 88 ff ffÂÂH.......0.......
ÂÂÂÂ00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00ÂÂ................
 backtrace:
ÂÂÂÂ[<00000000d267f4be>] kmem_cache_alloc_trace+0x266/0x380
ÂÂÂÂ[<00000000d383d15b>] iommu_alloc_resv_region+0x40/0xb0
ÂÂÂÂ[<00000000db8be31b>] intel_iommu_get_resv_regions+0x25e/0x2d0
ÂÂÂÂ[<0000000021fbc6c3>] iommu_group_create_direct_mappings+0x159/0x3d0
ÂÂÂÂ[<0000000022259268>] iommu_group_add_device+0x17b/0x4f0
ÂÂÂÂ[<0000000028b91093>] iommu_group_get_for_dev+0x153/0x460
ÂÂÂÂ[<00000000577c33b4>] intel_iommu_add_device+0xc4/0x210
ÂÂÂÂ[<00000000587b7492>] iommu_probe_device+0x63/0x80
ÂÂÂÂ[<000000004aa997d1>] add_iommu_group+0xe/0x20
ÂÂÂÂ[<00000000c93a9cd6>] bus_for_each_dev+0xf0/0x150
ÂÂÂÂ[<00000000a2e5f0cb>] bus_set_iommu+0xc6/0x100
ÂÂÂÂ[<00000000dbad5db0>] intel_iommu_init+0x682/0xb0a
ÂÂÂÂ[<00000000226f7444>] pci_iommu_init+0x26/0x62
ÂÂÂÂ[<000000002d8694f5>] do_one_initcall+0xe5/0x3ea
ÂÂÂÂ[<000000004bc60101>] kernel_init_freeable+0x5ad/0x640
ÂÂÂÂ[<0000000091b0bad6>] kernel_init+0x11/0x138