From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 745FF903AB for ; Wed, 24 Jan 2024 10:49:31 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4A2B39965 for ; Wed, 24 Jan 2024 10:49:31 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 24 Jan 2024 10:49:30 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1165849270 for ; Wed, 24 Jan 2024 10:49:30 +0100 (CET) From: Markus Frank To: pve-devel@lists.proxmox.com Date: Wed, 24 Jan 2024 10:49:17 +0100 Message-Id: <20240124094918.260222-4-m.frank@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240124094918.260222-1-m.frank@proxmox.com> References: <20240124094918.260222-1-m.frank@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.032 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH docs v8 3/4] added vIOMMU documentation X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2024 09:49:31 -0000 Signed-off-by: Markus Frank --- qm-pci-passthrough.adoc | 51 +++++++++++++++++++++++++++++++++++++++++ qm.adoc | 1 + 2 files changed, 52 insertions(+) diff --git a/qm-pci-passthrough.adoc b/qm-pci-passthrough.adoc index 3abeb50..04a3bc2 100644 --- a/qm-pci-passthrough.adoc +++ b/qm-pci-passthrough.adoc @@ -499,6 +499,57 @@ properly used with HA and hardware changes are detected and non root users can configure them. See xref:resource_mapping[Resource Mapping] for details on that. +[[qm_pci_viommu]] +vIOMMU (emulated IOMMU) +~~~~~~~~~~~~~~~~~~~~~~~ + +vIOMMU is the emulation of a hardware IOMMU within a virtual machine, +providing improved memory access control and security for virtualized I/O devices. +Using the vIOMMU option also allows you to to passthrough PCI devices to level-2 +VMs in level-1 VMs via +https://pve.proxmox.com/wiki/Nested_Virtualization[nested virtualization]. +There are currently two vIOMMU implementations available: Intel and VirtIO. + +Host requirement: + +* Add `intel_iommu=on` or `amd_iommu=on` depending on your CPU to your kernel +command line. + +Intel vIOMMU +^^^^^^^^^^^^ + +Intel vIOMMU specific VM requirements: + +* Whether you are using an Intel or AMD CPU on your host, it is important to set +`intel_iommu=on` in the VMs kernel parameters. + +* To use Intel vIOMMU you need to set *q35* as the machine type. + +If all requirements are met, you can add `viommu=intel` to the machine parameter +in the configuration of the VM that should be able to passthrough PCI devices. + +---- +# qm set VMID -machine q35,viommu=intel +---- + +https://wiki.qemu.org/Features/VT-d[QEMU documentation for VT-d] + +VirtIO vIOMMU +^^^^^^^^^^^^^ + +This vIOMMU implementation is more recent and does not have as many limitations +as Intel vIOMMU but is currently less used in production and less documentated. + +With VirtIO vIOMMU there is *no* need to set any kernel parameters. +It is also *not* necessary to use q35 as the machine type, but it is advisable +if you want to use PCIe. + +---- +# qm set VMID -machine q35,viommu=virtio +---- + +https://web.archive.org/web/20230804075844/https://michael2012z.medium.com/virtio-iommu-789369049443[Blog-Post by Michael Zhao explaining virtio-iommu] + ifdef::wiki[] See Also diff --git a/qm.adoc b/qm.adoc index fa6a772..ac9738f 100644 --- a/qm.adoc +++ b/qm.adoc @@ -152,6 +152,7 @@ https://en.wikipedia.org/wiki/Intel_440FX[Intel 440FX] or the https://ark.intel.com/content/www/us/en/ark/products/31918/intel-82q35-graphics-and-memory-controller.html[Q35] chipset, which also provides a virtual PCIe bus, and thus may be desired if you want to pass through PCIe hardware. +Additionally, you can select a xref:qm_pci_viommu[vIOMMU] implementation. Machine Version +++++++++++++++ -- 2.39.2