Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2beab3f authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: arm-smmu: Add error message for hibernation usecase



The iommu driver may use hyp_assign to ensure its page tables are
mapped in stage 2 page table appropriate for a secure usecase. As
hypervisor configuration is not restored across hibernation, this
usecase is not currently supported. Print an error instead of
failing with an access violation.

Change-Id: Iaaaae2c2199555f61cff915b994510a07984d42c
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 07cff1d2
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -515,6 +515,11 @@ static void arm_smmu_secure_domain_unlock(struct arm_smmu_domain *smmu_domain)
		mutex_unlock(&smmu_domain->assign_lock);
		mutex_unlock(&smmu_domain->assign_lock);
}
}


static bool arm_smmu_opt_hibernation(struct arm_smmu_device *smmu)
{
	return IS_ENABLED(CONFIG_HIBERNATION);
}

/*
/*
 * init()
 * init()
 * Hook for additional device tree parsing at probe time.
 * Hook for additional device tree parsing at probe time.
@@ -1688,6 +1693,14 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
		goto out_unlock;
		goto out_unlock;
	}
	}


	if (arm_smmu_has_secure_vmid(smmu_domain) &&
	    arm_smmu_opt_hibernation(smmu)) {
		dev_err(smmu->dev,
			"Secure usecases not supported with hibernation\n");
		ret = -EPERM;
		goto out_unlock;
	}

	/*
	/*
	 * Mapping the requested stage onto what we support is surprisingly
	 * Mapping the requested stage onto what we support is surprisingly
	 * complicated, mainly because the spec allows S1+S2 SMMUs without
	 * complicated, mainly because the spec allows S1+S2 SMMUs without