Re: [PATCH] iommupt/amdv1: avoid GCOV builds triggering FIELD_PREP build failure
From: Jason Gunthorpe
Date: Thu Mar 26 2026 - 08:08:27 EST
On Wed, Mar 25, 2026 at 11:39:37PM +0000, Sherry Yang wrote:
>
> > On Mar 10, 2026, at 10:57 AM, Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
> >
> > 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?
>
>
> Thanks for the pointer — marking amdv1pt_install_leaf_entry() as
> __always_inline fixes the gcc/gcov build failure for me while keeping
> the original FIELD_PREP() path intact.
>
> If you’re happy with this approach, I'll send the patch out.
That sounds good thanks
Jason