/linux/drivers/tee/ |
H A D | tee_shm.c | 21 struct tee_shm shm; member 42 static void release_registered_pages(struct tee_shm *shm) in release_registered_pages() argument 44 if (shm->pages) { in release_registered_pages() 45 if (shm->flags & TEE_SHM_USER_MAPPED) in release_registered_pages() 46 unpin_user_pages(shm->pages, shm->num_pages); in release_registered_pages() 48 shm_put_kernel_pages(shm->pages, shm->num_pages); in release_registered_pages() 50 kfree(shm->pages); in release_registered_pages() 54 static void tee_shm_release(struct tee_device *teedev, struct tee_shm *shm) in tee_shm_release() argument 56 void *p = shm; in tee_shm_release() 58 if (shm->flags & TEE_SHM_DMA_MEM) { in tee_shm_release() [all …]
|
H A D | tee_shm_pool.c | 12 static int pool_op_gen_alloc(struct tee_shm_pool *pool, struct tee_shm *shm, in pool_op_gen_alloc() argument 26 shm->kaddr = (void *)va; in pool_op_gen_alloc() 27 shm->paddr = gen_pool_virt_to_phys(genpool, va); in pool_op_gen_alloc() 28 shm->size = s; in pool_op_gen_alloc() 33 shm->flags &= ~TEE_SHM_DYNAMIC; in pool_op_gen_alloc() 37 static void pool_op_gen_free(struct tee_shm_pool *pool, struct tee_shm *shm) in pool_op_gen_free() argument 39 gen_pool_free(pool->private_data, (unsigned long)shm->kaddr, in pool_op_gen_free() 40 shm->size); in pool_op_gen_free() 41 shm->kaddr = NULL; in pool_op_gen_free()
|
/linux/drivers/tee/amdtee/ |
H A D | shm_pool.c | 11 static int pool_op_alloc(struct tee_shm_pool *pool, struct tee_shm *shm, in pool_op_alloc() argument 26 shm->kaddr = (void *)va; in pool_op_alloc() 27 shm->paddr = __psp_pa((void *)va); in pool_op_alloc() 28 shm->size = PAGE_SIZE << order; in pool_op_alloc() 31 rc = amdtee_map_shmem(shm); in pool_op_alloc() 34 shm->kaddr = NULL; in pool_op_alloc() 41 static void pool_op_free(struct tee_shm_pool *pool, struct tee_shm *shm) in pool_op_free() argument 44 amdtee_unmap_shmem(shm); in pool_op_free() 45 free_pages((unsigned long)shm->kaddr, get_order(shm->size)); in pool_op_free() 46 shm->kaddr = NULL; in pool_op_free()
|
H A D | core.c | 155 u32 get_buffer_id(struct tee_shm *shm) in get_buffer_id() argument 157 struct amdtee_context_data *ctxdata = shm->ctx->data; in get_buffer_id() 163 if (shmdata->kaddr == shm->kaddr) { in get_buffer_id() 343 int amdtee_map_shmem(struct tee_shm *shm) in amdtee_map_shmem() argument 351 if (!shm) in amdtee_map_shmem() 359 shmem.kaddr = shm->kaddr; in amdtee_map_shmem() 360 shmem.size = shm->size; in amdtee_map_shmem() 373 shmnode->kaddr = shm->kaddr; in amdtee_map_shmem() 375 ctxdata = shm->ctx->data; in amdtee_map_shmem() 385 void amdtee_unmap_shmem(struct tee_shm *shm) in amdtee_unmap_shmem() argument [all …]
|
H A D | amdtee_private.h | 148 int amdtee_map_shmem(struct tee_shm *shm); 150 void amdtee_unmap_shmem(struct tee_shm *shm); 171 u32 get_buffer_id(struct tee_shm *shm);
|
/linux/drivers/tee/optee/ |
H A D | ffa_abi.c | 42 struct tee_shm *shm; member 62 struct tee_shm *shm = NULL; in optee_shm_from_ffa_handle() local 69 shm = r->shm; in optee_shm_from_ffa_handle() 72 return shm; in optee_shm_from_ffa_handle() 75 static int optee_shm_add_ffa_handle(struct optee *optee, struct tee_shm *shm, in optee_shm_add_ffa_handle() argument 84 r->shm = shm; in optee_shm_add_ffa_handle() 127 struct tee_shm *shm = NULL; in from_msg_param_ffa_mem() local 136 shm = optee_shm_from_ffa_handle(optee, mp->u.fmem.global_id); in from_msg_param_ffa_mem() 137 p->u.memref.shm = shm; in from_msg_param_ffa_mem() 139 if (shm) { in from_msg_param_ffa_mem() [all …]
|
H A D | call.c | 38 struct tee_shm *shm; member 238 tee_shm_free(entry->shm); in optee_shm_arg_cache_uninit() 311 entry->shm = res; in optee_get_msg_arg() 317 res = tee_shm_get_va(entry->shm, offs); in optee_get_msg_arg() 325 *shm_ret = entry->shm; in optee_get_msg_arg() 369 struct tee_shm *shm; in optee_open_session() local 378 &entry, &shm, &offs); in optee_open_session() 413 if (optee->ops->do_call_with_arg(ctx, shm, offs, in optee_open_session() 473 struct tee_shm *shm; in optee_close_session_helper() local 476 msg_arg = optee_get_msg_arg(ctx, 0, &entry, &shm, &offs); in optee_close_session_helper() [all …]
|
H A D | rpc.c | 89 msg.buf = params[2].u.memref.shm->kaddr; in handle_rpc_func_cmd_i2c_transfer() 222 struct tee_shm *shm; in optee_rpc_cmd_alloc_suppl() local 235 shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c); in optee_rpc_cmd_alloc_suppl() 237 return shm; in optee_rpc_cmd_alloc_suppl() 240 void optee_rpc_cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm) in optee_rpc_cmd_free_suppl() argument 246 param.u.value.b = tee_shm_get_id(shm); in optee_rpc_cmd_free_suppl() 260 tee_shm_put(shm); in optee_rpc_cmd_free_suppl() 333 buf = tee_shm_get_va(params[1].u.memref.shm, in handle_rpc_func_rpmb_probe_next() 394 p0 = tee_shm_get_va(params[0].u.memref.shm, in handle_rpc_func_rpmb_frames() 396 p1 = tee_shm_get_va(params[1].u.memref.shm, in handle_rpc_func_rpmb_frames()
|
/linux/drivers/tee/tstee/ |
H A D | core.c | 167 struct tee_shm *shm = NULL; in tstee_invoke_func() local 194 shm = tee_shm_get_from_id(ctx, shm_id); in tstee_invoke_func() 195 if (IS_ERR(shm)) in tstee_invoke_func() 196 return PTR_ERR(shm); in tstee_invoke_func() 198 if (shm->size < req_len) { in tstee_invoke_func() 205 handle = shm->sec_world_id; in tstee_invoke_func() 232 if (shm && shm->size >= ffa_args[TS_RPC_SERVICE_RESP_LEN]) in tstee_invoke_func() 236 if (shm) in tstee_invoke_func() 237 tee_shm_put(shm); in tstee_invoke_func() 242 static int tstee_shm_register(struct tee_context *ctx, struct tee_shm *shm, in tstee_shm_register() argument [all …]
|
/linux/drivers/media/platform/samsung/s5p-mfc/ |
H A D | s5p_mfc_opr_v5.c | 224 ctx->shm.size = buf_size->shm; in s5p_mfc_alloc_instance_buffer_v5() 225 ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->shm); in s5p_mfc_alloc_instance_buffer_v5() 233 ctx->shm.ofs = ctx->shm.dma - dev->dma_base[BANK_L_CTX]; in s5p_mfc_alloc_instance_buffer_v5() 234 BUG_ON(ctx->shm.ofs & ((1 << MFC_BANK1_ALIGN_ORDER) - 1)); in s5p_mfc_alloc_instance_buffer_v5() 236 memset(ctx->shm.virt, 0, buf_size->shm); in s5p_mfc_alloc_instance_buffer_v5() 245 s5p_mfc_release_priv_buf(ctx->dev, &ctx->shm); in s5p_mfc_release_instance_buffer_v5() 263 *(u32 *)(ctx->shm.virt + ofs) = data; in s5p_mfc_write_info_v5() 271 return *(u32 *)(ctx->shm.virt + ofs); in s5p_mfc_read_info_v5() 358 mfc_write(dev, ctx->shm.ofs, S5P_FIMV_SI_CH0_HOST_WR_ADR); in s5p_mfc_set_shared_buffer() 681 unsigned int shm; in s5p_mfc_set_enc_params() local [all …]
|
/linux/include/linux/ |
H A D | tee_core.h | 120 int (*shm_register)(struct tee_context *ctx, struct tee_shm *shm, 123 int (*shm_unregister)(struct tee_context *ctx, struct tee_shm *shm); 156 * @update_shm: called when registering a dma-buf to update the @shm 166 size_t offs, struct tee_shm *shm, 277 int (*alloc)(struct tee_shm_pool *pool, struct tee_shm *shm, 279 void (*free)(struct tee_shm_pool *pool, struct tee_shm *shm); in tee_shm_get_id() 284 * tee_shm_pool_alloc_res_mem() - Create a shm manager for reserved memory 335 int tee_dyn_shm_alloc_helper(struct tee_shm *shm, size_t size, size_t align, 337 struct tee_shm *shm, 341 void tee_dyn_shm_free_helper(struct tee_shm *shm, 262 tee_shm_is_dynamic(struct tee_shm * shm) tee_shm_is_dynamic() argument 278 tee_shm_get_id(struct tee_shm * shm) tee_shm_get_id() argument [all...] |
H A D | tee_drv.h | 82 struct tee_shm *shm; member 143 * @shm: Handle to shared memory to free 145 void tee_shm_free(struct tee_shm *shm); 149 * @shm: Shared memory handle in tee_shm_get_size() argument 154 void *tee_shm_get_va(struct tee_shm *shm, size_t offs); 158 * @shm: Shared memory handle 164 int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa); in tee_shm_get_pages() 168 * @shm: Shared memory handle 171 static inline size_t tee_shm_get_size(struct tee_shm *shm) 173 return shm in tee_shm_get_page_offset() 160 tee_shm_get_pages(struct tee_shm * shm,size_t * num_pages) tee_shm_get_pages() argument 172 tee_shm_get_page_offset(struct tee_shm * shm) tee_shm_get_page_offset() argument [all...] |
/linux/drivers/nvmem/ |
H A D | stm32-bsec-optee-ta.c | 142 struct tee_shm *shm; in stm32_bsec_optee_ta_read() local 168 shm = tee_shm_alloc_kernel_buf(ctx, num_bytes); in stm32_bsec_optee_ta_read() 169 if (IS_ERR(shm)) { in stm32_bsec_optee_ta_read() 170 ret = PTR_ERR(shm); in stm32_bsec_optee_ta_read() 175 param[1].u.memref.shm = shm; in stm32_bsec_optee_ta_read() 186 shm_buf = tee_shm_get_va(shm, 0); in stm32_bsec_optee_ta_read() 196 tee_shm_free(shm); in stm32_bsec_optee_ta_read() 207 { struct tee_shm *shm; in stm32_bsec_optee_ta_write() local 233 shm = tee_shm_alloc_kernel_buf(ctx, bytes); in stm32_bsec_optee_ta_write() 234 if (IS_ERR(shm)) { in stm32_bsec_optee_ta_write() [all …]
|
/linux/drivers/rtc/ |
H A D | rtc-optee.c | 136 * @shm: Memory pool shared with RTC device. 146 struct tee_shm *shm; member 166 param[0].u.memref.shm = priv->shm; in optee_rtc_readtime() 173 optee_tm = tee_shm_get_va(priv->shm, 0); in optee_rtc_readtime() 205 param[0].u.memref.shm = priv->shm; in optee_rtc_settime() 208 optee_tm = tee_shm_get_va(priv->shm, 0); in optee_rtc_settime() 293 param[0].u.memref.shm = priv->shm; in optee_rtc_read_alarm() 300 optee_alarm = tee_shm_get_va(priv->shm, 0); in optee_rtc_read_alarm() 339 param[0].u.memref.shm = priv->shm; in optee_rtc_set_alarm() 342 optee_alarm = tee_shm_get_va(priv->shm, 0); in optee_rtc_set_alarm() [all …]
|
/linux/tools/testing/selftests/futex/functional/ |
H A D | futex_wait.c | 9 #include <sys/shm.h> 106 void *shm; in TEST() local 116 shm = mmap(NULL, sizeof(f_private), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in TEST() 117 if (shm == MAP_FAILED) in TEST() 120 memcpy(shm, &f_private, sizeof(f_private)); in TEST() 122 futex = shm; in TEST() 131 res = futex_wake(shm, 1, 0); in TEST() 139 munmap(shm, sizeof(f_private)); in TEST()
|
/linux/sound/usb/usx2y/ |
H A D | usx2yhwdeppcm.c | 107 struct snd_usx2y_hwdep_pcm_shm *shm = usx2y->hwdep_pcm_shm; in usx2y_hwdep_urb_play_prepare() local 110 if (shm->playback_iso_start < 0) { in usx2y_hwdep_urb_play_prepare() 111 shm->playback_iso_start = shm->captured_iso_head - in usx2y_hwdep_urb_play_prepare() 113 if (shm->playback_iso_start < 0) in usx2y_hwdep_urb_play_prepare() 114 shm->playback_iso_start += ARRAY_SIZE(shm->captured_iso); in usx2y_hwdep_urb_play_prepare() 115 shm->playback_iso_head = shm->playback_iso_start; in usx2y_hwdep_urb_play_prepare() 121 counts = shm in usx2y_hwdep_urb_play_prepare() 144 struct snd_usx2y_hwdep_pcm_shm *shm; usx2y_usbpcm_urb_capt_iso_advance() local [all...] |
H A D | usX2Yhwdep.c | 67 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; in snd_us428ctls_poll() local 74 if (shm && shm->ctl_snapshot_last != shm->ctl_snapshot_red) in snd_us428ctls_poll()
|
/linux/drivers/char/tpm/ |
H A D | tpm_ftpm_tee.c | 55 struct tee_shm *shm = pvt_data->shm; in ftpm_tee_tpm_op_send() local 78 .shm = shm, in ftpm_tee_tpm_op_send() 84 temp_buf = tee_shm_get_va(shm, 0); in ftpm_tee_tpm_op_send() 96 .shm = shm, in ftpm_tee_tpm_op_send() 110 temp_buf = tee_shm_get_va(shm, command_params[1].u.memref.shm_offs); in ftpm_tee_tpm_op_send() 212 pvt_data->shm = tee_shm_alloc_kernel_buf(pvt_data->ctx, in ftpm_tee_probe() 215 if (IS_ERR(pvt_data->shm)) { in ftpm_tee_probe() 245 tee_shm_free(pvt_data->shm); in ftpm_tee_probe() 279 tee_shm_free(pvt_data->shm); in ftpm_tee_remove() 307 tee_shm_free(pvt_data->shm); in ftpm_plat_tee_shutdown()
|
H A D | tpm_ftpm_tee.h | 26 * @shm: Memory pool shared with fTPM TA in TEE. 32 struct tee_shm *shm; member
|
/linux/Documentation/devicetree/bindings/spi/ |
H A D | nuvoton,wpcm450-fiu.yaml | 35 nuvoton,shm: 37 description: a phandle to the SHM block (see ../arm/nuvoton,shm.yaml) 55 nuvoton,shm = <&shm>;
|
/linux/security/keys/trusted-keys/ |
H A D | trusted_tee.c | 76 dev_err(pvt_data.dev, "shm register failed\n"); in trusted_tee_seal() 85 param[0].u.memref.shm = reg_shm; in trusted_tee_seal() 89 param[1].u.memref.shm = reg_shm; in trusted_tee_seal() 123 dev_err(pvt_data.dev, "shm register failed\n"); in trusted_tee_unseal() 132 param[0].u.memref.shm = reg_shm; in trusted_tee_unseal() 136 param[1].u.memref.shm = reg_shm; in trusted_tee_unseal() 169 dev_err(pvt_data.dev, "key shm register failed\n"); in trusted_tee_get_random() 178 param[0].u.memref.shm = reg_shm; in trusted_tee_get_random()
|
/linux/ipc/ |
H A D | shm.c | 3 * linux/ipc/shm.c 7 * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli. 9 * /proc/sysvipc/shm support (c) 1999 Dragos Acostachioaie <dragos@iname.com> 11 * SMP thread shm, Jean-Luc Boyard <jean-luc.boyard@siemens.fr> 31 #include <linux/shm.h> 32 #include <uapi/linux/shm.h> 68 * The task created the shm object, for 160 ipc_init_proc_interface("sysvipc/shm", in shm_init() 303 /* This is called by fork, once for every shm attach. */ 349 * shm_may_destroy - identifies whether shm segment should be destroyed now [all …]
|
/linux/include/uapi/linux/ |
H A D | shm.h | 24 #define SHMALL (ULONG_MAX - (1UL << 24)) /* max shm system wide (pages) */ 103 __kernel_ulong_t shm_tot; /* total allocated shm */ 104 __kernel_ulong_t shm_rss; /* total resident shm */ 105 __kernel_ulong_t shm_swp; /* total swapped shm */
|
/linux/tools/testing/selftests/proc/ |
H A D | setns-sysvipc.c | 33 #include <sys/shm.h> 101 (void)open("/proc/sysvipc/shm", O_RDONLY); in main() 115 fd = open("/proc/sysvipc/shm", O_RDONLY); in main()
|
/linux/tools/testing/selftests/mm/ |
H A D | rmap.c | 35 SHM, enumerator 213 case SHM: in FIXTURE_TEARDOWN() 328 TEST_F(migrate, shm) in TEST_F() argument 333 snprintf(data->filename, MAX_FILENAME_LEN, "%s%s", PREFIX, suffixes[SHM]); in TEST_F() 337 data->backend = SHM; in TEST_F()
|