diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-05-05 09:33:57 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-05-28 12:10:12 -0400 |
commit | bfd1be1857e5a3385bf146e02e6dc3dd4241bec1 (patch) | |
tree | b33ca1a26dcecae3556ea9a1c3c019ffcfaab52e /arch | |
parent | 92ac4320af6ed4294c2c221dd4ccbfd9026a3aa7 (diff) |
amd-iommu: add function to flush tlb for all domains
This function is required for suspend/resume support with AMD IOMMU
enabled.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/amd_iommu.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/include/asm/amd_iommu.h b/arch/x86/include/asm/amd_iommu.h index f712344329bc..1750e1f85d3c 100644 --- a/arch/x86/include/asm/amd_iommu.h +++ b/arch/x86/include/asm/amd_iommu.h | |||
@@ -27,6 +27,7 @@ extern int amd_iommu_init(void); | |||
27 | extern int amd_iommu_init_dma_ops(void); | 27 | extern int amd_iommu_init_dma_ops(void); |
28 | extern void amd_iommu_detect(void); | 28 | extern void amd_iommu_detect(void); |
29 | extern irqreturn_t amd_iommu_int_handler(int irq, void *data); | 29 | extern irqreturn_t amd_iommu_int_handler(int irq, void *data); |
30 | extern void amd_iommu_flush_all_domains(void); | ||
30 | #else | 31 | #else |
31 | static inline int amd_iommu_init(void) { return -ENODEV; } | 32 | static inline int amd_iommu_init(void) { return -ENODEV; } |
32 | static inline void amd_iommu_detect(void) { } | 33 | static inline void amd_iommu_detect(void) { } |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index d9e9dc141a1e..826ad079efc4 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -449,6 +449,17 @@ static void iommu_flush_domain(u16 domid) | |||
449 | } | 449 | } |
450 | } | 450 | } |
451 | 451 | ||
452 | void amd_iommu_flush_all_domains(void) | ||
453 | { | ||
454 | int i; | ||
455 | |||
456 | for (i = 1; i < MAX_DOMAIN_ID; ++i) { | ||
457 | if (!test_bit(i, amd_iommu_pd_alloc_bitmap)) | ||
458 | continue; | ||
459 | iommu_flush_domain(i); | ||
460 | } | ||
461 | } | ||
462 | |||
452 | /**************************************************************************** | 463 | /**************************************************************************** |
453 | * | 464 | * |
454 | * The functions below are used the create the page table mappings for | 465 | * The functions below are used the create the page table mappings for |