summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/amd_iommu_proto.h
diff options
context:
space:
mode:
authorJoerg Roedel2011-04-11 11:03:18 +0200
committerJoerg Roedel2011-04-12 09:21:51 +0200
commitd99ddec3eee0be8a43b2c1ff624b9dfaaa26b959 (patch)
treea87ad31dc20c42346f05bf74f98aa84243bf50a4 /arch/x86/include/asm/amd_iommu_proto.h
parentx86/amd-iommu: Flush all internal TLBs when IOMMUs are enabled (diff)
downloadkernel-qcow2-linux-d99ddec3eee0be8a43b2c1ff624b9dfaaa26b959.tar.gz
kernel-qcow2-linux-d99ddec3eee0be8a43b2c1ff624b9dfaaa26b959.tar.xz
kernel-qcow2-linux-d99ddec3eee0be8a43b2c1ff624b9dfaaa26b959.zip
x86/amd-iommu: Add extended feature detection
This patch adds detection of the extended features of an AMD IOMMU. The available features are printed to dmesg on boot. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/include/asm/amd_iommu_proto.h')
-rw-r--r--arch/x86/include/asm/amd_iommu_proto.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h
index 1223c0fe03f5..a4ae6c3875eb 100644
--- a/arch/x86/include/asm/amd_iommu_proto.h
+++ b/arch/x86/include/asm/amd_iommu_proto.h
@@ -19,7 +19,7 @@
#ifndef _ASM_X86_AMD_IOMMU_PROTO_H
#define _ASM_X86_AMD_IOMMU_PROTO_H
-struct amd_iommu;
+#include <asm/amd_iommu_types.h>
extern int amd_iommu_init_dma_ops(void);
extern int amd_iommu_init_passthrough(void);
@@ -42,4 +42,12 @@ static inline bool is_rd890_iommu(struct pci_dev *pdev)
(pdev->device == PCI_DEVICE_ID_RD890_IOMMU);
}
+static inline bool iommu_feature(struct amd_iommu *iommu, u64 f)
+{
+ if (!(iommu->cap & (1 << IOMMU_CAP_EFR)))
+ return false;
+
+ return !!(iommu->features & f);
+}
+
#endif /* _ASM_X86_AMD_IOMMU_PROTO_H */