From 456c8ca750243ac7248c4a8ad698b2a8fd618a6f Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Mon, 8 Dec 2008 12:05:55 +0100 Subject: [PATCH] --- yaml --- r: 125611 b: refs/heads/master c: 6d98cd8043c13438e4ca8a9464893f0224198a30 h: refs/heads/master i: 125609: 0fda302597d2385d01ffb059b80296aec79b114a 125607: cec74de0498a409e5bcbada71d3772d6305d5ec0 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/amd_iommu.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8f55f7ac3dd8..3cf09d1803b1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e275a2a0fc9e2168b15f6c7814e30b7ad58b1c7c +refs/heads/master: 6d98cd8043c13438e4ca8a9464893f0224198a30 diff --git a/trunk/arch/x86/kernel/amd_iommu.c b/trunk/arch/x86/kernel/amd_iommu.c index 140875b3f6ef..5d3f085289eb 100644 --- a/trunk/arch/x86/kernel/amd_iommu.c +++ b/trunk/arch/x86/kernel/amd_iommu.c @@ -1579,3 +1579,31 @@ int __init amd_iommu_init_dma_ops(void) return ret; } + +/***************************************************************************** + * + * The following functions belong to the exported interface of AMD IOMMU + * + * This interface allows access to lower level functions of the IOMMU + * like protection domain handling and assignement of devices to domains + * which is not possible with the dma_ops interface. + * + *****************************************************************************/ + +#ifdef CONFIG_IOMMU_API + +static void cleanup_domain(struct protection_domain *domain) +{ + unsigned long flags; + u16 devid; + + write_lock_irqsave(&amd_iommu_devtable_lock, flags); + + for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) + if (amd_iommu_pd_table[devid] == domain) + __detach_device(domain, devid); + + write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); +} + +#endif