[PATCH v2 2/9] iommupt/kunit: Skip test configs without supported features

Pranjal Shrivastava praan at google.com
Mon Sep 28 16:16:25 PDT 2026


On Wed, Aug 12, 2026 at 05:09:18PM -0300, Jason Gunthorpe wrote:
> Some of the tests configs can test features we don't currently enable,
> like TTBR1 on ARMv8. Instead of blowing up, skip the test. When
> CONFIG_DEBUG_GENERIC_PT is set all features are force enabled during
> the build so everything can be tested. That is the normal mode for the
> kunit.py runner.
> 
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> ---
>  drivers/iommu/generic_pt/kunit_iommu.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iommu/generic_pt/kunit_iommu.h b/drivers/iommu/generic_pt/kunit_iommu.h
> index 79d7f9c8e7868f..558e161eacb05f 100644
> --- a/drivers/iommu/generic_pt/kunit_iommu.h
> +++ b/drivers/iommu/generic_pt/kunit_iommu.h
> @@ -134,6 +134,16 @@ static int pt_kunit_priv_init(struct kunit *test, struct kunit_iommu_priv *priv)
>  
>  #ifdef kunit_fmt_cfgs
>  	priv->cfg = kunit_fmt_cfgs[((uintptr_t)test->param_value) - 1];
> +	/*
> +	 * Without CONFIG_DEBUG_GENERIC_PT only the format's compiled-in
> +	 * PT_SUPPORTED_FEATURES are available, so cfgs requesting bits outside
> +	 * that set cannot be tested.
> +	 */
> +	if (priv->cfg.common.features & ~KUNIT_PT_SUPPORTED_FEATURES)
> +		kunit_skip(
> +			test,
> +			"cfg requires features not built into this format (enable CONFIG_DEBUG_GENERIC_PT)");
> +

I can't quite build this as I can't find this macro:

drivers/iommu/generic_pt/fmt/../kunit_iommu.h:129:35: error: use of undeclared identifier 'KUNIT_PT_SUPPORTED_FEATURES'
  129 |         if (priv->cfg.common.features & ~KUNIT_PT_SUPPORTED_FEATURES)
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC      drivers/tty/tty_port.o
  CC      drivers/clk/clk-fixed-factor.o
  AS      arch/arm64/lib/strrchr.o
1 error generated.
make[5]: *** [drivers/iommu/generic_pt/fmt/Makefile:30: drivers/iommu/generic_pt/fmt/kunit_iommu_armv8.o] Error 1
make[4]: *** [scripts/Makefile.build:551: drivers/iommu/generic_pt/fmt] Error 2

Am I missing a series it was defined in? Can't find anything on lore,
but I did find a commit on your github [1] that is supposed to preclude
this, I guess?

With that dependence defined/linked in the cover letter:

Reviewed-by: Pranjal Shrivastava <praan at google.com>

Thanks,
Praan



More information about the linux-arm-kernel mailing list