Loading drivers/soc/qcom/secure_buffer.c +2 −0 Original line number Diff line number Diff line Loading @@ -425,6 +425,8 @@ const char *msm_secure_vmid_to_string(int secure_vmid) return "VMID_CP_SPSS_HLOS_SHARED"; case VMID_INVAL: return "VMID_INVAL"; case VMID_NAV: return "VMID_NAV"; default: return "Unknown VMID"; } Loading drivers/uio/msm_sharedmem/msm_sharedmem.c +29 −8 Original line number Diff line number Diff line Loading @@ -66,21 +66,33 @@ static int sharedmem_mmap(struct uio_info *info, struct vm_area_struct *vma) } /* Setup the shared ram permissions. * This function currently supports the mpss client only. * This function currently supports the mpss and nav clients only. */ static void setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size) static void setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size, bool vm_nav_path) { int ret; u32 source_vmlist[1] = {VMID_HLOS}; int dest_vmids[2] = {VMID_HLOS, VMID_MSS_MSA}; int dest_perms[2] = {PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE}; if (client_id != MPSS_RMTS_CLIENT_ID) return; if (vm_nav_path) { int dest_vmids[3] = {VMID_HLOS, VMID_MSS_MSA, VMID_NAV}; int dest_perms[3] = {PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE}; ret = hyp_assign_phys(addr, size, source_vmlist, 1, dest_vmids, dest_perms, 3); } else { int dest_vmids[2] = {VMID_HLOS, VMID_MSS_MSA}; int dest_perms[2] = {PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE}; ret = hyp_assign_phys(addr, size, source_vmlist, 1, dest_vmids, dest_perms, 2); } if (ret != 0) { if (ret == -EINVAL) pr_warn("hyp_assign_phys is not supported!\n"); Loading @@ -102,6 +114,7 @@ static int msm_sharedmem_probe(struct platform_device *pdev) phys_addr_t shared_mem_pyhsical = 0; bool is_addr_dynamic = false; bool guard_memory = false; bool vm_nav_path = false; /* Get the addresses from platform-data */ if (!pdev->dev.of_node) { Loading Loading @@ -162,8 +175,16 @@ static int msm_sharedmem_probe(struct platform_device *pdev) shared_mem_pyhsical += SZ_4K; } /* * If this dtsi property is set, then the shared memory region * will be given access to vm-nav-path also. */ vm_nav_path = of_property_read_bool(pdev->dev.of_node, "qcom,vm-nav-path"); /* Set up the permissions for the shared ram that was allocated. */ setup_shared_ram_perms(client_id, shared_mem_pyhsical, shared_mem_size); setup_shared_ram_perms(client_id, shared_mem_pyhsical, shared_mem_size, vm_nav_path); /* Setup device */ info->mmap = sharedmem_mmap; /* Custom mmap function. */ Loading include/soc/qcom/secure_buffer.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ enum vmid { VMID_CP_SPSS_SP_SHARED = 0x22, VMID_CP_SPSS_HLOS_SHARED = 0x24, VMID_CP_CDSP = 0x2A, VMID_NAV = 0x2B, VMID_LAST, VMID_INVAL = -1 }; Loading Loading
drivers/soc/qcom/secure_buffer.c +2 −0 Original line number Diff line number Diff line Loading @@ -425,6 +425,8 @@ const char *msm_secure_vmid_to_string(int secure_vmid) return "VMID_CP_SPSS_HLOS_SHARED"; case VMID_INVAL: return "VMID_INVAL"; case VMID_NAV: return "VMID_NAV"; default: return "Unknown VMID"; } Loading
drivers/uio/msm_sharedmem/msm_sharedmem.c +29 −8 Original line number Diff line number Diff line Loading @@ -66,21 +66,33 @@ static int sharedmem_mmap(struct uio_info *info, struct vm_area_struct *vma) } /* Setup the shared ram permissions. * This function currently supports the mpss client only. * This function currently supports the mpss and nav clients only. */ static void setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size) static void setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size, bool vm_nav_path) { int ret; u32 source_vmlist[1] = {VMID_HLOS}; int dest_vmids[2] = {VMID_HLOS, VMID_MSS_MSA}; int dest_perms[2] = {PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE}; if (client_id != MPSS_RMTS_CLIENT_ID) return; if (vm_nav_path) { int dest_vmids[3] = {VMID_HLOS, VMID_MSS_MSA, VMID_NAV}; int dest_perms[3] = {PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE}; ret = hyp_assign_phys(addr, size, source_vmlist, 1, dest_vmids, dest_perms, 3); } else { int dest_vmids[2] = {VMID_HLOS, VMID_MSS_MSA}; int dest_perms[2] = {PERM_READ|PERM_WRITE, PERM_READ|PERM_WRITE}; ret = hyp_assign_phys(addr, size, source_vmlist, 1, dest_vmids, dest_perms, 2); } if (ret != 0) { if (ret == -EINVAL) pr_warn("hyp_assign_phys is not supported!\n"); Loading @@ -102,6 +114,7 @@ static int msm_sharedmem_probe(struct platform_device *pdev) phys_addr_t shared_mem_pyhsical = 0; bool is_addr_dynamic = false; bool guard_memory = false; bool vm_nav_path = false; /* Get the addresses from platform-data */ if (!pdev->dev.of_node) { Loading Loading @@ -162,8 +175,16 @@ static int msm_sharedmem_probe(struct platform_device *pdev) shared_mem_pyhsical += SZ_4K; } /* * If this dtsi property is set, then the shared memory region * will be given access to vm-nav-path also. */ vm_nav_path = of_property_read_bool(pdev->dev.of_node, "qcom,vm-nav-path"); /* Set up the permissions for the shared ram that was allocated. */ setup_shared_ram_perms(client_id, shared_mem_pyhsical, shared_mem_size); setup_shared_ram_perms(client_id, shared_mem_pyhsical, shared_mem_size, vm_nav_path); /* Setup device */ info->mmap = sharedmem_mmap; /* Custom mmap function. */ Loading
include/soc/qcom/secure_buffer.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ enum vmid { VMID_CP_SPSS_SP_SHARED = 0x22, VMID_CP_SPSS_HLOS_SHARED = 0x24, VMID_CP_CDSP = 0x2A, VMID_NAV = 0x2B, VMID_LAST, VMID_INVAL = -1 }; Loading