Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99640
b: refs/heads/master
c: 999ba41
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Jul 4, 2008
1 parent c65de30 commit 85d563e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f6a59d8ad55781d4d2ff0d327f84aaeed2c4127
refs/heads/master: 999ba417cc1a43881126d08876d5d7e653113ae3
14 changes: 10 additions & 4 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,22 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu,
static int iommu_flush_pages(struct amd_iommu *iommu, u16 domid,
u64 address, size_t size)
{
int i;
int s = 0;
unsigned pages = to_pages(address, size);

address &= PAGE_MASK;

for (i = 0; i < pages; ++i) {
iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 0);
address += PAGE_SIZE;
if (pages > 1) {
/*
* If we have to flush more than one page, flush all
* TLB entries for this domain
*/
address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS;
s = 1;
}

iommu_queue_inv_iommu_pages(iommu, address, domid, 0, s);

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-x86/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
#define CMD_INV_IOMMU_PAGES_SIZE_MASK 0x01
#define CMD_INV_IOMMU_PAGES_PDE_MASK 0x02

#define CMD_INV_IOMMU_ALL_PAGES_ADDRESS 0x7fffffffffffffffULL

/* macros and definitions for device table entries */
#define DEV_ENTRY_VALID 0x00
#define DEV_ENTRY_TRANSLATION 0x01
Expand Down

0 comments on commit 85d563e

Please sign in to comment.