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

Commit f8c83ddd authored by Shrenuj Bansal's avatar Shrenuj Bansal
Browse files

msm: kgsl: Set the secure vmid domain attribute



Pass the secure pixel vmid for the secure context banks in domain
attributes. The secure pagetable resides in stage 1 HLOS and needs
to be moved to stage 2 Hypervisor. The SMMU driver takes care of
this by looking at the domain attribute.

Change-Id: I9cefcefb92b59afb2ac0dab53d4102682e07f904
Signed-off-by: default avatarShrenuj Bansal <shrenujb@codeaurora.org>
parent a2287c55
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/iommu.h>
#include <linux/msm_kgsl.h>
#include <soc/qcom/secure_buffer.h>
#include <stddef.h>

#include "kgsl.h"
@@ -566,6 +567,16 @@ static int kgsl_iommu_init_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt)
	iommu_domain_set_attr(iommu_pt->domain,
			DOMAIN_ATTR_COHERENT_HTW_DISABLE, &disable_htw);

	/* Provide the secure vmid domain attribute to the SMMU driver */
	if (pt->name == KGSL_MMU_SECURE_PT) {
		int secure_vmid = VMID_CP_PIXEL;

		ret = iommu_domain_set_attr(iommu_pt->domain,
			DOMAIN_ATTR_SECURE_VMID, &secure_vmid);
		if (ret)
			goto err;
	}

	pt->pt_ops = &iommu_pt_ops;
	pt->priv = iommu_pt;