[PATCH v8 2/4] iommu/io-pgtable-arm: Re-use the pgtable walk for iova_to_phys

Will Deacon will at kernel.org
Tue Aug 27 05:02:05 PDT 2024


On Mon, Aug 26, 2024 at 10:15:39AM -0700, Rob Clark wrote:
> @@ -776,7 +775,7 @@ static int io_pgtable_visit(struct arm_lpae_io_pgtable *data,
>  		return 0;
>  	}
>  
> -	if (WARN_ON(!iopte_table(pte, lvl)))
> +	if (WARN_ON(!iopte_table(pte, lvl) && !selftest_running))
>  		return -EINVAL;
>  
>  	ptep = iopte_deref(pte, data);

I still don't grok this hunk. If the selftest is running, we want to
return -EINVAL here rather than dereference something that isn't a
table, right?

Suppressing the warning is one thing, but this seems to do more than
that.

Will



More information about the linux-arm-kernel mailing list