iommu/amd: Fix logic to determine and checking max PASID
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thu, 6 Mar 2014 00:54:18 +0000 (18:54 -0600)
committerJoerg Roedel <joro@8bytes.org>
Mon, 24 Mar 2014 15:45:59 +0000 (16:45 +0100)
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>
drivers/iommu/amd_iommu.c
drivers/iommu/amd_iommu_init.c
drivers/iommu/amd_iommu_types.h

Simple merge
Simple merge
Simple merge