[PATCH 0/2] net: fix skb_ext BUILD_BUG_ON failures with GCOV
From: Konstantin Khorenko
Date: Thu Apr 02 2026 - 10:09:08 EST
This mini-series fixes build failures in net/core/skbuff.c when the
kernel is built with CONFIG_GCOV_PROFILE_ALL=y.
This is part of a larger effort to add -fprofile-update=atomic to
global CFLAGS_GCOV (posted earlier as a combined series):
https://lore.kernel.org/lkml/20260401142020.1434243-1-khorenko@xxxxxxxxxxxxx/T/#t
That combined series was split per subsystem as requested by Jakub.
The companion patches are:
- iommu: disable GCOV for iommu_amdv1.o (sent to iommu maintainers)
- gcov: add -fprofile-update=atomic globally (sent to gcov/kbuild
maintainers, depends on this series and the iommu patch)
Patch 1/2 fixes a pre-existing build failure with CONFIG_GCOV_PROFILE_ALL:
GCOV counters prevent GCC from constant-folding the skb_ext_total_length()
loop. This is v3 of a previously posted standalone fix:
https://lore.kernel.org/lkml/20260331165125.959833-1-khorenko@xxxxxxxxxxxxx/T/#t
Patch 2/2 is an additional fix needed when -fprofile-update=atomic is
added to CFLAGS_GCOV: __no_profile on the __always_inline function alone
is insufficient because after inlining, the code resides in the caller's
profiled body. The caller needs __no_profile as well.
Konstantin Khorenko (2):
net: fix skb_ext_total_length() BUILD_BUG_ON with CONFIG_GCOV_PROFILE_ALL
net: add __no_profile to skb_extensions_init() for GCOV compatibility
net/core/skbuff.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--
2.43.5