|
@@ -645,7 +645,7 @@ out:
|
|
|
int alloc_iommu(struct dmar_drhd_unit *drhd)
|
|
|
{
|
|
|
struct intel_iommu *iommu;
|
|
|
- u32 ver;
|
|
|
+ u32 ver, sts;
|
|
|
static int iommu_allocated = 0;
|
|
|
int agaw = 0;
|
|
|
int msagaw = 0;
|
|
@@ -695,6 +695,15 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
|
|
|
(unsigned long long)iommu->cap,
|
|
|
(unsigned long long)iommu->ecap);
|
|
|
|
|
|
+ /* Reflect status in gcmd */
|
|
|
+ sts = readl(iommu->reg + DMAR_GSTS_REG);
|
|
|
+ if (sts & DMA_GSTS_IRES)
|
|
|
+ iommu->gcmd |= DMA_GCMD_IRE;
|
|
|
+ if (sts & DMA_GSTS_TES)
|
|
|
+ iommu->gcmd |= DMA_GCMD_TE;
|
|
|
+ if (sts & DMA_GSTS_QIES)
|
|
|
+ iommu->gcmd |= DMA_GCMD_QIE;
|
|
|
+
|
|
|
raw_spin_lock_init(&iommu->register_lock);
|
|
|
|
|
|
drhd->iommu = iommu;
|