Home
last modified time | relevance | path

Searched refs:tctx (Results 1 – 25 of 38) sorted by relevance

12

/linux/io_uring/
H A Dtctx.c49 struct io_uring_task *tctx = tsk->io_uring; in __io_uring_free() local
59 xa_for_each(&tctx->xa, index, node) { in __io_uring_free()
63 WARN_ON_ONCE(tctx->io_wq); in __io_uring_free()
64 WARN_ON_ONCE(tctx->cached_refs); in __io_uring_free()
66 percpu_counter_destroy(&tctx->inflight); in __io_uring_free()
67 kfree(tctx); in __io_uring_free()
74 struct io_uring_task *tctx; in io_uring_alloc_task_context() local
77 tctx = kzalloc(sizeof(*tctx), GFP_KERNEL); in io_uring_alloc_task_context()
78 if (unlikely(!tctx)) in io_uring_alloc_task_context()
81 ret = percpu_counter_init(&tctx->inflight, 0, GFP_KERNEL); in io_uring_alloc_task_context()
[all …]
H A Dio_uring.c145 struct io_uring_task *tctx,
205 bool io_match_task_safe(struct io_kiocb *head, struct io_uring_task *tctx, in io_match_task_safe() argument
210 if (tctx && head->tctx != tctx) in io_match_task_safe()
414 atomic_dec(&req->tctx->inflight_tracked); in io_clean_op()
428 atomic_inc(&req->tctx->inflight_tracked); in io_req_track_inflight()
517 struct io_uring_task *tctx = req->tctx; in io_queue_iowq() local
519 BUG_ON(!tctx); in io_queue_iowq()
521 if ((current->flags & PF_KTHREAD) || !tctx->io_wq) { in io_queue_iowq()
536 if (WARN_ON_ONCE(!same_thread_group(tctx->task, current))) in io_queue_iowq()
540 io_wq_enqueue(tctx->io_wq, &req->work); in io_queue_iowq()
[all …]
H A Dtctx.h14 void io_uring_clean_tctx(struct io_uring_task *tctx);
27 struct io_uring_task *tctx = current->io_uring; in io_uring_add_tctx_node() local
29 if (likely(tctx && tctx->last == ctx)) in io_uring_add_tctx_node()
H A Dio_uring.h97 struct llist_node *tctx_task_work_run(struct io_uring_task *tctx, unsigned int max_entries, unsigne…
103 int io_ring_add_registered_file(struct io_uring_task *tctx, struct file *file,
117 void io_task_refs_refill(struct io_uring_task *tctx);
120 bool io_match_task_safe(struct io_kiocb *head, struct io_uring_task *tctx,
408 struct io_uring_task *tctx = current->io_uring; in io_get_task_refs() local
410 tctx->cached_refs -= nr; in io_get_task_refs()
411 if (unlikely(tctx->cached_refs < 0)) in io_get_task_refs()
412 io_task_refs_refill(tctx); in io_get_task_refs()
H A Dregister.c261 struct io_uring_task *tctx = NULL; in io_register_iowq_max_workers() local
285 tctx = sqd->thread->io_uring; in io_register_iowq_max_workers()
288 tctx = current->io_uring; in io_register_iowq_max_workers()
298 if (tctx && tctx->io_wq) { in io_register_iowq_max_workers()
299 ret = io_wq_max_workers(tctx->io_wq, new_count); in io_register_iowq_max_workers()
322 tctx = node->task->io_uring; in io_register_iowq_max_workers()
323 if (WARN_ON_ONCE(!tctx->io_wq)) in io_register_iowq_max_workers()
329 (void)io_wq_max_workers(tctx->io_wq, new_count); in io_register_iowq_max_workers()
850 struct io_uring_task *tctx = current->io_uring; in io_uring_register_get_file() local
852 if (unlikely(!tctx || fd >= IO_RINGFD_REG_MAX)) in io_uring_register_get_file()
[all …]
H A Dtimeout.c328 ret = io_try_cancel(req->tctx, &cd, 0); in io_req_task_link_timeout()
659 static bool io_match_task(struct io_kiocb *head, struct io_uring_task *tctx, in io_match_task() argument
665 if (tctx && head->tctx != tctx) in io_match_task()
678 __cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct io_uring_task *tctx, in io_kill_timeouts() argument
693 if (io_match_task(req, tctx, cancel_all)) in io_kill_timeouts()
H A Dsqpoll.c226 struct io_uring_task *tctx = current->io_uring; in io_sq_tw() local
235 *retry_list = tctx_task_work_run(tctx, max_entries, &count); in io_sq_tw()
244 struct io_uring_task *tctx = current->io_uring; in io_sq_tw_pending() local
246 return retry_list || !llist_empty(&tctx->task_list); in io_sq_tw_pending()
/linux/crypto/
H A Dhctr2.c83 static inline u8 *hctr2_hashed_tweaklen(const struct hctr2_tfm_ctx *tctx, in hctr2_hashed_tweaklen() argument
86 u8 *p = (u8 *)tctx + sizeof(*tctx); in hctr2_hashed_tweaklen()
89 p += crypto_shash_statesize(tctx->polyval); in hctr2_hashed_tweaklen()
93 static inline u8 *hctr2_hashed_tweak(const struct hctr2_tfm_ctx *tctx, in hctr2_hashed_tweak() argument
96 return (u8 *)rctx + tctx->hashed_tweak_offset; in hctr2_hashed_tweak()
109 static int hctr2_hash_tweaklen(struct hctr2_tfm_ctx *tctx, bool has_remainder) in hctr2_hash_tweaklen() argument
115 shash->tfm = tctx->polyval; in hctr2_hash_tweaklen()
126 return crypto_shash_export(shash, hctr2_hashed_tweaklen(tctx, has_remainder)); in hctr2_hash_tweaklen()
132 struct hctr2_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in hctr2_setkey() local
136 crypto_cipher_clear_flags(tctx->blockcipher, CRYPTO_TFM_REQ_MASK); in hctr2_setkey()
[all …]
H A Dessiv.c69 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_setkey() local
73 crypto_skcipher_clear_flags(tctx->u.skcipher, CRYPTO_TFM_REQ_MASK); in essiv_skcipher_setkey()
74 crypto_skcipher_set_flags(tctx->u.skcipher, in essiv_skcipher_setkey()
77 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen); in essiv_skcipher_setkey()
81 err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt); in essiv_skcipher_setkey()
85 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK); in essiv_skcipher_setkey()
86 crypto_cipher_set_flags(tctx->essiv_cipher, in essiv_skcipher_setkey()
89 return crypto_cipher_setkey(tctx->essiv_cipher, salt, in essiv_skcipher_setkey()
90 crypto_shash_digestsize(tctx->hash)); in essiv_skcipher_setkey()
96 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_setkey() local
[all …]
H A Dadiantum.c120 struct adiantum_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in adiantum_setkey() local
132 crypto_skcipher_clear_flags(tctx->streamcipher, CRYPTO_TFM_REQ_MASK); in adiantum_setkey()
133 crypto_skcipher_set_flags(tctx->streamcipher, in adiantum_setkey()
136 err = crypto_skcipher_setkey(tctx->streamcipher, key, keylen); in adiantum_setkey()
142 crypto_skcipher_reqsize(tctx->streamcipher), GFP_KERNEL); in adiantum_setkey()
148 skcipher_request_set_tfm(&data->req, tctx->streamcipher); in adiantum_setkey()
160 crypto_cipher_clear_flags(tctx->blockcipher, CRYPTO_TFM_REQ_MASK); in adiantum_setkey()
161 crypto_cipher_set_flags(tctx->blockcipher, in adiantum_setkey()
164 err = crypto_cipher_setkey(tctx->blockcipher, keyp, in adiantum_setkey()
171 poly1305_core_setkey(&tctx->header_hash_key, keyp); in adiantum_setkey()
[all …]
H A Dhmac.c37 struct hmac_ctx *tctx = crypto_shash_ctx(parent); in hmac_setkey() local
38 struct crypto_shash *hash = tctx->hash; in hmac_setkey()
39 u8 *ipad = &tctx->pads[0]; in hmac_setkey()
40 u8 *opad = &tctx->pads[ss]; in hmac_setkey()
86 const struct hmac_ctx *tctx = crypto_shash_ctx(pdesc->tfm); in hmac_import() local
88 desc->tfm = tctx->hash; in hmac_import()
95 const struct hmac_ctx *tctx = crypto_shash_ctx(pdesc->tfm); in hmac_init() local
97 return hmac_import(pdesc, &tctx->pads[0]); in hmac_init()
113 const struct hmac_ctx *tctx = crypto_shash_ctx(parent); in hmac_final() local
114 const u8 *opad = &tctx->pads[ss]; in hmac_final()
[all …]
H A Dxxhash_generic.c23 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(tfm); in xxhash64_setkey() local
25 if (keylen != sizeof(tctx->seed)) in xxhash64_setkey()
27 tctx->seed = get_unaligned_le64(key); in xxhash64_setkey()
33 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_init() local
36 xxh64_reset(&dctx->xxhstate, tctx->seed); in xxhash64_init()
63 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_digest() local
65 put_unaligned_le64(xxh64(data, length, tctx->seed), out); in xxhash64_digest()
H A Dxcbc.c87 struct xcbc_tfm_ctx *tctx = crypto_shash_ctx(parent); in crypto_xcbc_digest_update() local
89 struct crypto_cipher *tfm = tctx->child; in crypto_xcbc_digest_update()
132 struct xcbc_tfm_ctx *tctx = crypto_shash_ctx(parent); in crypto_xcbc_digest_final() local
134 struct crypto_cipher *tfm = tctx->child; in crypto_xcbc_digest_final()
155 crypto_xor(prev, &tctx->consts[offset], bs); in crypto_xcbc_digest_final()
H A Dcmac.c119 struct cmac_tfm_ctx *tctx = crypto_shash_ctx(parent); in crypto_cmac_digest_update() local
121 struct crypto_cipher *tfm = tctx->child; in crypto_cmac_digest_update()
164 struct cmac_tfm_ctx *tctx = crypto_shash_ctx(parent); in crypto_cmac_digest_final() local
166 struct crypto_cipher *tfm = tctx->child; in crypto_cmac_digest_final()
187 crypto_xor(prev, (const u8 *)tctx->consts + offset, bs); in crypto_cmac_digest_final()
/linux/tools/testing/selftests/lsm/
H A Dlsm_get_self_attr_test.c145 struct lsm_ctx *tctx = NULL; in TEST() local
191 tctx = ctx; in TEST()
193 ASSERT_EQ(0, strcmp((char *)tctx->ctx, attr)); in TEST()
195 tctx = next_ctx(tctx); in TEST()
196 ASSERT_NE(0, strcmp((char *)tctx->ctx, attr)); in TEST()
204 tctx = ctx; in TEST()
206 ASSERT_EQ(0, strcmp((char *)tctx->ctx, attr)); in TEST()
209 tctx = next_ctx(tctx); in TEST()
210 ASSERT_NE(0, strcmp((char *)tctx->ctx, attr)); in TEST()
218 tctx = ctx; in TEST()
[all …]
/linux/drivers/crypto/
H A Dgeode-aes.c70 geode_aes_crypt(const struct geode_aes_tfm_ctx *tctx, const void *src, in geode_aes_crypt() argument
97 _writefield(AES_WRITEKEY0_REG, tctx->key); in geode_aes_crypt()
113 struct geode_aes_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in geode_setkey_cip() local
115 tctx->keylen = len; in geode_setkey_cip()
118 memcpy(tctx->key, key, len); in geode_setkey_cip()
129 tctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in geode_setkey_cip()
130 tctx->fallback.cip->base.crt_flags |= in geode_setkey_cip()
133 return crypto_cipher_setkey(tctx->fallback.cip, key, len); in geode_setkey_cip()
139 struct geode_aes_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in geode_setkey_skcipher() local
141 tctx->keylen = len; in geode_setkey_skcipher()
[all …]
/linux/tools/testing/selftests/sched_ext/
H A Dselect_cpu_dfl_nodispatch.bpf.c37 struct task_ctx *tctx; in BPF_STRUCT_OPS() local
40 tctx = bpf_task_storage_get(&task_ctx_stor, p, 0, 0); in BPF_STRUCT_OPS()
41 if (!tctx) { in BPF_STRUCT_OPS()
47 &tctx->force_local); in BPF_STRUCT_OPS()
56 struct task_ctx *tctx; in BPF_STRUCT_OPS() local
58 tctx = bpf_task_storage_get(&task_ctx_stor, p, 0, 0); in BPF_STRUCT_OPS()
59 if (!tctx) { in BPF_STRUCT_OPS()
64 if (tctx->force_local) { in BPF_STRUCT_OPS()
66 tctx->force_local = false; in BPF_STRUCT_OPS()
/linux/arch/riscv/crypto/
H A Dghash-riscv64-glue.c36 struct riscv64_ghash_tfm_ctx *tctx = crypto_shash_ctx(tfm); in riscv64_ghash_setkey() local
41 memcpy(&tctx->key, key, GHASH_BLOCK_SIZE); in riscv64_ghash_setkey()
56 riscv64_ghash_blocks(const struct riscv64_ghash_tfm_ctx *tctx, in riscv64_ghash_blocks() argument
63 ghash_zvkg(&dctx->accumulator, &tctx->key, src, srclen); in riscv64_ghash_blocks()
69 gf128mul_lle(&dctx->accumulator, &tctx->key); in riscv64_ghash_blocks()
79 const struct riscv64_ghash_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in riscv64_ghash_update() local
91 riscv64_ghash_blocks(tctx, dctx, dctx->buffer, in riscv64_ghash_update()
100 riscv64_ghash_blocks(tctx, dctx, src, len); in riscv64_ghash_update()
115 const struct riscv64_ghash_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in riscv64_ghash_final() local
123 riscv64_ghash_blocks(tctx, dctx, dctx->buffer, in riscv64_ghash_final()
/linux/arch/arm64/crypto/
H A Dpolyval-ce-glue.c75 struct polyval_tfm_ctx *tctx = crypto_shash_ctx(tfm); in polyval_arm64_setkey() local
81 memcpy(tctx->key_powers[NUM_KEY_POWERS-1], key, POLYVAL_BLOCK_SIZE); in polyval_arm64_setkey()
84 memcpy(tctx->key_powers[i], key, POLYVAL_BLOCK_SIZE); in polyval_arm64_setkey()
85 internal_polyval_mul(tctx->key_powers[i], in polyval_arm64_setkey()
86 tctx->key_powers[i+1]); in polyval_arm64_setkey()
105 const struct polyval_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in polyval_arm64_update() local
122 tctx->key_powers[NUM_KEY_POWERS-1]); in polyval_arm64_update()
128 internal_polyval_update(tctx, src, nblocks, dctx->buffer); in polyval_arm64_update()
146 const struct polyval_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in polyval_arm64_final() local
150 tctx->key_powers[NUM_KEY_POWERS-1]); in polyval_arm64_final()
H A Dsm4-ce-glue.c602 struct sm4_mac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in sm4_mac_update() local
622 sm4_ce_crypt_block(tctx->key.rkey_enc, in sm4_mac_update()
629 sm4_ce_mac_update(tctx->key.rkey_enc, ctx->digest, p, in sm4_mac_update()
652 struct sm4_mac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in sm4_cmac_final() local
654 const u8 *consts = tctx->consts; in sm4_cmac_final()
662 sm4_ce_mac_update(tctx->key.rkey_enc, ctx->digest, consts, 1, in sm4_cmac_final()
673 struct sm4_mac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in sm4_cbcmac_final() local
678 sm4_ce_crypt_block(tctx->key.rkey_enc, ctx->digest, in sm4_cbcmac_final()
/linux/arch/x86/crypto/
H A Dpolyval-clmulni_glue.c84 struct polyval_tfm_ctx *tctx = polyval_tfm_ctx(tfm); in polyval_x86_setkey() local
90 memcpy(tctx->key_powers[NUM_KEY_POWERS-1], key, POLYVAL_BLOCK_SIZE); in polyval_x86_setkey()
93 memcpy(tctx->key_powers[i], key, POLYVAL_BLOCK_SIZE); in polyval_x86_setkey()
94 internal_polyval_mul(tctx->key_powers[i], in polyval_x86_setkey()
95 tctx->key_powers[i+1]); in polyval_x86_setkey()
114 const struct polyval_tfm_ctx *tctx = polyval_tfm_ctx(desc->tfm); in polyval_x86_update() local
131 tctx->key_powers[NUM_KEY_POWERS-1]); in polyval_x86_update()
137 internal_polyval_update(tctx, src, nblocks, dctx->buffer); in polyval_x86_update()
155 const struct polyval_tfm_ctx *tctx = polyval_tfm_ctx(desc->tfm); in polyval_x86_final() local
159 tctx->key_powers[NUM_KEY_POWERS-1]); in polyval_x86_final()
/linux/include/crypto/internal/
H A Dblake2b.h75 struct blake2b_tfm_ctx *tctx = crypto_shash_ctx(tfm); in crypto_blake2b_setkey() local
80 memcpy(tctx->key, key, keylen); in crypto_blake2b_setkey()
81 tctx->keylen = keylen; in crypto_blake2b_setkey()
88 const struct blake2b_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in crypto_blake2b_init() local
92 __blake2b_init(state, outlen, tctx->key, tctx->keylen); in crypto_blake2b_init()
/linux/drivers/crypto/aspeed/
H A Daspeed-hace-hash.c352 struct aspeed_sham_ctx *tctx = crypto_ahash_ctx(tfm); in aspeed_ahash_hmac_resume() local
353 struct aspeed_sha_hmac_ctx *bctx = tctx->base; in aspeed_ahash_hmac_resume()
538 struct aspeed_sham_ctx *tctx = crypto_ahash_ctx(tfm); in aspeed_ahash_do_request() local
539 struct aspeed_hace_dev *hace_dev = tctx->hace_dev; in aspeed_ahash_do_request()
562 struct aspeed_sham_ctx *tctx = crypto_ahash_ctx(tfm); in aspeed_ahash_prepare_request() local
563 struct aspeed_hace_dev *hace_dev = tctx->hace_dev; in aspeed_ahash_prepare_request()
585 struct aspeed_sham_ctx *tctx = crypto_ahash_ctx(tfm); in aspeed_sham_update() local
586 struct aspeed_hace_dev *hace_dev = tctx->hace_dev; in aspeed_sham_update()
626 struct aspeed_sham_ctx *tctx = crypto_ahash_ctx(tfm); in aspeed_sham_final() local
627 struct aspeed_hace_dev *hace_dev = tctx->hace_dev; in aspeed_sham_final()
[all …]
/linux/drivers/crypto/rockchip/
H A Drk3288_crypto_ahash.c346 struct rk_ahash_ctx *tctx = crypto_ahash_ctx(tfm); in rk_hash_init_tfm() local
352 tctx->fallback_tfm = crypto_alloc_ahash(alg_name, 0, in rk_hash_init_tfm()
354 if (IS_ERR(tctx->fallback_tfm)) { in rk_hash_init_tfm()
356 return PTR_ERR(tctx->fallback_tfm); in rk_hash_init_tfm()
361 crypto_ahash_reqsize(tctx->fallback_tfm)); in rk_hash_init_tfm()
368 struct rk_ahash_ctx *tctx = crypto_ahash_ctx(tfm); in rk_hash_exit_tfm() local
370 crypto_free_ahash(tctx->fallback_tfm); in rk_hash_exit_tfm()
/linux/drivers/crypto/intel/keembay/
H A Dkeembay-ocs-hcu-core.c167 struct ocs_hcu_ctx *tctx = crypto_ahash_ctx(tfm); in kmb_ocs_hcu_find_dev() local
170 if (tctx->hcu_dev) in kmb_ocs_hcu_find_dev()
171 return tctx->hcu_dev; in kmb_ocs_hcu_find_dev()
178 tctx->hcu_dev = list_first_entry_or_null(&ocs_hcu.dev_list, in kmb_ocs_hcu_find_dev()
183 return tctx->hcu_dev; in kmb_ocs_hcu_find_dev()
418 struct ocs_hcu_ctx *tctx = crypto_ahash_ctx(tfm); in kmb_ocs_hcu_do_one_request() local
438 rc = ocs_hcu_hmac(hcu_dev, rctx->algo, tctx->key, tctx->key_len, in kmb_ocs_hcu_do_one_request()
534 WARN_ON(tctx->key_len != rctx->blk_sz); in kmb_ocs_hcu_do_one_request()
536 rctx->buffer[i] = tctx->key[i] ^ HMAC_OPAD_VALUE; in kmb_ocs_hcu_do_one_request()

12