Re: [BUG] vmlinux.o: warning: objtool: iommu_dma_sw_msi() falls through to next function alloc_io_pgtable_ops()
From: Paul E. McKenney
Date: Wed Mar 26 2025 - 19:46:00 EST
On Wed, Mar 26, 2025 at 04:18:51PM -0700, Paul E. McKenney wrote:
> Hello!
>
> Building next-20250326 using clang version 19.1.7 (CentOS 19.1.7-1.el9)
> gets me the following warning:
Apologies, but make that gcc version 11.5.0 20240719 (Red Hat 11.5.0-5) (GCC).
(Hey, it has almost always been clang in the past...)
Also, the runs that have this problem are the ones whose kernels are
built with CONFIG_DEBUG_LOCK_ALLOC=y, but that do *not* enable KASAN.
For rcutorture, these are scenarios SRCU-P, TREE02, TREE05, TASKS01,
TRACE02, RUDE01, SRCU-T, and TINY02.
Thanx, Paul
> vmlinux.o: warning: objtool: iommu_dma_sw_msi() falls through to next function alloc_io_pgtable_ops()
>
> This surprised me for a couple of reasons. First, from what I
> can see, iommu_dma_sw_msi() does not fall through. Second, it
> is in drivers/iommu/dma-iommu.c while alloc_io_pgtable_ops() is in
> drivers/iommu/io-pgtable.c, though maybe the compiler and/or linker saw
> fit to rearrange these functions' object code.
>
> Please let me know of any debug patches or fixes that I could apply,
> or any additional information that you might need.
>
> Thanx, Paul
>
> Note to self: Run 2025.03.26-14.37.10-remote on first test system. ;-)
>
> ------------------------------------------------------------------------
>
> int iommu_dma_sw_msi(struct iommu_domain *domain, struct msi_desc *desc,
> phys_addr_t msi_addr)
> {
> struct device *dev = msi_desc_to_dev(desc);
> const struct iommu_dma_msi_page *msi_page;
>
> if (!has_msi_cookie(domain)) {
> msi_desc_set_iommu_msi_iova(desc, 0, 0);
> return 0;
> }
>
> iommu_group_mutex_assert(dev);
> msi_page = iommu_dma_get_msi_page(dev, msi_addr, domain);
> if (!msi_page)
> return -ENOMEM;
>
> msi_desc_set_iommu_msi_iova(desc, msi_page->iova,
> ilog2(cookie_msi_granule(domain)));
> return 0;
> }