vcrypto 21 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto; vcrypto 121 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = ctx->vcrypto; vcrypto 135 drivers/crypto/virtio/virtio_crypto_algs.c spin_lock(&vcrypto->ctrl_lock); vcrypto 137 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.header.opcode = vcrypto 139 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.header.algo = cpu_to_le32(alg); vcrypto 141 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.header.queue_id = 0; vcrypto 143 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->input.status = cpu_to_le32(VIRTIO_CRYPTO_ERR); vcrypto 145 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.u.sym_create_session.op_type = vcrypto 147 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.u.sym_create_session.u.cipher.para.algo = vcrypto 148 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.header.algo; vcrypto 149 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.u.sym_create_session.u.cipher.para.keylen = vcrypto 151 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.u.sym_create_session.u.cipher.para.op = vcrypto 154 drivers/crypto/virtio/virtio_crypto_algs.c sg_init_one(&outhdr, &vcrypto->ctrl, sizeof(vcrypto->ctrl)); vcrypto 162 drivers/crypto/virtio/virtio_crypto_algs.c sg_init_one(&inhdr, &vcrypto->input, sizeof(vcrypto->input)); vcrypto 165 drivers/crypto/virtio/virtio_crypto_algs.c err = virtqueue_add_sgs(vcrypto->ctrl_vq, sgs, num_out, vcrypto 166 drivers/crypto/virtio/virtio_crypto_algs.c num_in, vcrypto, GFP_ATOMIC); vcrypto 168 drivers/crypto/virtio/virtio_crypto_algs.c spin_unlock(&vcrypto->ctrl_lock); vcrypto 172 drivers/crypto/virtio/virtio_crypto_algs.c virtqueue_kick(vcrypto->ctrl_vq); vcrypto 178 drivers/crypto/virtio/virtio_crypto_algs.c while (!virtqueue_get_buf(vcrypto->ctrl_vq, &tmp) && vcrypto 179 drivers/crypto/virtio/virtio_crypto_algs.c !virtqueue_is_broken(vcrypto->ctrl_vq)) vcrypto 182 drivers/crypto/virtio/virtio_crypto_algs.c if (le32_to_cpu(vcrypto->input.status) != VIRTIO_CRYPTO_OK) { vcrypto 183 drivers/crypto/virtio/virtio_crypto_algs.c spin_unlock(&vcrypto->ctrl_lock); vcrypto 185 drivers/crypto/virtio/virtio_crypto_algs.c le32_to_cpu(vcrypto->input.status)); vcrypto 192 drivers/crypto/virtio/virtio_crypto_algs.c le64_to_cpu(vcrypto->input.session_id); vcrypto 195 drivers/crypto/virtio/virtio_crypto_algs.c le64_to_cpu(vcrypto->input.session_id); vcrypto 197 drivers/crypto/virtio/virtio_crypto_algs.c spin_unlock(&vcrypto->ctrl_lock); vcrypto 210 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = ctx->vcrypto; vcrypto 214 drivers/crypto/virtio/virtio_crypto_algs.c spin_lock(&vcrypto->ctrl_lock); vcrypto 215 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl_status.status = VIRTIO_CRYPTO_ERR; vcrypto 217 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.header.opcode = vcrypto 220 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl.header.queue_id = 0; vcrypto 222 drivers/crypto/virtio/virtio_crypto_algs.c destroy_session = &vcrypto->ctrl.u.destroy_session; vcrypto 231 drivers/crypto/virtio/virtio_crypto_algs.c sg_init_one(&outhdr, &vcrypto->ctrl, sizeof(vcrypto->ctrl)); vcrypto 235 drivers/crypto/virtio/virtio_crypto_algs.c sg_init_one(&status_sg, &vcrypto->ctrl_status.status, vcrypto 236 drivers/crypto/virtio/virtio_crypto_algs.c sizeof(vcrypto->ctrl_status.status)); vcrypto 239 drivers/crypto/virtio/virtio_crypto_algs.c err = virtqueue_add_sgs(vcrypto->ctrl_vq, sgs, num_out, vcrypto 240 drivers/crypto/virtio/virtio_crypto_algs.c num_in, vcrypto, GFP_ATOMIC); vcrypto 242 drivers/crypto/virtio/virtio_crypto_algs.c spin_unlock(&vcrypto->ctrl_lock); vcrypto 245 drivers/crypto/virtio/virtio_crypto_algs.c virtqueue_kick(vcrypto->ctrl_vq); vcrypto 247 drivers/crypto/virtio/virtio_crypto_algs.c while (!virtqueue_get_buf(vcrypto->ctrl_vq, &tmp) && vcrypto 248 drivers/crypto/virtio/virtio_crypto_algs.c !virtqueue_is_broken(vcrypto->ctrl_vq)) vcrypto 251 drivers/crypto/virtio/virtio_crypto_algs.c if (vcrypto->ctrl_status.status != VIRTIO_CRYPTO_OK) { vcrypto 252 drivers/crypto/virtio/virtio_crypto_algs.c spin_unlock(&vcrypto->ctrl_lock); vcrypto 254 drivers/crypto/virtio/virtio_crypto_algs.c vcrypto->ctrl_status.status, vcrypto 259 drivers/crypto/virtio/virtio_crypto_algs.c spin_unlock(&vcrypto->ctrl_lock); vcrypto 270 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = ctx->vcrypto; vcrypto 272 drivers/crypto/virtio/virtio_crypto_algs.c if (keylen > vcrypto->max_cipher_key_len) { vcrypto 312 drivers/crypto/virtio/virtio_crypto_algs.c if (!ctx->vcrypto) { vcrypto 315 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = vcrypto 318 drivers/crypto/virtio/virtio_crypto_algs.c if (!vcrypto) { vcrypto 323 drivers/crypto/virtio/virtio_crypto_algs.c ctx->vcrypto = vcrypto; vcrypto 332 drivers/crypto/virtio/virtio_crypto_algs.c virtcrypto_dev_put(ctx->vcrypto); vcrypto 333 drivers/crypto/virtio/virtio_crypto_algs.c ctx->vcrypto = NULL; vcrypto 350 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = ctx->vcrypto; vcrypto 376 drivers/crypto/virtio/virtio_crypto_algs.c dev_to_node(&vcrypto->vdev->dev)); vcrypto 381 drivers/crypto/virtio/virtio_crypto_algs.c dev_to_node(&vcrypto->vdev->dev)); vcrypto 418 drivers/crypto/virtio/virtio_crypto_algs.c sizeof(vc_req->status) > vcrypto->max_size)) { vcrypto 438 drivers/crypto/virtio/virtio_crypto_algs.c dev_to_node(&vcrypto->vdev->dev)); vcrypto 492 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = ctx->vcrypto; vcrypto 494 drivers/crypto/virtio/virtio_crypto_algs.c struct data_queue *data_vq = &vcrypto->data_vq[0]; vcrypto 517 drivers/crypto/virtio/virtio_crypto_algs.c struct virtio_crypto *vcrypto = ctx->vcrypto; vcrypto 519 drivers/crypto/virtio/virtio_crypto_algs.c struct data_queue *data_vq = &vcrypto->data_vq[0]; vcrypto 552 drivers/crypto/virtio/virtio_crypto_algs.c if (!ctx->vcrypto) vcrypto 557 drivers/crypto/virtio/virtio_crypto_algs.c virtcrypto_dev_put(ctx->vcrypto); vcrypto 558 drivers/crypto/virtio/virtio_crypto_algs.c ctx->vcrypto = NULL; vcrypto 624 drivers/crypto/virtio/virtio_crypto_algs.c int virtio_crypto_algs_register(struct virtio_crypto *vcrypto) vcrypto 636 drivers/crypto/virtio/virtio_crypto_algs.c if (!virtcrypto_algo_is_supported(vcrypto, service, algonum)) vcrypto 646 drivers/crypto/virtio/virtio_crypto_algs.c dev_info(&vcrypto->vdev->dev, "Registered algo %s\n", vcrypto 655 drivers/crypto/virtio/virtio_crypto_algs.c void virtio_crypto_algs_unregister(struct virtio_crypto *vcrypto) vcrypto 667 drivers/crypto/virtio/virtio_crypto_algs.c !virtcrypto_algo_is_supported(vcrypto, service, algonum)) vcrypto 113 drivers/crypto/virtio/virtio_crypto_common.h int virtcrypto_dev_start(struct virtio_crypto *vcrypto); vcrypto 114 drivers/crypto/virtio/virtio_crypto_common.h void virtcrypto_dev_stop(struct virtio_crypto *vcrypto); vcrypto 132 drivers/crypto/virtio/virtio_crypto_common.h int virtio_crypto_algs_register(struct virtio_crypto *vcrypto); vcrypto 133 drivers/crypto/virtio/virtio_crypto_common.h void virtio_crypto_algs_unregister(struct virtio_crypto *vcrypto); vcrypto 27 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto = vq->vdev->priv; vcrypto 33 drivers/crypto/virtio/virtio_crypto_core.c spin_lock_irqsave(&vcrypto->data_vq[qid].lock, flags); vcrypto 38 drivers/crypto/virtio/virtio_crypto_core.c &vcrypto->data_vq[qid].lock, flags); vcrypto 42 drivers/crypto/virtio/virtio_crypto_core.c &vcrypto->data_vq[qid].lock, flags); vcrypto 45 drivers/crypto/virtio/virtio_crypto_core.c spin_unlock_irqrestore(&vcrypto->data_vq[qid].lock, flags); vcrypto 143 drivers/crypto/virtio/virtio_crypto_core.c static void virtcrypto_set_affinity(struct virtio_crypto *vcrypto) vcrypto 151 drivers/crypto/virtio/virtio_crypto_core.c if (vcrypto->curr_queue == 1 || vcrypto->max_data_queues == 1) { vcrypto 152 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_clean_affinity(vcrypto, -1); vcrypto 164 drivers/crypto/virtio/virtio_crypto_core.c virtqueue_set_affinity(vcrypto->data_vq[i].vq, cpumask_of(cpu)); vcrypto 165 drivers/crypto/virtio/virtio_crypto_core.c if (++i >= vcrypto->max_data_queues) vcrypto 169 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->affinity_hint_set = true; vcrypto 202 drivers/crypto/virtio/virtio_crypto_core.c static int virtcrypto_update_status(struct virtio_crypto *vcrypto) vcrypto 207 drivers/crypto/virtio/virtio_crypto_core.c virtio_cread(vcrypto->vdev, vcrypto 215 drivers/crypto/virtio/virtio_crypto_core.c dev_warn(&vcrypto->vdev->dev, vcrypto 218 drivers/crypto/virtio/virtio_crypto_core.c virtio_break_device(vcrypto->vdev); vcrypto 222 drivers/crypto/virtio/virtio_crypto_core.c if (vcrypto->status == status) vcrypto 225 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->status = status; vcrypto 227 drivers/crypto/virtio/virtio_crypto_core.c if (vcrypto->status & VIRTIO_CRYPTO_S_HW_READY) { vcrypto 228 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_dev_start(vcrypto); vcrypto 230 drivers/crypto/virtio/virtio_crypto_core.c dev_err(&vcrypto->vdev->dev, vcrypto 235 drivers/crypto/virtio/virtio_crypto_core.c dev_info(&vcrypto->vdev->dev, "Accelerator device is ready\n"); vcrypto 237 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_dev_stop(vcrypto); vcrypto 238 drivers/crypto/virtio/virtio_crypto_core.c dev_info(&vcrypto->vdev->dev, "Accelerator is not ready\n"); vcrypto 244 drivers/crypto/virtio/virtio_crypto_core.c static int virtcrypto_start_crypto_engines(struct virtio_crypto *vcrypto) vcrypto 249 drivers/crypto/virtio/virtio_crypto_core.c for (i = 0; i < vcrypto->max_data_queues; i++) { vcrypto 250 drivers/crypto/virtio/virtio_crypto_core.c if (vcrypto->data_vq[i].engine) { vcrypto 251 drivers/crypto/virtio/virtio_crypto_core.c ret = crypto_engine_start(vcrypto->data_vq[i].engine); vcrypto 261 drivers/crypto/virtio/virtio_crypto_core.c if (vcrypto->data_vq[i].engine) vcrypto 262 drivers/crypto/virtio/virtio_crypto_core.c crypto_engine_exit(vcrypto->data_vq[i].engine); vcrypto 267 drivers/crypto/virtio/virtio_crypto_core.c static void virtcrypto_clear_crypto_engines(struct virtio_crypto *vcrypto) vcrypto 271 drivers/crypto/virtio/virtio_crypto_core.c for (i = 0; i < vcrypto->max_data_queues; i++) vcrypto 272 drivers/crypto/virtio/virtio_crypto_core.c if (vcrypto->data_vq[i].engine) vcrypto 273 drivers/crypto/virtio/virtio_crypto_core.c crypto_engine_exit(vcrypto->data_vq[i].engine); vcrypto 276 drivers/crypto/virtio/virtio_crypto_core.c static void virtcrypto_del_vqs(struct virtio_crypto *vcrypto) vcrypto 278 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_device *vdev = vcrypto->vdev; vcrypto 280 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_clean_affinity(vcrypto, -1); vcrypto 284 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_free_queues(vcrypto); vcrypto 290 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto; vcrypto 321 drivers/crypto/virtio/virtio_crypto_core.c vcrypto = kzalloc_node(sizeof(*vcrypto), GFP_KERNEL, vcrypto 323 drivers/crypto/virtio/virtio_crypto_core.c if (!vcrypto) vcrypto 353 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_devmgr_add_dev(vcrypto); vcrypto 358 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->owner = THIS_MODULE; vcrypto 359 drivers/crypto/virtio/virtio_crypto_core.c vcrypto = vdev->priv = vcrypto; vcrypto 360 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->vdev = vdev; vcrypto 362 drivers/crypto/virtio/virtio_crypto_core.c spin_lock_init(&vcrypto->ctrl_lock); vcrypto 365 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->curr_queue = 1; vcrypto 366 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_data_queues = max_data_queues; vcrypto 367 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_cipher_key_len = max_cipher_key_len; vcrypto 368 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_auth_key_len = max_auth_key_len; vcrypto 369 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_size = max_size; vcrypto 370 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->crypto_services = crypto_services; vcrypto 371 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->cipher_algo_l = cipher_algo_l; vcrypto 372 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->cipher_algo_h = cipher_algo_h; vcrypto 373 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->mac_algo_l = mac_algo_l; vcrypto 374 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->mac_algo_h = mac_algo_h; vcrypto 375 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->hash_algo = hash_algo; vcrypto 376 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->aead_algo = aead_algo; vcrypto 381 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_data_queues, vcrypto 382 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_cipher_key_len, vcrypto 383 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_auth_key_len, vcrypto 384 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->max_size); vcrypto 386 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_init_vqs(vcrypto); vcrypto 392 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_start_crypto_engines(vcrypto); vcrypto 398 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_update_status(vcrypto); vcrypto 405 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_clear_crypto_engines(vcrypto); vcrypto 407 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->vdev->config->reset(vdev); vcrypto 408 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_del_vqs(vcrypto); vcrypto 410 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_devmgr_rm_dev(vcrypto); vcrypto 412 drivers/crypto/virtio/virtio_crypto_core.c kfree(vcrypto); vcrypto 416 drivers/crypto/virtio/virtio_crypto_core.c static void virtcrypto_free_unused_reqs(struct virtio_crypto *vcrypto) vcrypto 422 drivers/crypto/virtio/virtio_crypto_core.c for (i = 0; i < vcrypto->max_data_queues; i++) { vcrypto 423 drivers/crypto/virtio/virtio_crypto_core.c vq = vcrypto->data_vq[i].vq; vcrypto 433 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto = vdev->priv; vcrypto 437 drivers/crypto/virtio/virtio_crypto_core.c if (virtcrypto_dev_started(vcrypto)) vcrypto 438 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_dev_stop(vcrypto); vcrypto 440 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_free_unused_reqs(vcrypto); vcrypto 441 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_clear_crypto_engines(vcrypto); vcrypto 442 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_del_vqs(vcrypto); vcrypto 443 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_devmgr_rm_dev(vcrypto); vcrypto 444 drivers/crypto/virtio/virtio_crypto_core.c kfree(vcrypto); vcrypto 449 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto = vdev->priv; vcrypto 451 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_update_status(vcrypto); vcrypto 457 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto = vdev->priv; vcrypto 460 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_free_unused_reqs(vcrypto); vcrypto 461 drivers/crypto/virtio/virtio_crypto_core.c if (virtcrypto_dev_started(vcrypto)) vcrypto 462 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_dev_stop(vcrypto); vcrypto 464 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_clear_crypto_engines(vcrypto); vcrypto 465 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_del_vqs(vcrypto); vcrypto 471 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto = vdev->priv; vcrypto 474 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_init_vqs(vcrypto); vcrypto 478 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_start_crypto_engines(vcrypto); vcrypto 484 drivers/crypto/virtio/virtio_crypto_core.c err = virtcrypto_dev_start(vcrypto); vcrypto 493 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_clear_crypto_engines(vcrypto); vcrypto 495 drivers/crypto/virtio/virtio_crypto_core.c vcrypto->vdev->config->reset(vdev); vcrypto 496 drivers/crypto/virtio/virtio_crypto_core.c virtcrypto_del_vqs(vcrypto); vcrypto 238 drivers/crypto/virtio/virtio_crypto_mgr.c int virtcrypto_dev_start(struct virtio_crypto *vcrypto) vcrypto 240 drivers/crypto/virtio/virtio_crypto_mgr.c if (virtio_crypto_algs_register(vcrypto)) { vcrypto 258 drivers/crypto/virtio/virtio_crypto_mgr.c void virtcrypto_dev_stop(struct virtio_crypto *vcrypto) vcrypto 260 drivers/crypto/virtio/virtio_crypto_mgr.c virtio_crypto_algs_unregister(vcrypto); vcrypto 277 drivers/crypto/virtio/virtio_crypto_mgr.c bool virtcrypto_algo_is_supported(struct virtio_crypto *vcrypto, vcrypto 290 drivers/crypto/virtio/virtio_crypto_mgr.c if (!(vcrypto->crypto_services & service_mask)) vcrypto 296 drivers/crypto/virtio/virtio_crypto_mgr.c algo_mask = vcrypto->cipher_algo_l; vcrypto 298 drivers/crypto/virtio/virtio_crypto_mgr.c algo_mask = vcrypto->cipher_algo_h; vcrypto 302 drivers/crypto/virtio/virtio_crypto_mgr.c algo_mask = vcrypto->hash_algo; vcrypto 307 drivers/crypto/virtio/virtio_crypto_mgr.c algo_mask = vcrypto->mac_algo_l; vcrypto 309 drivers/crypto/virtio/virtio_crypto_mgr.c algo_mask = vcrypto->mac_algo_h; vcrypto 313 drivers/crypto/virtio/virtio_crypto_mgr.c algo_mask = vcrypto->aead_algo;