aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>2014-03-05 19:54:18 -0500
committerJoerg Roedel <joro@8bytes.org>2014-03-24 11:45:59 -0400
commita919a018cccf999aa56d7f9adeae0525b01b7434 (patch)
tree2dc30421a1fff7a9bb26d0209aff36ba39a4998d /drivers/iommu/amd_iommu.c
parente8d2d82d4a73f37b3270e4fd19ba83e48b589656 (diff)
iommu/amd: Fix logic to determine and checking max PASID
In reality, the spec can only support 16-bit PASID since INVALIDATE_IOTLB_PAGES and COMPLETE_PPR_REQUEST commands only allow 16-bit PASID. So, we updated the PASID_MASK accordingly and invoke BUG_ON if the hardware is reporting PASmax more than 16-bit. Besides, max PASID is defined as ((2^(PASmax+1)) - 1). The current does not determine this correctly. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Tested-by: Jay Cornwall <Jay.Cornwall@amd.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 1dd9f818fc84..c949520bd196 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -963,7 +963,7 @@ static void build_inv_iommu_pasid(struct iommu_cmd *cmd, u16 domid, int pasid,
963 963
964 address &= ~(0xfffULL); 964 address &= ~(0xfffULL);
965 965
966 cmd->data[0] = pasid & PASID_MASK; 966 cmd->data[0] = pasid;
967 cmd->data[1] = domid; 967 cmd->data[1] = domid;
968 cmd->data[2] = lower_32_bits(address); 968 cmd->data[2] = lower_32_bits(address);
969 cmd->data[3] = upper_32_bits(address); 969 cmd->data[3] = upper_32_bits(address);
@@ -1001,7 +1001,7 @@ static void build_complete_ppr(struct iommu_cmd *cmd, u16 devid, int pasid,
1001 1001
1002 cmd->data[0] = devid; 1002 cmd->data[0] = devid;
1003 if (gn) { 1003 if (gn) {
1004 cmd->data[1] = pasid & PASID_MASK; 1004 cmd->data[1] = pasid;
1005 cmd->data[2] = CMD_INV_IOMMU_PAGES_GN_MASK; 1005 cmd->data[2] = CMD_INV_IOMMU_PAGES_GN_MASK;
1006 } 1006 }
1007 cmd->data[3] = tag & 0x1ff; 1007 cmd->data[3] = tag & 0x1ff;