public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Wei Wang <wei.w.wang@hotmail.com>
Cc: bhelgaas@google.com, akpm@linux-foundation.org, bp@alien8.de,
	rdunlap@infradead.org, alex@shazbot.org, kevin.tian@intel.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 2/2] PCI: Add the enhanced ACS controls check to pci_acs_flags_enabled()
Date: Mon, 26 Jan 2026 14:01:40 -0400	[thread overview]
Message-ID: <20260126180140.GR1134360@nvidia.com> (raw)
In-Reply-To: <SI2PR01MB4393D4D3E28FC1E22E3DF3CDDC93A@SI2PR01MB4393.apcprd01.prod.exchangelabs.com>

On Mon, Jan 26, 2026 at 05:10:18PM +0800, Wei Wang wrote:
> On 1/23/26 10:51 PM, Jason Gunthorpe wrote:
> > On Fri, Jan 23, 2026 at 09:49:43AM +0800, Wei Wang wrote:
> > > The enhanced ACS controls introduced by PCIe Gen 5 ensures better device
> > > isolation. On devices that support the PCI_ACS_ECAP capability, the
> > > controls are required to be enabled properly:
> > > - ACS I/O Request Blocking needs to be enabled to avoid unintended
> > >    upstream I/O requests.
> > > - ACS DSP and USP Memory Target Access Control needs to be set with
> > >    Request Redirect or Request Blocking to ensure the Downstream and
> > >    and Upstream Port memory resource ranges are not accessed by upstream
> > >    memory requests.
> > > - ACS Unclaimed Request Redirect needs to be enabled to ensure accesses to
> > >    areas that lies within a Switch's Upstream Port memory apertures but not
> > >    within any Downstream Port memory apertures get redirected.
> > > 
> > > To maintain compatibility with legacy devices that lack PCI_ACS_ECAP
> > > support, pci_acs_enabled() skips checking for the capability and logs a
> > > warning to indicate that isolation may be incomplete.
> > 
> > That's every existing system, please don't do that.
> > 
> > The issue with ECAP is the way PCI SIG re-defined what Linux has been
> > doing forever as unsafe.
> 
> My viewpoint is that there are known bugs with the legacy ACS defined in
> PCIe Gen 4, and PCIe Gen 5 attempts to address them through new controls in
> the Enhanced Capability (ECAP). From the Linux perspective, we just need to
> adapt accordingly to ensure 'better' isolation.

No, there are not "bugs", there is a gap where a very rare and narrow
HW configuration was not specified. The vast majority of systems don't
even hit this gap, and when they do switches that are safe and secure
to use with Linux do the right thing..

> The warning is intended to raise awareness for users, so they can make
> informed decisions about continuing with this setup.

Then print warnings only in known bad cases by detecting the holes and
evaluating the quirks database if the device malfunctions. That's
hard, so I would just skip the print..

Jason

  reply	other threads:[~2026-01-26 18:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23  1:49 [PATCH v2 0/2] PCI: Add support for ACS Enhanced Capability Wei Wang
2026-01-23  1:49 ` [PATCH v2 1/2] PCI: Enable the enhanced ACS controls introduced by PCI_ACS_ECAP Wei Wang
2026-01-23  1:49 ` [PATCH v2 2/2] PCI: Add the enhanced ACS controls check to pci_acs_flags_enabled() Wei Wang
2026-01-23 14:51   ` Jason Gunthorpe
2026-01-26  9:10     ` Wei Wang
2026-01-26 18:01       ` Jason Gunthorpe [this message]
2026-01-27  5:07         ` Wei Wang

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=20260126180140.GR1134360@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@shazbot.org \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=wei.w.wang@hotmail.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