How to add VFIO-IOMMU in KVM virtual machine (Aarch64)?

632 views Asked by At

I am using aarch64 Linux to test VFIO-IOMMU feature in KVM VM.

The host is cortex-A78 running Linux-5.10.104 (with VFIO_IOMMU enabled). The guest OS is Ubuntu-22.04 (Linux-5.15, also with VFIO_IOMMU enabled).

The VM is created with virt-manager with virtio devices, like NIC, SCSI, etc.
But I did not find the way to add VFIO-IOMMU device to the VM in internet.

I tried by adding following lines into the vm.xml,

  <iommu model='smmuv3'/>

But after guest OS boot, I found following logs about iommu but nothing about SMMUv3.

t@t:~$ dmesg | grep -i mmu
[    0.320696] iommu: Default domain type: Translated
[    0.321218] iommu: DMA domain TLB invalidation policy: strict mode

So how can VFIO-IOMMU be supported/added to the VM in this case?

The qemu-system-aarch64 is 4.2.1, I am not sure if it could support smmuv4 for ARMv8

1

There are 1 answers

0
wangt13 On

I confirmed that QEMU-6.2.0 supports SMMUv3. The guest OS log shows something as follows,

[    0.578157] arm-smmu-v3 arm-smmu-v3.0.auto: option mask 0x0
[    0.578841] arm-smmu-v3 arm-smmu-v3.0.auto: ias 44-bit, oas 44-bit (features 0x00008305)
[    0.580289] arm-smmu-v3 arm-smmu-v3.0.auto: allocated 65536 entries for cmdq
[    0.581060] arm-smmu-v3 arm-smmu-v3.0.auto: allocated 128 entries for evtq