KVM: arm64: Add documentation for pKVM DMA isolation Populate the section for DMA isolation in pKVM with the newly added KVM IOMMU and pKVM SMMUv3 driver details. Signed-off-by: Mostafa Saleh <smostafa@google.com>
diff --git a/Documentation/virt/kvm/arm/pkvm.rst b/Documentation/virt/kvm/arm/pkvm.rst index 514992a..ce67e2a 100644 --- a/Documentation/virt/kvm/arm/pkvm.rst +++ b/Documentation/virt/kvm/arm/pkvm.rst
@@ -77,7 +77,28 @@ DMA isolation using an IOMMU ---------------------------- -Status: **Unimplemented.** +Status: Supported for devices behind SMMUv3 supporting dual stages +of translation. + +With ``CONFIG_ARM_SMMU_V3_PKVM``, the hypervisor will take over the SMMUs +on the system and provide an architectural emulation to the kernel SMMUv3 +driver. + +If some devices are not behind an IOMMU or behind another IOMMU architecture, +DMA isolation is not supported, as a driver must be provided for that. + +DMA isolation is enforced by dual stages of translation; similar to the CPU +where a driver can register their ops through ``kvm_iommu_register_driver`` +and implement ``host_stage2_idmap`` to shadow the CPU page table. + +The page tables for the stage-2 SMMUv3 will be allocated from a pool created +at boot with size configured from the command line "kvm-arm.iommu_pgt_mem" +The size must cover the worst case scenario for leaf mappings of system memory. + +This implementation trusts the system firmware not to allow the untrusted +host kernel to bypass the SMMUv3. +For example, by resetting the power. In that case, it is the firmware's +responsibility to save/restore the SMMUv3 state. Proxying of Trustzone services ------------------------------