virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for ACPI VIOT
@ 2021-03-16 19:16 Jean-Philippe Brucker
  2021-03-16 19:16 ` [PATCH 1/3] ACPICA: iASL: Add definitions for the VIOT table Jean-Philippe Brucker
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Jean-Philippe Brucker @ 2021-03-16 19:16 UTC (permalink / raw)
  To: rjw, lenb, joro, mst
  Cc: jean-philippe, lorenzo.pieralisi, eric.auger, robin.murphy,
	virtualization, linux-acpi, iommu, sebastien.boeuf, will

Add a driver for the ACPI VIOT table, which enables virtio-iommu on
non-devicetree platforms, including x86. This series depends on the
ACPICA changes of patch 1, which will be included in next release [1]
and pulled into Linux.

The Virtual I/O Translation table (VIOT) describes the topology of
para-virtual I/O translation devices and the endpoints they manage.
It was recently approved for inclusion into the ACPI standard [2].
A provisional version of the specification can be found at [3].

After discussing non-devicetree support for virtio-iommu at length
[4][5][6] we concluded that it should use this new ACPI table. And for
platforms that don't implement either devicetree or ACPI, a structure
that uses roughly the same format [6] can be built into the device.

[1] https://github.com/acpica/acpica/pull/666
[2] https://lore.kernel.org/linux-iommu/20210218233943.GH702808@redhat.com/
[3] https://jpbrucker.net/virtio-iommu/viot/viot-v9.pdf
[4] https://lore.kernel.org/linux-iommu/20191122105000.800410-1-jean-philippe@linaro.org/
[5] https://lore.kernel.org/linux-iommu/20200228172537.377327-1-jean-philippe@linaro.org/
[6] https://lore.kernel.org/linux-iommu/20200821131540.2801801-1-jean-philippe@linaro.org/

Jean-Philippe Brucker (3):
  ACPICA: iASL: Add definitions for the VIOT table
  ACPI: Add driver for the VIOT table
  iommu/virtio: Enable x86 support

 drivers/acpi/Kconfig         |   3 +
 drivers/iommu/Kconfig        |   4 +-
 drivers/acpi/Makefile        |   2 +
 include/acpi/actbl3.h        |  67 ++++++
 include/linux/acpi_viot.h    |  26 +++
 drivers/acpi/bus.c           |   2 +
 drivers/acpi/scan.c          |   6 +
 drivers/acpi/viot.c          | 406 +++++++++++++++++++++++++++++++++++
 drivers/iommu/virtio-iommu.c |   3 +
 MAINTAINERS                  |   8 +
 10 files changed, 526 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/acpi_viot.h
 create mode 100644 drivers/acpi/viot.c

-- 
2.30.2

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 25+ messages in thread
* [PATCH 0/3] virtio-iommu on non-devicetree platforms
@ 2020-02-14 16:04 Jean-Philippe Brucker
       [not found] ` <20200214160413.1475396-1-jean-philippe-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 25+ messages in thread
From: Jean-Philippe Brucker @ 2020-02-14 16:04 UTC (permalink / raw)
  To: iommu, virtualization, linux-pci
  Cc: mst, joro, eric.auger, sebastien.boeuf, jacob.jun.pan, bhelgaas

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] 25+ messages in thread

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

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-16 19:16 [PATCH 0/3] Add support for ACPI VIOT Jean-Philippe Brucker
2021-03-16 19:16 ` [PATCH 1/3] ACPICA: iASL: Add definitions for the VIOT table Jean-Philippe Brucker
2021-03-18 17:52   ` Auger Eric
2021-04-15 14:36     ` Jean-Philippe Brucker
2021-03-16 19:16 ` [PATCH 2/3] ACPI: Add driver " Jean-Philippe Brucker
2021-03-18 19:36   ` Robin Murphy
2021-04-15 14:31     ` Jean-Philippe Brucker
2021-03-19 10:44   ` Auger Eric
2021-04-15 14:46     ` Jean-Philippe Brucker
2021-03-16 19:16 ` [PATCH 3/3] iommu/virtio: Enable x86 support Jean-Philippe Brucker
2021-03-18 10:44   ` Joerg Roedel
2021-03-18 11:43   ` Robin Murphy
2021-04-15 15:14     ` Jean-Philippe Brucker
2021-03-18 18:28   ` Michael S. Tsirkin
2021-04-15 15:15     ` Jean-Philippe Brucker
2021-03-19 10:58 ` [PATCH 0/3] Add support for ACPI VIOT Auger Eric
2021-03-19 11:16   ` Jean-Philippe Brucker
  -- strict thread matches above, loose matches on Subject: below --
2020-02-14 16:04 [PATCH 0/3] virtio-iommu on non-devicetree platforms Jean-Philippe Brucker
     [not found] ` <20200214160413.1475396-1-jean-philippe-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
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
     [not found]         ` <20200216045006-mutt-send-email-mst-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
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).