qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] virtio-iommu: Add ACPI support
@ 2021-08-10  8:45 Jean-Philippe Brucker
  2021-08-10  8:45 ` [PATCH 1/6] acpi: Add VIOT structure definitions Jean-Philippe Brucker
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Jean-Philippe Brucker @ 2021-08-10  8:45 UTC (permalink / raw)
  To: eric.auger
  Cc: peter.maydell, ehabkost, mst, richard.henderson, qemu-devel,
	shannon.zhaosl, Jean-Philippe Brucker, qemu-arm, pbonzini,
	imammedo

Allow instantiating a virtio-iommu device on ACPI systems by adding a
Virtual I/O Translation table (VIOT). Enable x86 support for VIOT.

With a simple configuration the table contains a virtio-iommu-pci node
and a pci-range node:

	qemu-system-aarch64 -M virt -bios QEMU_EFI.fd
	  -device virtio-iommu ...

	$ iasl -d ...
	[000h 0000   4]                    Signature : "VIOT"

	[024h 0036   2]                   Node count : 0002
	[026h 0038   2]                  Node offset : 0030

	[030h 0048   1]                         Type : 03 [VirtIO-PCI IOMMU]
	[032h 0050   2]                       Length : 0010
	[034h 0052   2]                  PCI Segment : 0000
	[036h 0054   2]               PCI BDF number : 0030

	[040h 0064   1]                         Type : 01 [PCI Range]
	[042h 0066   2]                       Length : 0018
	[044h 0068   4]               Endpoint start : 00000000
	[048h 0072   2]            PCI Segment start : 0000
	[04Ah 0074   2]              PCI Segment end : 0000
	[04Ch 0076   2]                PCI BDF start : 0000
	[04Eh 0078   2]                  PCI BDF end : 00FF
	[050h 0080   2]                  Output node : 0030

With a more complex topology multiple PCI Range nodes describe the system:

	qemu-system-aarch64 -bios QEMU_EFI.fd -device virtio-iommu
	  -M virt,default_bus_bypass_iommu=true
	  -device pxb-pcie,bus_nr=0x10,id=pcie.1000,bus=pcie.0
	  -device pxb-pcie,bus_nr=0x20,id=pcie.2000,bus=pcie.0,bypass_iommu=true
	  -device pxb-pcie,bus_nr=0x30,id=pcie.3000,bus=pcie.0

	[024h 0036   2]                   Node count : 0003
	[026h 0038   2]                  Node offset : 0030

	[030h 0048   1]                         Type : 03 [VirtIO-PCI IOMMU]
	[032h 0050   2]                       Length : 0010
	[034h 0052   2]                  PCI Segment : 0000
	[036h 0054   2]               PCI BDF number : 0020

	[040h 0064   1]                         Type : 01 [PCI Range]
	[042h 0066   2]                       Length : 0018
	[044h 0068   4]               Endpoint start : 00003000
	[048h 0072   2]            PCI Segment start : 0000
	[04Ah 0074   2]              PCI Segment end : 0000
	[04Ch 0076   2]                PCI BDF start : 3000
	[04Eh 0078   2]                  PCI BDF end : 32FF
	[050h 0080   2]                  Output node : 0030

	[058h 0088   1]                         Type : 01 [PCI Range]
	[05Ah 0090   2]                       Length : 0018
	[05Ch 0092   4]               Endpoint start : 00001000
	[060h 0096   2]            PCI Segment start : 0000
	[062h 0098   2]              PCI Segment end : 0000
	[064h 0100   2]                PCI BDF start : 1000
	[066h 0102   2]                  PCI BDF end : 11FF
	[068h 0104   2]                  Output node : 0030


The VIOT table description will be in the next release of ACPI.
In the meantime you can find a description at
https://jpbrucker.net/virtio-iommu/viot/viot-v9.pdf
Linux support for VIOT was added in version 5.14

Eric Auger (1):
  pc: Allow instantiating a virtio-iommu device

Jean-Philippe Brucker (5):
  acpi: Add VIOT structure definitions
  hw/acpi: Add VIOT table
  hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu
  hw/arm/virt: Remove device tree restriction for virtio-iommu
  pc: Add VIOT table for virtio-iommu

 hw/acpi/viot.h               | 13 ++++++
 include/hw/acpi/acpi-defs.h  | 60 ++++++++++++++++++++++++++
 include/hw/i386/pc.h         |  2 +
 hw/acpi/viot.c               | 82 ++++++++++++++++++++++++++++++++++++
 hw/arm/virt-acpi-build.c     |  7 +++
 hw/arm/virt.c                | 10 +----
 hw/i386/acpi-build.c         |  5 +++
 hw/i386/pc.c                 | 18 +++++++-
 hw/virtio/virtio-iommu-pci.c |  7 ---
 hw/acpi/Kconfig              |  4 ++
 hw/acpi/meson.build          |  1 +
 hw/arm/Kconfig               |  1 +
 hw/i386/Kconfig              |  1 +
 13 files changed, 195 insertions(+), 16 deletions(-)
 create mode 100644 hw/acpi/viot.h
 create mode 100644 hw/acpi/viot.c

-- 
2.32.0



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

end of thread, other threads:[~2021-09-29 17:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10  8:45 [PATCH 0/6] virtio-iommu: Add ACPI support Jean-Philippe Brucker
2021-08-10  8:45 ` [PATCH 1/6] acpi: Add VIOT structure definitions Jean-Philippe Brucker
2021-08-10  8:45 ` [PATCH 2/6] hw/acpi: Add VIOT table Jean-Philippe Brucker
2021-08-10  9:22   ` Igor Mammedov
2021-08-27 13:29     ` Jean-Philippe Brucker
2021-08-10  8:45 ` [PATCH 3/6] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu Jean-Philippe Brucker
2021-08-10  8:45 ` [PATCH 4/6] hw/arm/virt: Remove device tree restriction " Jean-Philippe Brucker
2021-08-17 13:42   ` Eric Auger
2021-08-27 13:29     ` Jean-Philippe Brucker
2021-08-10  8:45 ` [PATCH 5/6] pc: Add VIOT table " Jean-Philippe Brucker
2021-08-10  8:45 ` [PATCH 6/6] pc: Allow instantiating a virtio-iommu device Jean-Philippe Brucker
2021-08-17 14:11   ` Eric Auger
2021-08-27 13:26     ` Jean-Philippe Brucker
2021-09-02  9:36       ` Eric Auger
2021-08-17 14:58 ` [PATCH 0/6] virtio-iommu: Add ACPI support Eric Auger
2021-08-27 13:30   ` Jean-Philippe Brucker
2021-09-29  9:18     ` Eric Auger
2021-09-29 17:08       ` Jean-Philippe Brucker

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