on 2016/11/17 23:55, Benedetto, Salvatore wrote: > Hi Gonglei, > > ... >> + >> +static int virtio_crypto_alg_ablkcipher_init_session( >> + struct virtio_crypto_ablkcipher_ctx *ctx, >> + int alg, const uint8_t *key, >> + unsigned int keylen, >> + int encrypt) >> +{ >> + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; >> + unsigned int tmp; >> + struct virtio_crypto_session_input input; >> + struct virtio_crypto_op_ctrl_req ctrl; >> + struct virtio_crypto *vcrypto = ctx->vcrypto; >> + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : >> VIRTIO_CRYPTO_OP_DECRYPT; >> + int err; >> + unsigned int num_out = 0, num_in = 0; >> + >> + memset(&ctrl, 0, sizeof(ctrl)); >> + memset(&input, 0, sizeof(input)); >> + /* Pad ctrl header */ >> + ctrl.header.opcode = >> cpu_to_le32(VIRTIO_CRYPTO_CIPHER_CREATE_SESSION); >> + ctrl.header.algo = cpu_to_le32((uint32_t)alg); >> + /* Set the default dataqueue id to 0 */ >> + ctrl.header.queue_id = 0; >> + >> + input.status = cpu_to_le32(VIRTIO_CRYPTO_ERR); >> + /* Pad cipher's parameters */ >> + ctrl.u.sym_create_session.op_type = >> + cpu_to_le32(VIRTIO_CRYPTO_SYM_OP_CIPHER); >> + ctrl.u.sym_create_session.u.cipher.para.algo = ctrl.header.algo; >> + ctrl.u.sym_create_session.u.cipher.para.keylen = >> cpu_to_le32(keylen); >> + ctrl.u.sym_create_session.u.cipher.para.op = cpu_to_le32(op); >> + >> + sg_init_one(&outhdr, &ctrl, sizeof(ctrl)); > I believe this won't work when the new virtually-mapped kernel stack (VMAP_STACK) > is enabled. I see, will fix it in the next version. Thanks for your comments :) > > Regards, > Salvatore -- Regards, -Gonglei _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization