1
0
Fork 0
alistair23-linux/drivers/iommu
Zhen Lei 086c83acb7 iommu/iova: Optimise the padding calculation
The mask for calculating the padding size doesn't change, so there's no
need to recalculate it every loop iteration. Furthermore, Once we've
done that, it becomes clear that we don't actually need to calculate a
padding size at all - by flipping the arithmetic around, we can just
combine the upper limit, size, and mask directly to check against the
lower limit.

For an arm64 build, this alone knocks 20% off the object code size of
the entire alloc_iova() function!

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Zhen Lei <thunder.leizhen@huawei.com>
Tested-by: Nate Watterson <nwatters@codeaurora.org>
[rm: simplified more of the arithmetic, rewrote commit message]
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2017-09-27 17:09:56 +02:00
..
Kconfig iommu/qcom: Depend on HAS_DMA to fix compile error 2017-09-19 15:30:41 +02:00
Makefile iommu/qcom: Add qcom_iommu 2017-08-15 17:34:49 +02:00
amd_iommu.c IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07:00
amd_iommu_init.c IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07:00
amd_iommu_proto.h IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07:00
amd_iommu_types.h IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07:00
amd_iommu_v2.c IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07: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/arm-smmu-v3: Implement shutdown method 2017-08-16 17:27:28 +01:00
arm-smmu.c Merge branches 'arm/exynos', 'arm/renesas', 'arm/rockchip', 'arm/omap', 'arm/mediatek', 'arm/tegra', 'arm/qcom', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-09-01 11:31:42 +02:00
dma-iommu.c IOMMU Updates for Linux v4.13 2017-07-12 10:00:04 -07:00
dmar.c iommu/vt-d: Fix harmless section mismatch warning 2017-09-19 11:44:46 +02:00
exynos-iommu.c iommu/exynos: Constify iommu_ops 2017-08-30 15:13:54 +02:00
fsl_pamu.c Merge branches 'arm/exynos', 'arm/renesas', 'arm/rockchip', 'arm/omap', 'arm/mediatek', 'arm/tegra', 'arm/qcom', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-09-01 11:31:42 +02: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/exynos', 'arm/renesas', 'arm/rockchip', 'arm/omap', 'arm/mediatek', 'arm/tegra', 'arm/qcom', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-09-01 11:31:42 +02:00
fsl_pamu_domain.h iommu/pamu: Fix PAMU boot crash 2017-08-23 16:28:09 +02:00
intel-iommu.c IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07:00
intel-svm.c IOMMU Updates for Linux v4.14 2017-09-09 15:03:24 -07:00
intel_irq_remapping.c IOMMU Updates for Linux v4.13 2017-07-12 10:00:04 -07:00
io-pgtable-arm-v7s.c iommu/io-pgtable: Sanitise map/unmap addresses 2017-07-20 10:30:28 +01:00
io-pgtable-arm.c iommu/io-pgtable: Sanitise map/unmap addresses 2017-07-20 10:30:28 +01:00
io-pgtable.c iommu/io-pgtable: Fix a brace coding style issue. 2016-04-05 15:34:29 +02:00
io-pgtable.h Revert "iommu/io-pgtable: Avoid redundant TLB syncs" 2017-07-20 10:30:27 +01:00
iommu-sysfs.c iommu: Fix wrong freeing of iommu_device->dev 2017-08-15 13:58:48 +02:00
iommu-traces.c iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
iommu.c Merge branches 'arm/exynos', 'arm/renesas', 'arm/rockchip', 'arm/omap', 'arm/mediatek', 'arm/tegra', 'arm/qcom', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-09-01 11:31:42 +02:00
iova.c iommu/iova: Optimise the padding calculation 2017-09-27 17:09:56 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Make ipmmu_gather_ops const 2017-08-30 15:10:53 +02:00
irq_remapping.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
irq_remapping.h iommu, x86: Setup Posted-Interrupts capability for Intel iommu 2015-06-12 11:33:52 +02:00
msm_iommu.c iommu/msm: Add iommu_group support 2017-08-10 00:03:50 +02: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 iommu/mediatek: Fix a build warning of BIT(32) in ARM 2017-08-28 11:26:21 +02:00
mtk_iommu.h iommu/mediatek: Merge 2 M4U HWs into one iommu domain 2017-08-22 16:37:59 +02:00
mtk_iommu_v1.c iommu/mediatek: Include linux/dma-mapping.h 2017-05-17 14:51:54 +02:00
of_iommu.c iommu/of: Remove PCI host bridge node check 2017-09-22 12:05:43 +02:00
omap-iommu-debug.c iommu/omap: Align code with open parenthesis 2016-04-05 17:53:20 +02:00
omap-iommu.c iommu/omap: Use DMA-API for performing cache flushes 2017-08-04 11:59:29 +02:00
omap-iommu.h iommu/omap: Use DMA-API for performing cache flushes 2017-08-04 11:59:29 +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: qcom: annotate PM functions as __maybe_unused 2017-08-28 11:24:52 +02:00
rockchip-iommu.c Merge branches 'arm/exynos', 'arm/renesas', 'arm/rockchip', 'arm/omap', 'arm/mediatek', 'arm/tegra', 'arm/qcom', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd', 's390' and 'core' into next 2017-09-01 11:31:42 +02:00
s390-iommu.c iommu/s390: Constify iommu_ops 2017-08-30 17:53:29 +02:00
tegra-gart.c iommu/tegra-gart: Add support for struct iommu_device 2017-08-17 16:31:34 +02:00
tegra-smmu.c arm/tegra: Call bus_set_iommu() after iommu_device_register() 2017-08-30 17:28:32 +02:00