Skip to content

Commit

Permalink
x86/amd-iommu: Add a gneric version of amd_iommu_flush_all_devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Sep 3, 2009
1 parent a6d41a4 commit 6a0dbcb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,14 @@ void amd_iommu_flush_all_domains(void)
}
}

void amd_iommu_flush_all_devices(void)
static void flush_devices_by_domain(struct protection_domain *domain)
{
struct amd_iommu *iommu;
int i;

for (i = 0; i <= amd_iommu_last_bdf; ++i) {
if (amd_iommu_pd_table[i] == NULL)
if ((domain == NULL && amd_iommu_pd_table[i] == NULL) ||
(amd_iommu_pd_table[i] != domain))
continue;

iommu = amd_iommu_rlookup_table[i];
Expand All @@ -499,6 +500,11 @@ void amd_iommu_flush_all_devices(void)
}
}

void amd_iommu_flush_all_devices(void)
{
flush_devices_by_domain(NULL);
}

/****************************************************************************
*
* The functions below are used the create the page table mappings for
Expand Down

0 comments on commit 6a0dbcb

Please sign in to comment.