linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] virtio-iommu on non-devicetree platforms
@ 2020-02-14 16:04 Jean-Philippe Brucker
  2020-02-14 16:04 ` [PATCH 1/3] iommu/virtio: Add topology description to virtio-iommu config space Jean-Philippe Brucker
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jean-Philippe Brucker @ 2020-02-14 16:04 UTC (permalink / raw)
  To: iommu, virtualization, linux-pci
  Cc: joro, bhelgaas, mst, jasowang, kevin.tian, sebastien.boeuf,
	eric.auger, jacob.jun.pan

Add topology description to the virtio-iommu driver and enable x86
platforms. Since the RFC [1] I've mostly given up on ACPI tables, since
the internal discussions seem to have reached a dead end. The built-in
topology description presented here isn't ideal, but it is simple to
implement and doesn't impose a dependency on ACPI or device-tree, which
can be beneficial to lightweight hypervisors.

The built-in description is an array in the virtio config space. The
driver parses the config space early and postpones endpoint probe until
the virtio-iommu device is ready. Each element in the array describes
either a PCI range or a single MMIO endpoint, and their associated
endpoint IDs:

struct virtio_iommu_topo_pci_range {
	__le16 type;			/* 1: PCI range */
	__le16 hierarchy;		/* PCI domain number */
	__le16 requester_start;		/* First BDF */
	__le16 requester_end;		/* Last BDF */
	__le32 endpoint_start;		/* First endpoint ID */
};

struct virtio_iommu_topo_endpoint {
	__le16 type;			/* 2: Endpoint */
	__le16 reserved;		/* 0 */
	__le32 endpoint;		/* Endpoint ID */
	__le64 address;			/* First MMIO address */
};

You can find the QEMU patches based on Eric's latest device on my
virtio-iommu/devel branch [2]. I test on both x86 q35, and aarch64 virt
machine with edk2.

[1] https://lore.kernel.org/linux-iommu/20191122105000.800410-1-jean-philippe@linaro.org/
[2] https://jpbrucker.net/git/qemu virtio-iommu/devel

Jean-Philippe Brucker (3):
  iommu/virtio: Add topology description to virtio-iommu config space
  PCI: Add DMA configuration for virtual platforms
  iommu/virtio: Enable x86 support

 MAINTAINERS                           |   2 +
 drivers/iommu/Kconfig                 |  13 +-
 drivers/iommu/Makefile                |   1 +
 drivers/iommu/virtio-iommu-topology.c | 343 ++++++++++++++++++++++++++
 drivers/iommu/virtio-iommu.c          |   3 +
 drivers/pci/pci-driver.c              |   5 +
 include/linux/virt_iommu.h            |  19 ++
 include/uapi/linux/virtio_iommu.h     |  26 ++
 8 files changed, 411 insertions(+), 1 deletion(-)
 create mode 100644 drivers/iommu/virtio-iommu-topology.c
 create mode 100644 include/linux/virt_iommu.h

-- 
2.25.0


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

end of thread, other threads:[~2020-02-17 14:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 16:04 [PATCH 0/3] virtio-iommu on non-devicetree platforms Jean-Philippe Brucker
2020-02-14 16:04 ` [PATCH 1/3] iommu/virtio: Add topology description to virtio-iommu config space Jean-Philippe Brucker
2020-02-14 16:04 ` [PATCH 2/3] PCI: Add DMA configuration for virtual platforms Jean-Philippe Brucker
2020-02-14 17:03   ` Robin Murphy
2020-02-17  9:12     ` Jean-Philippe Brucker
2020-02-14 16:04 ` [PATCH 3/3] iommu/virtio: Enable x86 support Jean-Philippe Brucker
2020-02-14 16:57   ` Robin Murphy
2020-02-16  9:50     ` Michael S. Tsirkin
2020-02-17  9:01       ` Jean-Philippe Brucker
2020-02-17 13:01         ` Michael S. Tsirkin
2020-02-17 13:22           ` Robin Murphy
2020-02-17 13:31             ` Michael S. Tsirkin
2020-02-17 14:10               ` Robin Murphy

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