public inbox for iommu@lists.linux-foundation.org
 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] iommu/generic_pt: use __always_inline for amdv1pt_install_leaf_entry()
Date: Thu,  9 Apr 2026 20:01:17 +0300	[thread overview]
Message-ID: <20260409170117.2014479-2-khorenko@virtuozzo.com> (raw)
In-Reply-To: <20260409170117.2014479-1-khorenko@virtuozzo.com>

With -fprofile-update=atomic in CFLAGS_GCOV, GCC fails to eliminate
an impossible branch in FIELD_PREP() inside amdv1pt_install_leaf_entry()
when the function is merely "static inline".  GCC may choose not to
inline it, and without seeing the constant arguments at the call site
it cannot prove the FIELD_PREP value fits the field.

Change from "static inline" to "static __always_inline" so GCC is
forced to inline the function and can see the constant values,
allowing dead code elimination of the impossible branch.

Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 drivers/iommu/generic_pt/fmt/amdv1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/generic_pt/fmt/amdv1.h b/drivers/iommu/generic_pt/fmt/amdv1.h
index 3b2c41d9654d..8d11b08291d7 100644
--- a/drivers/iommu/generic_pt/fmt/amdv1.h
+++ b/drivers/iommu/generic_pt/fmt/amdv1.h
@@ -191,7 +191,7 @@ static inline enum pt_entry_type amdv1pt_load_entry_raw(struct pt_state *pts)
 }
 #define pt_load_entry_raw amdv1pt_load_entry_raw
 
-static inline void
+static __always_inline void
 amdv1pt_install_leaf_entry(struct pt_state *pts, pt_oaddr_t oa,
 			   unsigned int oasz_lg2,
 			   const struct pt_write_attrs *attrs)
-- 
2.43.5


  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 ` [PATCH v2 0/1] iommu/generic_pt: fix GCOV build failure for amdv1 Konstantin Khorenko
2026-04-09 17:01   ` Konstantin Khorenko [this message]
2026-04-09 18:29     ` [PATCH v2] iommu/generic_pt: use __always_inline for amdv1pt_install_leaf_entry() 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-2-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