mirror-linux/drivers/iommu
Arnd Bergmann 4c9ad387aa iommu, debugobjects: avoid gcc-16.1 section mismatch warnings
gcc-16 has gained some more advanced inter-procedual optimization
techniques that enable it to inline the dummy_tlb_add_page() and
dummy_tlb_flush() function pointers into a specialized version of
__arm_v7s_unmap:

WARNING: modpost: vmlinux: section mismatch in reference: __arm_v7s_unmap+0x2cc (section: .text) -> dummy_tlb_add_page (section: .init.text)
ERROR: modpost: Section mismatches detected.

>From what I can tell, the transformation is correct, as this is only
called when __arm_v7s_unmap() is called from arm_v7s_do_selftests(),
which is also __init. Since __arm_v7s_unmap() however is not __init,
gcc cannot inline the inner function calls directly.

In debug_objects_selftest(), the same thing happens. Both the
caller and the leaf function are __init, but the IPA pulls
it into a non-init one:

WARNING: modpost: vmlinux: section mismatch in reference: lookup_object_or_alloc+0x7c (section: .text.lookup_object_or_alloc) -> is_static_object (section: .init.text)

Marking the affected functions as not "__init" would reliably avoid this
issue but is not a good solution because it removes an otherwise correct
annotation. I tried marking the functions as 'noinline', but that ended
up not covering all the affected configurations.

With some more experimenting, I found that marking these functions as
__attribute__((noipa)) is both logical and reliable.

In order to keep the syntax readable, add a custom macro for this in
include/linux/compiler_attributes.h next to other related macros and
use it to annotate both files.

Link: https://lore.kernel.org/all/abRB6g-48ZX6Yl2r@willie-the-truck/
Cc: Will Deacon <will@kernel.org>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2026-05-28 09:07:12 +02:00
..
amd iommu/amd: Bounds-check devid in __rlookup_amd_iommu() 2026-05-11 10:07:52 +02:00
arm Merge branches 'fixes', 'arm/smmu/updates', 'arm/smmu/bindings', 'riscv', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2026-04-09 13:18:27 +01:00
generic_pt iommupt: Fix the end_index calculation in __map_range_leaf() 2026-05-15 07:29:16 +02:00
intel iommu/vt-d: Simplify calculate_psi_aligned_address() 2026-05-19 10:38:19 +02:00
iommufd iommufd v7.1 merge window pull request 2026-04-16 21:21:55 -07:00
riscv Merge branches 'fixes', 'arm/smmu/updates', 'arm/smmu/bindings', 'riscv', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2026-04-09 13:18:27 +01:00
Kconfig iommu: Add page_ext for IOMMU_DEBUG_PAGEALLOC 2026-01-10 10:52:25 +01:00
Makefile iommu: Add page_ext for IOMMU_DEBUG_PAGEALLOC 2026-01-10 10:52:25 +01:00
apple-dart.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dma-iommu.c dma-mapping updates for Linux 7.0: 2026-04-17 11:12:42 -07:00
dma-iommu.h iommu: Tidy domain for iommu_setup_dma_ops() 2026-01-10 10:26:43 +01:00
exynos-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_pamu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_pamu.h
fsl_pamu_domain.c iommu: Pass in old domain to attach_dev callback functions 2025-10-27 13:55:35 +01:00
fsl_pamu_domain.h
hyperv-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
io-pgfault.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
io-pgtable-arm-selftests.c iommu/io-pgtable-arm-selftests: Use KUnit 2025-11-13 16:25:32 +01:00
io-pgtable-arm-v7s.c iommu, debugobjects: avoid gcc-16.1 section mismatch warnings 2026-05-28 09:07:12 +02:00
io-pgtable-arm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
io-pgtable-arm.h
io-pgtable-dart.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
io-pgtable.c iommu/amd: Remove AMD io_pgtable support 2025-11-05 09:08:57 +01:00
iommu-debug-pagealloc.c iommu: debug-pagealloc: Use page_ext_get_from_phys() 2026-01-21 12:51:49 +01:00
iommu-debugfs.c
iommu-pages.c iommu/pages: Add support for incoherent IOMMU page table walkers 2025-11-05 09:47:43 +01:00
iommu-pages.h iommu/pages: Fix iommu_pages_flush_incoherent() for non-x86 2026-04-27 13:59:36 +02:00
iommu-priv.h iommu: Add calls for IOMMU_DEBUG_PAGEALLOC 2026-01-10 10:52:26 +01:00
iommu-sva.c iommu/sva: Fix crash in iommu_sva_unbind_device() 2026-03-17 14:00:36 +01:00
iommu-sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
iommu-traces.c
iommu.c iommu: Handle unmap error when iommu_debug is enabled 2026-05-15 07:29:16 +02:00
iova.c iommu/iova: Add NULL check in iova_magazine_free() 2026-03-17 13:28:37 +01:00
ipmmu-vmsa.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
irq_remapping.c IOMMU Updates for Linux v6.10 2024-05-18 10:55:13 -07:00
irq_remapping.h
msm_iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mtk_iommu_v1.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
of_iommu.c iommu: Get DT/ACPI parsing into the proper probe path 2025-03-11 14:05:43 +01:00
omap-iommu-debug.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
omap-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
omap-iommu.h iommu/omap: fix device leaks on probe_device() 2025-11-17 09:49:44 +01:00
omap-iopgtable.h
rockchip-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
s390-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sprd-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sun50i-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tegra-smmu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
virtio-iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00