mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Jason Gunthorpe <jgg@ziepe.ca>
Cc: Robin Murphy <robin.murphy@arm.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Mikhail Zaslonko <zaslonko@linux.ibm.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	Konstantin Khorenko <khorenko@virtuozzo.com>,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
	Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Subject: [PATCH v2 0/1] iommu/generic_pt: fix GCOV build failure for amdv1
Date: Thu,  9 Apr 2026 20:01:16 +0300	[thread overview]
Message-ID: <20260409170117.2014479-1-khorenko@virtuozzo.com> (raw)
In-Reply-To: <20260402141012.1437095-1-khorenko@virtuozzo.com>

This patch fixes a build failure in drivers/iommu/generic_pt/fmt/iommu_amdv1.o
when -fprofile-update=atomic is added to global CFLAGS_GCOV.

v2: Use __always_inline instead of disabling GCOV for the file, as
    suggested by Jason Gunthorpe.  The root cause is that
    amdv1pt_install_leaf_entry() is "static inline" (not __always_inline),
    so GCC may choose not to inline it.  Without inlining, the compiler
    cannot see constant arguments at the call site and fails to eliminate
    the impossible branch in FIELD_PREP().  Forcing inlining via
    __always_inline solves the problem without losing GCOV coverage.

v1: https://lore.kernel.org/lkml/20260401142020.1434243-4-khorenko@virtuozzo.com/

This is part of a larger effort to add -fprofile-update=atomic to
global CFLAGS_GCOV to fix GCOV counter races that cause crashes on SMP
(posted earlier as a combined series):
  https://lore.kernel.org/lkml/20260401142020.1434243-1-khorenko@virtuozzo.com/T/#t

That combined series was split per subsystem as requested by reviewers.
The companion patches are:

- net: fix skb_ext BUILD_BUG_ON failures (sent to netdev) [1]
- gcov: add -fprofile-update=atomic globally (sent to gcov/kbuild
  maintainers, depends on this patch and the net patches) [2]

[1] https://lore.kernel.org/lkml/20260402140558.1437002-1-khorenko@virtuozzo.com/T/#t
[2] https://lore.kernel.org/lkml/20260402141831.1437357-1-khorenko@virtuozzo.com/T/#t

Konstantin Khorenko (1):
  iommu/generic_pt: use __always_inline for amdv1pt_install_leaf_entry()

 drivers/iommu/generic_pt/fmt/amdv1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.43.5

  parent reply	other threads:[~2026-04-09 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 14:10 [PATCH 0/1] iommu/generic_pt: disable GCOV for iommu_amdv1.o Konstantin Khorenko
2026-04-02 14:10 ` [PATCH] " Konstantin Khorenko
2026-04-03 16:07   ` Jason Gunthorpe
2026-04-09 17:01     ` Konstantin Khorenko
2026-04-09 17:01 ` Konstantin Khorenko [this message]
2026-04-09 17:01   ` [PATCH v2] iommu/generic_pt: use __always_inline for amdv1pt_install_leaf_entry() Konstantin Khorenko
2026-04-09 18:29     ` Jason Gunthorpe

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=20260409170117.2014479-1-khorenko@virtuozzo.com \
    --to=khorenko@virtuozzo.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=robin.murphy@arm.com \
    --cc=vasileios.almpanis@virtuozzo.com \
    --cc=will@kernel.org \
    --cc=zaslonko@linux.ibm.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

all inboxes | Powered by JetHome®