From: Alex Williamson <alex.williamson@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "Logan Gunthorpe" <logang@deltatee.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-doc@vger.kernel.org, "Stephen Bates" <sbates@raithlin.com>,
"Christoph Hellwig" <hch@lst.de>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Ingo Molnar" <mingo@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
"Marc Zyngier" <marc.zyngier@arm.com>,
"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
"Frederic Weisbecker" <frederic@kernel.org>,
"Dan Williams" <dan.j.williams@intel.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
"Christian König" <christian.koenig@amd.com>,
"Matthew Wilcox" <willy@infradead.org>
Subject: Re: [PATCH v6 0/4] Add parameter for disabling ACS redirection for P2P
Date: Mon, 16 Jul 2018 09:06:20 -0600 [thread overview]
Message-ID: <20180716090620.0caa3d79@t450s.home> (raw)
In-Reply-To: <710e15b2-89f8-a658-656f-84492ef78898@ozlabs.ru>
On Mon, 16 Jul 2018 15:01:21 +1000
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> On 14/7/18 9:31 am, Logan Gunthorpe wrote:
> > Changes since v5:
> > * Add a quirk to handle the Intel SPT PCH case (as pointed out by Alex)
> > * Warn in the case that we try to disable ACS redirect on a device
> > that doesn't have the ACS capability (also suggested by Alex)
> > * Collect reviewed-by tag from Alex
> > * Rebased onto v4.18-rc4 (no conflicts)
> >
> > Changes since v4:
> > * Fixed a couple documentation mistakes spotted by Randy
> >
> > Changes since v3:
> > * Removed some of the cruft that was copied from the resource_alignment
> > paramater (per Alex)
> > * A number of docuemntation fixes as noticed by Alex and Willy
> >
> > Changes since v2:
> > * Rebased onto v4.18-rc1 (no conflicts)
> > * Minor tweaks to the documentation per Andy
> > * Removed the "path:" prefix and use the path parsing code
> > for simple devices (as it works the same). Per a suggestion from Alex
> >
> > Changes since v1:
> > * Reworked pci_dev_str_match_path using strrchr as suggested by Alex
> > * Collected Christian's Acks
> >
> > --
> >
> > Hi,
> >
> > As discussed in our PCI P2PDMA series, we'd like to add a kernel
> > parameter for selectively disabling ACS redirection for select
> > bridges. Seeing this turned out to be a small series in itself, we've
> > decided to send this separately from the P2P work.
> >
> > This series generalizes the code already done for the resource_alignment
> > option that already exists. The first patch creates a helper function
> > to match PCI devices against strings based on the code that already
> > existed in pci_specified_resource_alignment().
> >
> > The second patch expands the new helper to optionally take a path of
> > PCI devfns. This is to address Alex's renumbering concern when using
> > simple bus-devfns. The implementation is essentially how he described it and
> > similar to the Intel VT-d spec (Section 8.3.1).
> >
> > The final patch adds the disable_acs_redir kernel parameter which takes
> > a list of PCI devices and will disable the ACS P2P Request Redirect,
> > ACS P2P Completion Redirect and ACS P2P Egress Control bits for the
> > selected devices. This allows P2P traffic between selected bridges and
> > seeing it's done at boot, before the IOMMU groups will be created, the
> > groups will match the security provided by ACS.
>
>
> I am pretty sure it's been discussed but just to make sure I understand the
> whole picture - why exactly does ACS have to be disabled at the boot time?
> We could enable it, for example, for 2 devices in the same VFIO container
> if there are in isolatable part of the PCI tree, or we just do not want to
> make VFIO containers or QEMU aware of PCI hierarchy (I can see why, just
> double checking)? Thanks.
AIUI, vfio is not necessarily a primary use case here, native bare
metal drivers might also want to perform direct p2p. In the vfio case,
any time we're allowing p2p via ACS, we're poking holes into the IOVA
space presented to the user. We don't have a good way for the user to
handle that, or even learn about it, so there are quite a few issues if
vfio were a use case here. Currently the intersection with vfio is
that when ACS is disabled, it introduces p2p channels which breaks
device isolation. These need to be reflected in the IOMMU groups so
it's done at boot time, before the groups are created. If we wanted to
allow dynamic manipulation, we'd effectively need to soft unplug entire
sub-hierarchies around the point where ACS is modified and re-add the
devices in order to get the grouping correct. Thanks,
Alex
prev parent reply other threads:[~2018-07-16 15:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 23:31 [PATCH v6 0/4] Add parameter for disabling ACS redirection for P2P Logan Gunthorpe
2018-07-13 23:31 ` [PATCH v6 1/4] PCI: Make specifying PCI devices in kernel parameters reusable Logan Gunthorpe
2018-07-13 23:31 ` [PATCH v6 2/4] PCI: Allow specifying devices using a base bus and path of devfns Logan Gunthorpe
2018-07-13 23:31 ` [PATCH v6 3/4] PCI: Introduce disable_acs_redir quirk Logan Gunthorpe
2018-07-13 23:31 ` [PATCH v6 4/4] PCI: Introduce the disable_acs_redir parameter Logan Gunthorpe
2018-07-16 17:15 ` Alex Williamson
2018-07-16 17:17 ` Logan Gunthorpe
2018-07-16 5:01 ` [PATCH v6 0/4] Add parameter for disabling ACS redirection for P2P Alexey Kardashevskiy
2018-07-16 15:06 ` Alex Williamson [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=20180716090620.0caa3d79@t450s.home \
--to=alex.williamson@redhat.com \
--cc=aik@ozlabs.ru \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=frederic@kernel.org \
--cc=hch@lst.de \
--cc=jglisse@redhat.com \
--cc=kai.heng.feng@canonical.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=marc.zyngier@arm.com \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=sbates@raithlin.com \
--cc=tglx@linutronix.de \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).