From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: linux-pci@vger.kernel.org, Gavin Shan <gwshan@linux.vnet.ibm.com>,
linuxppc-dev@ozlabs.org, Brian King <brking@us.ibm.com>,
cascardo@linux.vnet.ibm.com, bhelgaas@google.com,
Frank Haverkamp <haver@linux.vnet.ibm.com>,
Ian Munsie <imunsie@au1.ibm.com>
Subject: Re: [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state()
Date: Tue, 24 Mar 2015 11:23:55 +1100 [thread overview]
Message-ID: <1427156635.4770.290.camel@kernel.crashing.org> (raw)
In-Reply-To: <1427144881.3643.680.camel@redhat.com>
On Mon, 2015-03-23 at 15:08 -0600, Alex Williamson wrote:
>
> I don't know what you're doing on POWER, I thought groups were
> equivalent to PEs, but on x86 we learn about isolation of PCI functions
> by standard PCI properties. Devices need to tell us that they're
> isolated via ACS capabilities (or quirks, with vendor approval).
> Otherwise we assume there is no isolation and multi-function devices
> will be grouped together, preventing the individual functions from being
> assigned to separate userspace instances. VFIO does not ignore the
> problem of internal communication between functions, it uses ACS... at
> least on most platforms.
POWER doesn't allow functions in different PEs today (mostly for a
different reason which is the problem we have with MMIO assignment to
different PEs, though we are working on ways to fix that in the future
in which case we might start using ACS).
There's still a potential issue with LSIs though, I haven't looked how
you handle it on x86.
> Firmware shared between functions is an unsolvable problem outside of
> restricting device assignment only to SR-IOV virtual functions. We
> cannot know the programming method to block firmware updates of an
> assigned device nor can we control which functions share the firmware.
> If you're worried about this level of attack against the hardware, use
> VFs exclusively.
You cannot trust HW :-)
> If you're unsatisfied with the grouping of devices on your platform,
> this is entirely within your control since VFIO relies on IOMMU groups,
> which are managed via the platform IOMMU driver. If your IOMMU driver
> is arbitrarily splitting each PCI function into a separate group without
> testing the isolation, that's a problem with IOMMU groups on your
> platform. If you would like to add a reset requirement to a group, you
> have the ability to do that. On x86, I expect this would be far too
> restrictive.
That means that you cannot recover devices that don't support FLR...
> VFIO also knows how to do bus and slot resets, the pci_reset_bus() and
> pci_reset_slot() interfaces were added by me with vfio-pci as the first
> user. Resets are generally handled as best effort though and this is
> sometimes a property of a device that might make it unsuitable for
> device assignment.
Or unsuitable as a multi-function split assignment, we can still give
the whole slot to the guest.
> The fact that you're implying above that the devices covered by the
> device specific reset proposed in this series can be assigned separately
> makes ignoring the scope of pci_reset_function() all the more wrong. If
> you want to change grouping on POWER to require that a group can be
> reset, that's an IOMMU driver issue. If you want to make a change to
> VFIO to require an opt-in/out of allowing access to groups without a
> reset, then propose something. Just please don't ignore the semantics
> of existing functions because it's a quicker and easier hack than doing
> it correctly. Thanks,
The IOMMU driver unfortunately cannot know whether the devices support a
good reset granularity without quirks ... Oh well. It's a mess, thanks
for Intel for not making FLR mandatory since PCI 1.0 .... :-)
Cheers,
Ben.
next prev parent reply other threads:[~2015-03-24 0:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 3:02 [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state() Gavin Shan
2015-03-23 3:02 ` [PATCH v3 2/2] PCI: Apply warm reset to specific devices Gavin Shan
2015-03-23 3:34 ` [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state() Alex Williamson
2015-03-23 3:56 ` Gavin Shan
2015-03-23 4:06 ` Alex Williamson
2015-03-23 4:40 ` Gavin Shan
2015-03-23 12:40 ` Alex Williamson
2015-03-23 20:07 ` cascardo
2015-03-23 21:08 ` Alex Williamson
2015-03-24 0:23 ` Benjamin Herrenschmidt [this message]
2015-03-24 0:19 ` Benjamin Herrenschmidt
2015-03-23 22:54 ` Gavin Shan
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=1427156635.4770.290.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=brking@us.ibm.com \
--cc=cascardo@linux.vnet.ibm.com \
--cc=gwshan@linux.vnet.ibm.com \
--cc=haver@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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).