Commit ae853ddb authored by David Woodhouse's avatar David Woodhouse

iommu/vt-d: Introduce intel_iommu=pasid28, and pasid_enabled() macro

As long as we use an identity mapping to work around the worst of the
hardware bugs which caused us to defeature it and change the definition
of the capability bit, we *can* use PASID support on the devices which
advertised it in bit 28 of the Extended Capability Register.

Allow people to do so with 'intel_iommu=pasid28' on the command line.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent d14053b3
...@@ -497,13 +497,21 @@ static int dmar_forcedac; ...@@ -497,13 +497,21 @@ static int dmar_forcedac;
static int intel_iommu_strict; static int intel_iommu_strict;
static int intel_iommu_superpage = 1; static int intel_iommu_superpage = 1;
static int intel_iommu_ecs = 1; static int intel_iommu_ecs = 1;
static int intel_iommu_pasid28;
static int iommu_identity_mapping;
#define IDENTMAP_ALL 1
#define IDENTMAP_GFX 2
#define IDENTMAP_AZALIA 4
/* We only actually use ECS when PASID support (on the new bit 40) /* We only actually use ECS when PASID support (on the new bit 40)
* is also advertised. Some early implementations — the ones with * is also advertised. Some early implementations — the ones with
* PASID support on bit 28 — have issues even when we *only* use * PASID support on bit 28 — have issues even when we *only* use
* extended root/context tables. */ * extended root/context tables. */
#define pasid_enabled(iommu) (ecap_pasid(iommu->ecap) || \
(intel_iommu_pasid28 && ecap_broken_pasid(iommu->ecap)))
#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap) && \ #define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap) && \
ecap_pasid(iommu->ecap)) pasid_enabled(iommu))
int intel_iommu_gfx_mapped; int intel_iommu_gfx_mapped;
EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
...@@ -566,6 +574,11 @@ static int __init intel_iommu_setup(char *str) ...@@ -566,6 +574,11 @@ static int __init intel_iommu_setup(char *str)
printk(KERN_INFO printk(KERN_INFO
"Intel-IOMMU: disable extended context table support\n"); "Intel-IOMMU: disable extended context table support\n");
intel_iommu_ecs = 0; intel_iommu_ecs = 0;
} else if (!strncmp(str, "pasid28", 7)) {
printk(KERN_INFO
"Intel-IOMMU: enable pre-production PASID support\n");
intel_iommu_pasid28 = 1;
iommu_identity_mapping |= IDENTMAP_GFX;
} }
str += strcspn(str, ","); str += strcspn(str, ",");
...@@ -2403,11 +2416,6 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw) ...@@ -2403,11 +2416,6 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
return domain; return domain;
} }
static int iommu_identity_mapping;
#define IDENTMAP_ALL 1
#define IDENTMAP_GFX 2
#define IDENTMAP_AZALIA 4
static int iommu_domain_identity_map(struct dmar_domain *domain, static int iommu_domain_identity_map(struct dmar_domain *domain,
unsigned long long start, unsigned long long start,
unsigned long long end) unsigned long long end)
......
...@@ -121,7 +121,7 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) ...@@ -121,7 +121,7 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
#define ecap_srs(e) ((e >> 31) & 0x1) #define ecap_srs(e) ((e >> 31) & 0x1)
#define ecap_ers(e) ((e >> 30) & 0x1) #define ecap_ers(e) ((e >> 30) & 0x1)
#define ecap_prs(e) ((e >> 29) & 0x1) #define ecap_prs(e) ((e >> 29) & 0x1)
/* PASID support used to be on bit 28 */ #define ecap_broken_pasid(e) ((e >> 28) & 0x1)
#define ecap_dis(e) ((e >> 27) & 0x1) #define ecap_dis(e) ((e >> 27) & 0x1)
#define ecap_nest(e) ((e >> 26) & 0x1) #define ecap_nest(e) ((e >> 26) & 0x1)
#define ecap_mts(e) ((e >> 25) & 0x1) #define ecap_mts(e) ((e >> 25) & 0x1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment