diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-09-02 09:41:59 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-09-03 10:03:43 -0400 |
commit | 6a0dbcbe4e612fbc9d73cd4dde8ebef19295058a (patch) | |
tree | 12211af09fb4ef74fb5a58f078cf0b60693dc352 /arch/x86/kernel | |
parent | a6d41a4027b758a9473197a78fab45afb31003aa (diff) |
x86/amd-iommu: Add a gneric version of amd_iommu_flush_all_devices
This patch adds a generic variant of
amd_iommu_flush_all_devices function which flushes only the
DTEs for a given protection domain.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 4a54366d422d..5265dd17eb5c 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -481,13 +481,14 @@ void amd_iommu_flush_all_domains(void) | |||
481 | } | 481 | } |
482 | } | 482 | } |
483 | 483 | ||
484 | void amd_iommu_flush_all_devices(void) | 484 | static void flush_devices_by_domain(struct protection_domain *domain) |
485 | { | 485 | { |
486 | struct amd_iommu *iommu; | 486 | struct amd_iommu *iommu; |
487 | int i; | 487 | int i; |
488 | 488 | ||
489 | for (i = 0; i <= amd_iommu_last_bdf; ++i) { | 489 | for (i = 0; i <= amd_iommu_last_bdf; ++i) { |
490 | if (amd_iommu_pd_table[i] == NULL) | 490 | if ((domain == NULL && amd_iommu_pd_table[i] == NULL) || |
491 | (amd_iommu_pd_table[i] != domain)) | ||
491 | continue; | 492 | continue; |
492 | 493 | ||
493 | iommu = amd_iommu_rlookup_table[i]; | 494 | iommu = amd_iommu_rlookup_table[i]; |
@@ -499,6 +500,11 @@ void amd_iommu_flush_all_devices(void) | |||
499 | } | 500 | } |
500 | } | 501 | } |
501 | 502 | ||
503 | void amd_iommu_flush_all_devices(void) | ||
504 | { | ||
505 | flush_devices_by_domain(NULL); | ||
506 | } | ||
507 | |||
502 | /**************************************************************************** | 508 | /**************************************************************************** |
503 | * | 509 | * |
504 | * The functions below are used the create the page table mappings for | 510 | * The functions below are used the create the page table mappings for |