public inbox for iommu@lists.linux-foundation.org
 help / color / mirror / Atom feed
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>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [PATCH] iommu/generic_pt: disable GCOV for iommu_amdv1.o
Date: Fri, 3 Apr 2026 13:07:29 -0300	[thread overview]
Message-ID: <20260403160729.GC2551565@ziepe.ca> (raw)
In-Reply-To: <20260402141012.1437095-2-khorenko@virtuozzo.com>

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?

Jason

  reply	other threads:[~2026-04-03 16:07 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 [this message]
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

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=20260403160729.GC2551565@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=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