Re: [PATCH] iommu/amd: Fix logics to determine and checking max PASID

2014-03-05 Thread Suravee Suthikulanit
On 3/5/2014 4:35 PM, Joerg Roedel wrote: - cmd->data[1] = pasid & PASID_MASK; >+ cmd->data[1] = pasid & amd_iommu_max_pasid; ... masking out the other bits is redundant. Joerg Agree. I can take out the masking stuff here, but I think we should be using the

Re: [PATCH] iommu/amd: Fix logics to determine and checking max PASID

2014-03-05 Thread Suravee Suthikulanit
Joerg, Other commands can still support upto 20-bit PASID. As I mentioned, there is still no system with more than 16-bit PASID. Either way, I have also replaced the PASID_MASK with the value derived from MMIOx30h[PASmax] of the IOMMU Extended Feature register instead. This should allow us no

Re: [PATCH] iommu/amd: Fix logics to determine and checking max PASID

2014-03-05 Thread Joerg Roedel
On Wed, Mar 05, 2014 at 01:01:08PM -0600, suravee.suthikulpa...@amd.com wrote: > drivers/iommu/amd_iommu.c | 26 +++--- > drivers/iommu/amd_iommu_init.c | 15 --- > drivers/iommu/amd_iommu_types.h |6 ++ > drivers/iommu/amd_iommu_v2.c|2 +-

[PATCH] iommu/amd: Fix logics to determine and checking max PASID

2014-03-05 Thread suravee.suthikulpanit
From: Suravee Suthikulpanit According to IOMMUv2, max PASID is defined as ((2^(PASmax+1)) - 1) using the value from MMIOx30[PASmax] register. The current does not determine this correctly. Also the PASID_MASK should be determined by max PASID instead of hardcoding value of 0xf. Adding logic