On Wed, 22 Mar 2017 11:06:47 +0000 Gabor Locsei <gabor.loc...@ericsson.com> wrote:
> Hello, > > I have systems with IOMMU optionally enabled, and I would like to find a > method to check these capabilities that doesn't rely on dmesg. > The evident problem is that dmesg eventually clear boot time messages so the > relevant lines may just disappear. > > Looks like there are sysfs entries that seem to be fit for this purpose. > > DMAR The file /sys/firmware/acpi/tables/DMAR exists. (This > file exists on every lab node.) > IOMMU The directory /sys/devices/virtual/iommu/ exists and > there are dmar0, etc device subdirectories in it > > I have looked into the ACPI DMAR tables with iasl, but they look the same > regardless of the cmdline iommu settings. > The question is, provided that the platform has ACPI, is it safe to rely on > sysfs, is the above enough to prove that IOMMU is available? The oldest > kernel version to verify against is 3.10.0 from RHEL. DMAR is a firmware table, it's present so long as VT-d is enabled in the BIOS, irrespective of whether the IOMMU is enabled in the kernel. The IOMMU sysfs support was added exactly for this purpose (I tend to prefer reference via /sys/class/iommu). IOMMU sysfs support was added in v3.17, but note that the RHEL version of v3.10 is a moving target, not a fixed point in time. This support was added in the RHEL 7.1 kernel. Thanks, Alex _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu