From: Jason Gunthorpe <jgg@ziepe.ca>
To: Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
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,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Subject: Re: [PATCH v2] iommu/generic_pt: use __always_inline for amdv1pt_install_leaf_entry()
Date: Thu, 9 Apr 2026 15:29:51 -0300 [thread overview]
Message-ID: <20260409182951.GS2551565@ziepe.ca> (raw)
In-Reply-To: <20260409170117.2014479-2-khorenko@virtuozzo.com>
On Thu, Apr 09, 2026 at 08:01:17PM +0300, Konstantin Khorenko wrote:
> 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(-)
It was already merged:
commit 8b72aa5704c77380742346d4ac755b074b7f9eaa
Author: Sherry Yang <sherry.yang@oracle.com>
Date: Thu Mar 26 09:17:19 2026 -0700
iommupt/amdv1: mark amdv1pt_install_leaf_entry as __always_inline
After enabling CONFIG_GCOV_KERNEL and CONFIG_GCOV_PROFILE_ALL, following
build failure is observed under GCC 14.2.1:
prev parent reply other threads:[~2026-04-09 18:29 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 ` [PATCH v2] iommu/generic_pt: use __always_inline for amdv1pt_install_leaf_entry() Konstantin Khorenko
2026-04-09 18:29 ` Jason Gunthorpe [this message]
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=20260409182951.GS2551565@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=khorenko@virtuozzo.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