[PATCH] iommu/arm-smmu-v3: Make the kunit into a module

Thorsten Leemhuis linux at leemhuis.info
Wed May 8 04:20:31 PDT 2024


On 07.05.24 15:21, Jason Gunthorpe wrote:
> It turns out kconfig has problems ensuring the SMMU module and the KUNIT
> module are consistently y/m to allow linking. It will permit KUNIT to be a
> module while SMMU is built in.
> 
> Also, Fedora apparently enables kunit on production kernels.

FWIW, as "CONFIG_KUNIT=m" in case that's relevant for the discussion.
The modules then are put into a separate package.

> So, put the entire kunit in its own module using the
> VISIBLE_IF_KUNIT/EXPORT_SYMBOL_IF_KUNIT machinery. This keeps it out of
> vmlinus on Fedora and makes the kconfig work in the normal way. There is
> no cost if kunit is disabled.
> 
> Fixes: 56e1a4cc2588 ("iommu/arm-smmu-v3: Add unit tests for arm_smmu_write_entry")
> Reported-by: Thorsten Leemhuis <linux at leemhuis.info>
> Link: https://lore.kernel.org/all/aeea8546-5bce-4c51-b506-5d2008e52fef@leemhuis.info
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>

I didn't test this yesterday, as it sounded like the approach would be
revisited. But as that might turn out to not be the case I applied the
patch on today's -next to see if it fixed the issue. That did the trick
afaics (assuming nobody fixed this through other measures!). Hence feel
free to add

Tested-by: Thorsten Leemhuis <linux at leemhuis.info>

Thx Jason for handling this so quickly!

Ciao, Thorsten



More information about the linux-arm-kernel mailing list