1
0
Fork 0
alistair23-linux/drivers/iommu
Nicolas Boichat 0a352554da iommu/io-pgtable-arm-v7s: request DMA32 memory, and improve debugging
IOMMUs using ARMv7 short-descriptor format require page tables (level 1
and 2) to be allocated within the first 4GB of RAM, even on 64-bit
systems.

For level 1/2 pages, ensure GFP_DMA32 is used if CONFIG_ZONE_DMA32 is
defined (e.g.  on arm64 platforms).

For level 2 pages, allocate a slab cache in SLAB_CACHE_DMA32.  Note that
we do not explicitly pass GFP_DMA[32] to kmem_cache_zalloc, as this is
not strictly necessary, and would cause a warning in mm/sl*b.c, as we
did not update GFP_SLAB_BUG_MASK.

Also, print an error when the physical address does not fit in
32-bit, to make debugging easier in the future.

Link: http://lkml.kernel.org/r/20181210011504.122604-3-drinkcat@chromium.org
Fixes: ad67f5a654 ("arm64: replace ZONE_DMA with ZONE_DMA32")
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Huaisheng Ye <yehs1@lenovo.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Sasha Levin <Alexander.Levin@microsoft.com>
Cc: Tomasz Figa <tfiga@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
Cc: Yong Wu <yong.wu@mediatek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-29 10:01:37 -07:00
..
Kconfig Merge branches 'iommu/fixes', 'arm/msm', 'arm/tegra', 'arm/mediatek', 'x86/vt-d', 'x86/amd', 'hyper-v' and 'core' into next 2019-03-01 11:24:51 +01:00
Makefile iommu/hyper-v: Add Hyper-V stub IOMMU driver 2019-02-28 11:12:16 +01:00
amd_iommu.c iommu/amd: fix sg->dma_address for sg->offset bigger than PAGE_SIZE 2019-03-18 11:13:35 +01:00
amd_iommu_debugfs.c iommu/amd: Add basic debugfs infrastructure for AMD IOMMU 2018-07-06 14:06:30 +02:00
amd_iommu_init.c iommu/amd: Use dev_printk() when possible 2019-02-11 12:06:39 +01:00
amd_iommu_proto.h iommu/amd: Add basic debugfs infrastructure for AMD IOMMU 2018-07-06 14:06:30 +02:00
amd_iommu_types.h iommu/amd: Ignore page-mode 7 in free_sub_pt() 2018-11-15 16:40:53 +01:00
amd_iommu_v2.c iommu/amd: Remove clear_flush_young notifier 2019-01-30 17:30:46 +01:00
arm-smmu-regs.h iommu/arm-smmu: Split out register defines 2017-08-15 17:34:48 +02:00
arm-smmu-v3.c iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
arm-smmu.c iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
dma-iommu.c iommu/dma: Remove unused variable 2019-01-24 15:14:35 +01:00
dmar.c mm: replace all open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
exynos-iommu.c IOMMU: Make dwo drivers use stateless device links 2019-02-01 10:04:08 +01:00
fsl_pamu.c iommu: fsl_pamu: use for_each_of_cpu_node iterator 2018-09-28 14:25:58 -05:00
fsl_pamu.h iommu/pamu: Fix PAMU boot crash 2017-08-23 16:28:09 +02:00
fsl_pamu_domain.c Merge branches 'arm/renesas', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd' and 'core' into next 2018-10-10 18:09:37 +02:00
fsl_pamu_domain.h iommu/pamu: Fix PAMU boot crash 2017-08-23 16:28:09 +02:00
hyperv-iommu.c iommu/hyper-v: Add Hyper-V stub IOMMU driver 2019-02-28 11:12:16 +01:00
intel-iommu-debugfs.c iommu/vt-d: Add debugfs support to show context internals 2018-09-25 14:33:44 +02:00
intel-iommu.c iommu/vt-d: Save the right domain ID used by hardware 2019-03-22 12:02:27 +01:00
intel-pasid.c iommu/vt-d: Get domain ID before clear pasid entry 2019-03-01 10:23:36 +01:00
intel-pasid.h iommu/vt-d: Shared virtual address in scalable mode 2018-12-11 10:46:00 +01:00
intel-svm.c iommu/vt-d: Fix NULL pointer reference in intel_svm_bind_mm() 2019-03-01 10:23:36 +01:00
intel_irq_remapping.c iommu/vt-d: Allow interrupts from the entire bus for aliased devices 2019-02-26 10:34:03 +01:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: request DMA32 memory, and improve debugging 2019-03-29 10:01:37 -07:00
io-pgtable-arm.c iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
io-pgtable.c iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
iommu-debugfs.c iommu: Fix IOMMU debugfs fallout 2019-02-26 11:15:58 +01:00
iommu-sysfs.c iommu/sysfs: Rename iommu_release_device() 2018-12-17 12:47:49 +01:00
iommu-traces.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iommu.c Merge branches 'iommu/fixes', 'arm/msm', 'arm/tegra', 'arm/mediatek', 'x86/vt-d', 'x86/amd', 'hyper-v' and 'core' into next 2019-03-01 11:24:51 +01:00
iova.c iommu/iova: Fix tracking of recently failed iova address 2019-03-22 12:01:58 +01:00
ipmmu-vmsa.c iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
irq_remapping.c iommu/hyper-v: Add Hyper-V stub IOMMU driver 2019-02-28 11:12:16 +01:00
irq_remapping.h iommu/hyper-v: Add Hyper-V stub IOMMU driver 2019-02-28 11:12:16 +01:00
msm_iommu.c Merge branches 'iommu/fixes', 'arm/msm', 'arm/tegra', 'arm/mediatek', 'x86/vt-d', 'x86/amd', 'hyper-v' and 'core' into next 2019-03-01 11:24:51 +01:00
msm_iommu.h iommu/msm: Make use of iommu_device_register interface 2017-02-10 13:44:57 +01:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
mtk_iommu.c Merge branches 'iommu/fixes', 'arm/renesas', 'arm/mediatek', 'arm/tegra', 'arm/omap', 'arm/smmu', 'x86/vt-d', 'x86/amd' and 'core' into next 2018-12-20 10:05:20 +01:00
mtk_iommu.h iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
mtk_iommu_v1.c iommu/mediatek: Fix semicolon code style issue 2019-03-01 10:17:56 +01:00
of_iommu.c iommu/of: Fix probe-deferral 2019-01-11 12:28:24 +01:00
omap-iommu-debug.c iommu/omap: Remove DEBUG_SEQ_FOPS_RO() 2018-11-22 17:10:43 +01:00
omap-iommu.c Merge branches 'arm/shmobile', 'arm/renesas', 'arm/msm', 'arm/smmu', 'arm/omap', 'x86/amd', 'x86/vt-d' and 'core' into next 2018-08-08 12:02:27 +02:00
omap-iommu.h iommu/omap: Add support to program multiple iommus 2017-09-19 11:32:05 +02:00
omap-iopgtable.h iommu/omap: Use BIT(x) macros in omap-iopgtable.h 2015-08-03 16:04:42 +02:00
qcom_iommu.c iommu: Allow io-pgtable to be used outside of drivers/iommu/ 2019-02-11 11:26:48 +01:00
rockchip-iommu.c IOMMU: Make dwo drivers use stateless device links 2019-02-01 10:04:08 +01:00
s390-iommu.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tegra-gart.c iommu/tegra: gart: Perform code refactoring 2019-01-16 13:54:16 +01:00
tegra-smmu.c memory: tegra: Do not try to probe SMMU on Tegra20 2019-01-16 13:54:13 +01:00