linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v6 06/10] PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag
@ 2016-04-18 10:58 Yongji Xie
  2016-04-18 10:58 ` [RFC v6 07/10] iommu: Set PCI_BUS_FLAGS_MSI_REMAP if IOMMU have capability of IRQ remapping Yongji Xie
  2016-04-18 11:30 ` [RFC v6 06/10] PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag David Laight
  0 siblings, 2 replies; 4+ messages in thread
From: Yongji Xie @ 2016-04-18 10:58 UTC (permalink / raw)
  To: kvm, linux-kernel, linux-pci, linuxppc-dev, iommu, linux-doc
  Cc: alex.williamson, bhelgaas, aik, benh, paulus, mpe, joro, warrier,
	zhong, nikunj, eric.auger, will.deacon, gwshan, alistair, ruscur,
	Yongji Xie

We introduce a new pci_bus_flags, PCI_BUS_FLAGS_MSI_REMAP
which indicates all devices on the bus are protected by the
hardware which supports IRQ remapping(intel naming).

This flag will be used to know whether it's safe to expose
MSI-X tables of PCI BARs to userspace. Because the capability
of IRQ remapping can guarantee the PCI device cannot trigger
MSIs that correspond to interrupt IDs of other devices.

There is a existing flag for this in the IOMMU space:

enum iommu_cap {
	IOMMU_CAP_CACHE_COHERENCY,
--->	IOMMU_CAP_INTR_REMAP,
	IOMMU_CAP_NOEXEC,
};

and Eric also posted a patchset [1] to abstract this
capability on MSI controller side for ARM. But it would
make sense to have a more common flag like
PCI_BUS_FLAGS_MSI_REMAP so that we can use a universal
flag to test this capability for different archs on
PCI side.

[1] http://www.spinics.net/lists/kvm/msg130256.html

Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
---
 include/linux/pci.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 27df4a6..d619228 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -193,6 +193,7 @@ typedef unsigned short __bitwise pci_bus_flags_t;
 enum pci_bus_flags {
 	PCI_BUS_FLAGS_NO_MSI   = (__force pci_bus_flags_t) 1,
 	PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
+	PCI_BUS_FLAGS_MSI_REMAP = (__force pci_bus_flags_t) 4,
 };
 
 /* These values come from the PCI Express Spec */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-19 11:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 10:58 [RFC v6 06/10] PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag Yongji Xie
2016-04-18 10:58 ` [RFC v6 07/10] iommu: Set PCI_BUS_FLAGS_MSI_REMAP if IOMMU have capability of IRQ remapping Yongji Xie
2016-04-18 11:30 ` [RFC v6 06/10] PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag David Laight
2016-04-19 11:13   ` Yongji Xie

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).