I'd like to verify on any given Linux machine if PCI passthrough is supported. After a bit of googling, I found that I should rather check if IOMMU is supported, and I did so by running:
dmesg | grep IOMMU
If it supports IOMMU (and not IOMMUv2), I would get:
IOMMU
[ 0.000000] DMAR: IOMMU enabled
[ 0.049734] DMAR-IR: IOAPIC id 8 under DRHD base 0xfbffc000 IOMMU 0
[ 0.049735] DMAR-IR: IOAPIC id 9 under DRHD base 0xfbffc000 IOMMU 0
[ 1.286567] AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>
[ 1.286568] AMD IOMMUv2 functionality not available on this system
...where DMAR: IOMMU enabled is what I'm looking for.
Now, if the machine has been running for days without a reboot, that first message [ 0.000000] DMAR: IOMMU enabled might not appear any more in the log with the previous command.
Is there any way to check for IOMMU support when that message disappears from the log?