Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282754
b: refs/heads/master
c: 62f71ab
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel committed Dec 12, 2011
1 parent 758086e commit 79aecd6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee6c28684585a64fd79c5a56e849af58ebdc5948
refs/heads/master: 62f71abbc64d686064a4caa10a3249c26776995e
13 changes: 13 additions & 0 deletions trunk/drivers/iommu/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ int amd_iommus_present;
bool amd_iommu_np_cache __read_mostly;
bool amd_iommu_iotlb_sup __read_mostly = true;

u32 amd_iommu_max_pasids __read_mostly = ~0;

/*
* The ACPI table parsing functions set this variable on an error
*/
Expand Down Expand Up @@ -699,6 +701,17 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu)

iommu->features = ((u64)high << 32) | low;

if (iommu_feature(iommu, FEATURE_GT)) {
u32 pasids;
u64 shift;

shift = iommu->features & FEATURE_PASID_MASK;
shift >>= FEATURE_PASID_SHIFT;
pasids = (1 << shift);

amd_iommu_max_pasids = min(amd_iommu_max_pasids, pasids);
}

if (!is_rd890_iommu(iommu->dev))
return;

Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/iommu/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
#define FEATURE_HE (1ULL<<8)
#define FEATURE_PC (1ULL<<9)

#define FEATURE_PASID_SHIFT 32
#define FEATURE_PASID_MASK (0x1fULL << FEATURE_PASID_SHIFT)

/* MMIO status bits */
#define MMIO_STATUS_COM_WAIT_INT_MASK 0x04

Expand Down Expand Up @@ -549,6 +552,9 @@ extern unsigned long *amd_iommu_pd_alloc_bitmap;
*/
extern bool amd_iommu_unmap_flush;

/* Smallest number of PASIDs supported by any IOMMU in the system */
extern u32 amd_iommu_max_pasids;

/* takes bus and device/function and returns the device id
* FIXME: should that be in generic PCI code? */
static inline u16 calc_devid(u8 bus, u8 devfn)
Expand Down

0 comments on commit 79aecd6

Please sign in to comment.