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

Commit 1a23d418 authored by Neeti Desai's avatar Neeti Desai Committed by Deepak Katragadda
Browse files

msm: Update the permissions while making assign call



When memory that is assigned a particular VMID is re-assigned
back to HLOS, it needs to get RWX permissions so that HLOS can
use it for data as well as instructions.

Change-Id: Ib5413861de877d9081bdf5bd397f528293deb6e8
Signed-off-by: default avatarNeeti Desai <neetid@codeaurora.org>
parent 1aa24ca3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1917,7 +1917,7 @@ static void arm_smmu_unprepare_pgtable(void *cookie, void *addr)
	struct arm_smmu_domain *smmu_domain = cookie;
	int ret;
	int dest_vmids = VMID_HLOS;
	int dest_perms = PERM_READ | PERM_WRITE;
	int dest_perms = PERM_READ | PERM_WRITE | PERM_EXEC;
	int source_vmlist[2] = {VMID_HLOS, smmu_domain->secure_vmid};

	if (smmu_domain->secure_vmid == VMID_INVAL)
+4 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ int pil_assign_mem_to_linux(struct pil_desc *desc, phys_addr_t addr,
	int ret;
	int srcVM[1] = {desc->subsys_vmid};
	int destVM[1] = {VMID_HLOS};
	int destVMperm[1] = {PERM_READ | PERM_WRITE};
	int destVMperm[1] = {PERM_READ | PERM_WRITE | PERM_EXEC};

	ret = hyp_assign_phys(addr, size, srcVM, 1, destVM, destVMperm, 1);
	if (ret)
@@ -228,6 +228,9 @@ int pil_reclaim_mem(struct pil_desc *desc, phys_addr_t addr, size_t size,
	int destVM[1] = {VMid};
	int destVMperm[1] = {PERM_READ | PERM_WRITE};

	if (VMid == VMID_HLOS)
		destVMperm[0] = PERM_READ | PERM_WRITE | PERM_EXEC;

	ret = hyp_assign_phys(addr, size, srcVM, 2, destVM, destVMperm, 1);
	if (ret)
		panic("%s: failed for %pa address of size %zx - subsys VMid %d. Fatal error.\n",