aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-12-02 15:01:12 -0500
committerJoerg Roedel <joerg.roedel@amd.com>2009-01-03 08:11:54 -0500
commit43f4960983a309568a6c4375f081e63fb2ff24a3 (patch)
tree44291b360182d0f2e6ca2fa8958476788fa0345d /arch/x86/kernel/amd_iommu.c
parent9e919012e33c481991e46aa4cb13d807cd47b798 (diff)
AMD IOMMU: add iommu_flush_domain function
Impact: add a function to flush a domain id on every IOMMU Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel/amd_iommu.c')
-rw-r--r--arch/x86/kernel/amd_iommu.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index b7b3067630cf..2b6b8e050bd8 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -352,6 +352,30 @@ static void iommu_flush_tlb(struct amd_iommu *iommu, u16 domid)
352 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 1); 352 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 1);
353} 353}
354 354
355#ifdef CONFIG_IOMMU_API
356/*
357 * This function is used to flush the IO/TLB for a given protection domain
358 * on every IOMMU in the system
359 */
360static void iommu_flush_domain(u16 domid)
361{
362 unsigned long flags;
363 struct amd_iommu *iommu;
364 struct iommu_cmd cmd;
365
366 __iommu_build_inv_iommu_pages(&cmd, CMD_INV_IOMMU_ALL_PAGES_ADDRESS,
367 domid, 1, 1);
368
369 list_for_each_entry(iommu, &amd_iommu_list, list) {
370 spin_lock_irqsave(&iommu->lock, flags);
371 __iommu_queue_command(iommu, &cmd);
372 __iommu_completion_wait(iommu);
373 __iommu_wait_for_completion(iommu);
374 spin_unlock_irqrestore(&iommu->lock, flags);
375 }
376}
377#endif
378
355/**************************************************************************** 379/****************************************************************************
356 * 380 *
357 * The functions below are used the create the page table mappings for 381 * The functions below are used the create the page table mappings for