mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
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>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [PATCH] iommu/generic_pt: disable GCOV for iommu_amdv1.o
Date: Thu, 9 Apr 2026 19:01:03 +0200	[thread overview]
Message-ID: <1ac7d4b7-c0a7-4e23-9d77-28c737c8a8a8@virtuozzo.com> (raw)
In-Reply-To: <20260403160729.GC2551565@ziepe.ca>

On 4/3/26 18:07, Jason Gunthorpe wrote:
> On Thu, Apr 02, 2026 at 05:10:12PM +0300, Konstantin Khorenko wrote:
>> With -fprofile-update=atomic in global CFLAGS_GCOV, GCC cannot
>> constant-fold FIELD_PREP() expressions inside deeply inlined page table
>> walker functions.  GCC creates .constprop clones of the inline level
>> functions, which get their own GCOV instrumentation that prevents
>> constant evaluation of compile-time checks.
> 
> That's hasn't been the issue here. gcc gets confused where it thinks a
> value is constant so the builtin_constant checks inside FIELD_PREP
> trigger, but if the value is constant then control flow leading up to
> it excludes that path ever happening.
> 
> Somehow gcov is breaking the elimination of the impossible branch, and
> I think this is all just compiler bugs.
> 
> Also, I thought this was fixed by adding the always_inline?

You are definitely right, Jason, thank you for the hint!

Sending v2 with __always_inline.

--
Konstantin Khorenko

  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] " Konstantin Khorenko
2026-04-02 14:10 ` [PATCH] " Konstantin Khorenko
2026-04-03 16:07   ` Jason Gunthorpe
2026-04-09 17:01     ` Konstantin Khorenko [this message]
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

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=1ac7d4b7-c0a7-4e23-9d77-28c737c8a8a8@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=linux@weissschuh.net \
    --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

Powered by JetHome