Re: [PATCH] iommu/generic_pt: disable GCOV for iommu_amdv1.o
From: Konstantin Khorenko
Date: Thu Apr 09 2026 - 13:01:35 EST
On 4/3/26 18:07, Jason Gunthorpe wrote:
On Thu, Apr 02, 2026 at 05:10:12PM +0300, Konstantin Khorenko wrote:
With -fprofile-update=atomic in global CFLAGS_GCOV, GCC cannot
constant-fold FIELD_PREP() expressions inside deeply inlined page table
walker functions. GCC creates .constprop clones of the inline level
functions, which get their own GCOV instrumentation that prevents
constant evaluation of compile-time checks.
That's hasn't been the issue here. gcc gets confused where it thinks a
value is constant so the builtin_constant checks inside FIELD_PREP
trigger, but if the value is constant then control flow leading up to
it excludes that path ever happening.
Somehow gcov is breaking the elimination of the impossible branch, and
I think this is all just compiler bugs.
Also, I thought this was fixed by adding the always_inline?
You are definitely right, Jason, thank you for the hint!
Sending v2 with __always_inline.
--
Konstantin Khorenko