public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: "David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Cc: Simon Horman <horms@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: [PATCH v2 0/1] Fix kernel build failure with CONFIG_GCOV_PROFILE_ALL=y
Date: Tue, 31 Mar 2026 19:50:26 +0300	[thread overview]
Message-ID: <20260331165125.959833-1-khorenko@virtuozzo.com> (raw)

This patch fixes a build failure in net/core/skbuff.c that occurs when
CONFIG_GCOV_PROFILE_ALL=y is enabled.

v2: use __no_profile instead of preprocessor guards, as suggested
    by Thomas Weißschuh.  This solves the root cause (GCOV counters
    preventing constant folding) and also removes the existing
    CONFIG_KCOV_INSTRUMENT_ALL guard which is no longer needed.

Build failure without this patch
---------------------------------

With the following configuration:

  CONFIG_GCOV_KERNEL=y
  CONFIG_GCOV_PROFILE_ALL=y
  # CONFIG_GCOV_PROFILE_FTRACE is not set
  CONFIG_GCOV_PROFILE_RDS=y
  CONFIG_GCOV_PROFILE_URING=y

The kernel fails to build with:

  In file included from <command-line>:
  In function 'skb_extensions_init',
      inlined from 'skb_init' at net/core/skbuff.c:5214:2:
  ././include/linux/compiler_types.h:706:45: error: call to '__compiletime_assert_1490' declared with attribute error: BUILD_BUG_ON failed: skb_ext_total_length() > 255
    706 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        |                                             ^
  ././include/linux/compiler_types.h:687:25: note: in definition of macro '__compiletime_assert'
    687 |                         prefix ## suffix();                             \
        |                         ^~~~~~
  ././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
    706 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        |         ^~~~~~~~~~~~~~~~~~~
  ./include/linux/build_bug.h:40:37: note: in expansion of macro 'compiletime_assert'
     40 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
        |                                     ^~~~~~~~~~~~~~~~~~
  ./include/linux/build_bug.h:51:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     51 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
        |         ^~~~~~~~~~~~~~~~
  net/core/skbuff.c:5163:9: note: in expansion of macro 'BUILD_BUG_ON'
   5163 |         BUILD_BUG_ON(skb_ext_total_length() > 255);
        |         ^~~~~~~~~~~~
  make[4]: *** [scripts/Makefile.build:289: net/core/skbuff.o] Error 1

Testing
-------

Tested with GCC 11.4.1 and GCC 16.0.1 20260327 (experimental) - both
exhibit the same build failure without the patch.  Both compile
successfully with the patch applied.

Konstantin Khorenko (1):
  net: fix skb_ext_total_length() BUILD_BUG_ON with CONFIG_GCOV_PROFILE_ALL

 net/core/skbuff.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

-- 
2.43.5

             reply	other threads:[~2026-03-31 16:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 16:50 Konstantin Khorenko [this message]
2026-03-31 16:50 ` [PATCH v2 1/1] net: fix skb_ext_total_length() BUILD_BUG_ON with CONFIG_GCOV_PROFILE_ALL Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260331165125.959833-1-khorenko@virtuozzo.com \
    --to=khorenko@virtuozzo.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox