Hi, Since long time ago, to enable the SR-IOV VF pci passthrough function, I'm always adding "amd_iommu=on" into kernel cmdline on AMD system. But recently I found even I do not do this action, IOMMU is still enabled by kernel on AMD system. After searching, I found there is no such setting any more, refer to https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/kernel-parameters.txt#L286 There are only 3 possible value as below: amd_iommu= fullflush off force_isolation Could anyone can help to confirm the changes? Thank you! And another question, it is said that the "iommu=pt" option is to improves IO performance for devices in the host, it is not a must for VF PCI passthrough, right? I'm not sure about the user cases. [Reference] 1. Reference about adding "amd_iommu=on", and it may be outdated: http://dpdk-guide.gitlab.io/dpdk-guide/setup/iommu.html 2. On AMD system without adding "amd_iommu=on" in the kernel cmdline, the iommu is enabled: # cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-193.el8.x86_64 root=/dev/mapper/rhel_hp--dl385g10--16-root ro crashkernel=auto resume=/dev/mapper/rhel_hp--dl385g10--16-swap rd.lvm.lv=rhel_hp-dl385g10-16/root rd.lvm.lv=rhel_hp-dl385g10-16/swap console=ttyS0,115200n81 # dmesg | grep -i iommu [ 3.712029] iommu: Default domain type: Passthrough [ 6.736019] pci 0000:00:00.2: IOMMU performance counters supported ... [ 6.780040] pci 0000:e0:00.2: IOMMU performance counters supported [ 6.786740] pci 0000:00:01.0: Adding to iommu group 0 [ 6.791876] pci 0000:00:01.1: Adding to iommu group 1 [ 6.797015] pci 0000:00:01.2: Adding to iommu group 2 [ 6.802150] pci 0000:00:01.4: Adding to iommu group 3 ... [ 7.866463] pci 0000:e0:00.2: Found IOMMU cap 0x40 [ 7.920222] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank). [ 7.927428] perf/amd_iommu: Detected AMD IOMMU #1 (2 banks, 4 counters/bank) ... ------- Best Regards, Yalan Zhang IRC: yalzhang
Daniel P. Berrangé
2020-Jun-30 11:44 UTC
Re: Do we need "amd_iommu=on" for AMD system anymore?
On Tue, Jun 30, 2020 at 11:33:10AM +0800, Yalan Zhang wrote:> Hi, > > Since long time ago, to enable the SR-IOV VF pci passthrough function, I'm > always adding "amd_iommu=on" into kernel cmdline on AMD system. > But recently I found even I do not do this action, IOMMU is still enabled > by kernel on AMD system.I don't know history of amd_iommu=on, but currently libvirt's official recommendation for AMD hosts, via virt-host-validate is iommu=pt iommu=1 Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Reasonably Related Threads
- [PATCH v2 15/33] iommu/amd: Convert to probe/release_device() call-backs
- [PATCH v2 06/33] iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU
- [PATCH v2 05/33] iommu/amd: Remove dma_mask check from check_device()
- [PATCH v2 03/33] iommu/amd: Implement iommu_ops->def_domain_type call-back
- [RFC PATCH 11/11] x86/MSI: Refactor x86 MSI code