Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: Vasant Hegde <vasant.hegde@amd.com>,
	iommu@lists.linux.dev, joro@8bytes.org,
	linux-pci@vger.kernel.org, will@kernel.org, robin.murphy@arm.com,
	suravee.suthikulpanit@amd.com, bhelgaas@google.com,
	alexander.deucher@amd.com, jgg@ziepe.ca,
	Amandeep Kaur Longia <AmandeepKaur.Longia@amd.com>
Subject: Re: [PATCH 2/2] iommu/amd: Force identity mode for selected GPUs only
Date: Thu, 23 Jul 2026 14:53:28 -0500	[thread overview]
Message-ID: <20260723195328.GA852751@bhelgaas> (raw)
In-Reply-To: <e9595d4f-419f-4d42-bd22-c3a8964c370b@amd.com>

On Thu, Jul 23, 2026 at 11:32:49AM -0500, Mario Limonciello wrote:
> On 7/23/26 11:23, Vasant Hegde wrote:
> > On 7/23/2026 9:41 PM, Mario Limonciello wrote:
> > > On 7/23/26 10:59, Bjorn Helgaas wrote:
> > > > On Thu, Jul 23, 2026 at 06:15:48AM +0000, Vasant Hegde wrote:
> > > > > Certain AMD GPU's must always be in identity mode. Currently its enforced
> > > > > using PASID check. It worked fine as most GPU's has PASID feature. But
> > > > > this means, identity mode enforcement is done for all PASID capable devices.
> ...

> > +static bool quirks_force_identity_mapping(struct pci_dev *pdev)
> > +{
> > +       struct pci_dev *root_port;
> > +       int class = pdev->class >> 8;
> > +
> > +       /* AMD GPU vendor ID */
> > +       if (pdev->vendor != PCI_VENDOR_ID_ATI)
> > +               return false;
> > +
> > +       /* GPU class */
> > +       if (class != PCI_CLASS_DISPLAY_VGA &&
> > +           class != PCI_CLASS_DISPLAY_OTHER)
> > +               return false;
> > +
> > +       if (pci_upstream_bridge(pdev) &&
> 
> I don't think you need to check for pci_upstream_bridge() to be
> non-NULL.  You already checked that it's an endpoint by looking at
> the class.  So an endpoint will be connected to a bridge of some
> sort (either a switch internal to the dGPU or to a root port).

I think devices can be passed through to virtualized guests with no
upstream bridge visible to the guest, can't they?

  parent reply	other threads:[~2026-07-23 19:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  6:15 [PATCH 0/2] iommu/amd: Fix default domain selection for PASID-capable devices Vasant Hegde
2026-07-23  6:15 ` [PATCH 1/2] PCI: Mark Radeon Pro WX 4100 ATS as broken Vasant Hegde
2026-07-23  6:21   ` sashiko-bot
2026-07-23 15:42   ` Bjorn Helgaas
2026-07-23 15:45     ` Mario Limonciello
2026-07-23 16:51       ` Vasant Hegde
2026-07-23  6:15 ` [PATCH 2/2] iommu/amd: Force identity mode for selected GPUs only Vasant Hegde
2026-07-23  6:25   ` sashiko-bot
2026-07-23 15:53   ` Ankit Soni
2026-07-23 16:29     ` Vasant Hegde
2026-07-23 15:59   ` Bjorn Helgaas
2026-07-23 16:11     ` Mario Limonciello
2026-07-23 16:23       ` Vasant Hegde
2026-07-23 16:32         ` Mario Limonciello
2026-07-23 16:55           ` Vasant Hegde
2026-07-23 19:53           ` Bjorn Helgaas [this message]
2026-07-23 19:58             ` Mario Limonciello
2026-07-23 21:02               ` Bjorn Helgaas
2026-07-23 16:33     ` Vasant Hegde

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=20260723195328.GA852751@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=AmandeepKaur.Longia@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=bhelgaas@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    /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