Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245394
b: refs/heads/master
c: 58fc7f1
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel committed Apr 12, 2011
1 parent 3c36587 commit 41d1c20
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 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: d99ddec3eee0be8a43b2c1ff624b9dfaaa26b959
refs/heads/master: 58fc7f1419560efa9c426b829c195050e0147d7f
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
#define CMD_COMPL_WAIT 0x01
#define CMD_INV_DEV_ENTRY 0x02
#define CMD_INV_IOMMU_PAGES 0x03
#define CMD_INV_ALL 0x08

#define CMD_COMPL_WAIT_STORE_MASK 0x01
#define CMD_COMPL_WAIT_INT_MASK 0x02
Expand Down
24 changes: 22 additions & 2 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ static void build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
cmd->data[2] |= CMD_INV_IOMMU_PAGES_PDE_MASK;
}

static void build_inv_all(struct iommu_cmd *cmd)
{
memset(cmd, 0, sizeof(*cmd));
CMD_SET_TYPE(cmd, CMD_INV_ALL);
}

/*
* Writes the command to the IOMMUs command buffer and informs the
* hardware about the new command.
Expand Down Expand Up @@ -567,10 +573,24 @@ static void iommu_flush_tlb_all(struct amd_iommu *iommu)
iommu_completion_wait(iommu);
}

static void iommu_flush_all(struct amd_iommu *iommu)
{
struct iommu_cmd cmd;

build_inv_all(&cmd);

iommu_queue_command(iommu, &cmd);
iommu_completion_wait(iommu);
}

void iommu_flush_all_caches(struct amd_iommu *iommu)
{
iommu_flush_dte_all(iommu);
iommu_flush_tlb_all(iommu);
if (iommu_feature(iommu, FEATURE_IA)) {
iommu_flush_all(iommu);
} else {
iommu_flush_dte_all(iommu);
iommu_flush_tlb_all(iommu);
}
}

/*
Expand Down

0 comments on commit 41d1c20

Please sign in to comment.