Re: [PATCH] iommupt/amdv1: avoid GCOV builds triggering FIELD_PREP build failure

From: Jason Gunthorpe

Date: Tue Mar 10 2026 - 14:03:01 EST


On Tue, Mar 10, 2026 at 05:17:31PM +0000, Sherry Yang wrote:

> Unfortunately, I ran into the FIELD_PREP build failure with
> 98d5110f90ae (“iommupt: Make it clearer to the compiler that
> pts.level == 0 for single page”) already merged, which means it
> doesn’t work for me. I noticed you mentioned clang 18 hit the same
> issue and fixed by the patch. We’re using GCC 14.2.1, looks like GCC
> still constant-folds the contiguous branch despite the change to
> pts.level.

This is all a performance path, I'm reluctant to add more code for
everyone just to hide things from GCC bugs.

Maybe you can rework this to be only when gcov is on, or maybe you can
fix it by futher enhancing what the other commit does. Perhaps an
always inline annotation is all that is missing?

Or maybe we should remove the use of FIELD_PREP?

Jason