remarkable-linux/drivers/iommu
Alex Williamson a5459cfece iommu/vt-d: Make use of IOMMU sysfs support
Register our DRHD IOMMUs, cross link devices, and provide a base set
of attributes for the IOMMU.  Note that IRQ remapping support parses
the DMAR table very early in boot, well before the iommu_class can
reasonably be setup, so our registration is split between
intel_iommu_init(), which occurs later, and alloc_iommu(), which
typically occurs much earlier, but may happen at any time later
with IOMMU hot-add support.

On a typical desktop system, this provides the following (pruned):

$ find /sys | grep dmar
/sys/devices/virtual/iommu/dmar0
/sys/devices/virtual/iommu/dmar0/devices
/sys/devices/virtual/iommu/dmar0/devices/0000:00:02.0
/sys/devices/virtual/iommu/dmar0/intel-iommu
/sys/devices/virtual/iommu/dmar0/intel-iommu/cap
/sys/devices/virtual/iommu/dmar0/intel-iommu/ecap
/sys/devices/virtual/iommu/dmar0/intel-iommu/address
/sys/devices/virtual/iommu/dmar0/intel-iommu/version
/sys/devices/virtual/iommu/dmar1
/sys/devices/virtual/iommu/dmar1/devices
/sys/devices/virtual/iommu/dmar1/devices/0000:00:00.0
/sys/devices/virtual/iommu/dmar1/devices/0000:00:01.0
/sys/devices/virtual/iommu/dmar1/devices/0000:00:16.0
/sys/devices/virtual/iommu/dmar1/devices/0000:00:1a.0
/sys/devices/virtual/iommu/dmar1/devices/0000:00:1b.0
/sys/devices/virtual/iommu/dmar1/devices/0000:00:1c.0
...
/sys/devices/virtual/iommu/dmar1/intel-iommu
/sys/devices/virtual/iommu/dmar1/intel-iommu/cap
/sys/devices/virtual/iommu/dmar1/intel-iommu/ecap
/sys/devices/virtual/iommu/dmar1/intel-iommu/address
/sys/devices/virtual/iommu/dmar1/intel-iommu/version
/sys/class/iommu/dmar0
/sys/class/iommu/dmar1

(devices also link back to the dmar units)

This makes address, version, capabilities, and extended capabilities
available, just like printed on boot.  I've tried not to duplicate
data that can be found in the DMAR table, with the exception of the
address, which provides an easy way to associate the sysfs device with
a DRHD entry in the DMAR.  It's tempting to add scopes and RMRR data
here, but the full DMAR table is already exposed under /sys/firmware/
and therefore already provides a way for userspace to learn such
details.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2014-07-04 12:35:59 +02:00
..
amd_iommu.c iommu/amd: Use iommu_group_get_for_dev() 2014-07-04 12:35:58 +02:00
amd_iommu_init.c iommu/amd: fix enabling exclusion range for an exact device 2014-05-13 12:33:12 +02:00
amd_iommu_proto.h perf/x86/amd: Add IOMMU Performance Counter resource management 2013-06-19 13:04:52 +02:00
amd_iommu_types.h iommu/amd: Use iommu_group_get_for_dev() 2014-07-04 12:35:58 +02:00
amd_iommu_v2.c iommu/amd: Fix small race between invalidate_range_end/start 2014-06-20 16:14:22 +02:00
arm-smmu.c iommu/arm-smmu: fix incorrect use of S2CR_TYPE_SHIFT 2014-05-02 16:49:37 +01:00
dmar.c iommu/vt-d: Make use of IOMMU sysfs support 2014-07-04 12:35:59 +02:00
exynos-iommu.c Driver core / kernfs pull request for 3.16-rc1 2014-06-03 08:07:41 -07:00
fsl_pamu.c iommu: fsl_pamu.c: Fix for possible null pointer dereference 2014-05-26 11:44:29 +02:00
fsl_pamu.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
fsl_pamu_domain.c iommu/fsl: Use iommu_group_get_for_dev() for IOMMU groups 2014-07-04 12:35:58 +02:00
fsl_pamu_domain.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
intel-iommu.c iommu/vt-d: Make use of IOMMU sysfs support 2014-07-04 12:35:59 +02:00
intel_irq_remapping.c iommu/vt-d: Update to use PCI DMA aliases 2014-07-04 12:35:58 +02:00
iommu-sysfs.c iommu: Add sysfs support for IOMMUs 2014-07-04 12:35:59 +02:00
iommu-traces.c iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
iommu.c iommu/core: Create central IOMMU group lookup/creation interface 2014-07-04 12:35:58 +02:00
iova.c iommu/vt-d: Update IOMMU state when memory hotplug happens 2014-03-04 17:51:06 +01:00
ipmmu-vmsa.c arm/ipmmu-vmsa: Fix compile error 2014-05-26 13:18:18 +02:00
irq_remapping.c x86: irq_remapping: Use irq_alloc/free_hwirq() 2014-05-16 14:05:18 +02:00
irq_remapping.h iommu/vt-d: add quirk for broken interrupt remapping on 55XX chipsets 2013-04-18 17:00:47 +02:00
Kconfig Merge branches 'iommu/fixes', 'arm/omap', 'arm/smmu', 'arm/shmobile', 'x86/amd', 'arm/exynos', 'arm/renesas', 'ppc/pamu' and 'arm/msm' into next 2014-05-30 20:22:10 +02:00
Makefile iommu: Add sysfs support for IOMMUs 2014-07-04 12:35:59 +02:00
msm_iommu.c iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu_dev.c iommu/msm: Use devm_ioremap_resource to simplify code 2014-05-30 20:20:12 +02:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
of_iommu.c iommu: add missing include 2014-01-07 15:16:27 +01:00
omap-iommu-debug.c drivers/iommu/omap-iommu-debug.c: fix decimal permissions 2014-02-25 15:25:42 -08:00
omap-iommu.c iommu/omap: Fix map protection value handling 2014-04-16 16:30:18 +02:00
omap-iommu.h iommu/omap: Enable bus-error back on supported iommus 2014-03-04 17:02:08 +01:00
omap-iommu2.c iommu/omap: Enable bus-error back on supported iommus 2014-03-04 17:02:08 +01:00
omap-iopgtable.h iommu/omap: Move to_iommu definition from omap-iopgtable.h 2014-04-16 16:30:15 +02:00
omap-iovmm.c iommu/omap: fix checkpatch warnings in omap iommu code 2013-06-20 16:53:26 +02:00
shmobile-iommu.c arm: dma-mapping: remove order parameter from arm_iommu_create_mapping() 2014-02-28 11:55:18 +01:00
shmobile-ipmmu.c iommu/shmobile: Use devm_ioremap_resource() 2014-04-17 12:16:12 +02:00
shmobile-ipmmu.h iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
tegra-gart.c iommu/tegra-gart: Staticize tegra_gart_pm_ops 2013-11-01 14:23:20 +01:00
tegra-smmu.c iommu/tegra-smmu: Staticize tegra_smmu_pm_ops 2013-11-01 14:23:33 +01:00