search for: virtio_crypto_request

Displaying 20 results from an estimated 60 matches for "virtio_crypto_request".

2016 Dec 27
1
[PATCH] virtio-crypto: support crypto engine framework
...io/virtio_crypto_algs.c index c2374df..970d0ca 100644 --- a/drivers/crypto/virtio/virtio_crypto_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_algs.c @@ -288,8 +288,7 @@ static int virtio_crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm, static int __virtio_crypto_ablkcipher_do_req(struct virtio_crypto_request *vc_req, struct ablkcipher_request *req, - struct data_queue *data_vq, - __u8 op) + struct data_queue *data_vq) { struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); @@ -329,7 +328,7 @@ static int virtio_crypto_ablkcipher_se...
2016 Dec 27
1
[PATCH] virtio-crypto: support crypto engine framework
...io/virtio_crypto_algs.c index c2374df..970d0ca 100644 --- a/drivers/crypto/virtio/virtio_crypto_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_algs.c @@ -288,8 +288,7 @@ static int virtio_crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm, static int __virtio_crypto_ablkcipher_do_req(struct virtio_crypto_request *vc_req, struct ablkcipher_request *req, - struct data_queue *data_vq, - __u8 op) + struct data_queue *data_vq) { struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); @@ -329,7 +328,7 @@ static int virtio_crypto_ablkcipher_se...
2016 Dec 14
2
[Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver
...le mode 100644 > index 0000000..c0854a1 > --- /dev/null > +++ b/drivers/crypto/virtio/virtio_crypto_core.c > @@ -0,0 +1,474 @@ [..] > + > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > +{ > + struct virtio_crypto *vcrypto = vq->vdev->priv; > + struct virtio_crypto_request *vc_req; > + unsigned long flags; > + unsigned int len; > + struct ablkcipher_request *ablk_req; > + int error; > + > + spin_lock_irqsave(&vcrypto->lock, flags); Would it make sense to use a per virtqueue lock like in virtio_blk for example instead of locking on the whole...
2016 Dec 14
2
[Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver
...le mode 100644 > index 0000000..c0854a1 > --- /dev/null > +++ b/drivers/crypto/virtio/virtio_crypto_core.c > @@ -0,0 +1,474 @@ [..] > + > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > +{ > + struct virtio_crypto *vcrypto = vq->vdev->priv; > + struct virtio_crypto_request *vc_req; > + unsigned long flags; > + unsigned int len; > + struct ablkcipher_request *ablk_req; > + int error; > + > + spin_lock_irqsave(&vcrypto->lock, flags); Would it make sense to use a per virtqueue lock like in virtio_blk for example instead of locking on the whole...
2016 Dec 15
2
[Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver
...b/drivers/crypto/virtio/virtio_crypto_core.c < > > @@ -0,0 +1,474 @@ < > [..] < > > + < > > +static void virtcrypto_dataq_callback(struct virtqueue *vq) < > > +{ < > > + struct virtio_crypto *vcrypto = vq->vdev->priv; < > > + struct virtio_crypto_request *vc_req; < > > + unsigned long flags; < > > + unsigned int len; < > > + struct ablkcipher_request *ablk_req; < > > + int error; < > > + < > > + spin_lock_irqsave(&vcrypto->lock, flags); < > < > Would it make sense to use a per...
2016 Dec 15
2
[Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver
...b/drivers/crypto/virtio/virtio_crypto_core.c < > > @@ -0,0 +1,474 @@ < > [..] < > > + < > > +static void virtcrypto_dataq_callback(struct virtqueue *vq) < > > +{ < > > + struct virtio_crypto *vcrypto = vq->vdev->priv; < > > + struct virtio_crypto_request *vc_req; < > > + unsigned long flags; < > > + unsigned int len; < > > + struct ablkcipher_request *ablk_req; < > > + int error; < > > + < > > + spin_lock_irqsave(&vcrypto->lock, flags); < > < > Would it make sense to use a per...
2019 Oct 14
0
[PATCH 03/25] crypto: virtio - switch to skcipher API
...eue *data_vq) { - struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); - struct virtio_crypto_ablkcipher_ctx *ctx = vc_sym_req->ablkcipher_ctx; + struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); + struct virtio_crypto_skcipher_ctx *ctx = vc_sym_req->skcipher_ctx; struct virtio_crypto_request *vc_req = &vc_sym_req->base; - unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); + unsigned int ivsize = crypto_skcipher_ivsize(tfm); struct virtio_crypto *vcrypto = ctx->vcrypto; struct virtio_crypto_op_data_req *req_data; int src_nents, dst_nents; @@ -359,7 +360,7 @@ __virtio_c...
2019 Oct 24
0
[PATCH v2 03/27] crypto: virtio - switch to skcipher API
...eue *data_vq) { - struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); - struct virtio_crypto_ablkcipher_ctx *ctx = vc_sym_req->ablkcipher_ctx; + struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); + struct virtio_crypto_skcipher_ctx *ctx = vc_sym_req->skcipher_ctx; struct virtio_crypto_request *vc_req = &vc_sym_req->base; - unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); + unsigned int ivsize = crypto_skcipher_ivsize(tfm); struct virtio_crypto *vcrypto = ctx->vcrypto; struct virtio_crypto_op_data_req *req_data; int src_nents, dst_nents; @@ -359,7 +360,7 @@ __virtio_c...
2018 Jan 26
0
[PATCH v2 4/6] crypto: virtio: convert to new crypto engine API
...t_req( - struct crypto_engine *engine, - struct ablkcipher_request *req) + struct crypto_engine *engine, void *vreq) { + struct ablkcipher_request *req = container_of(vreq, struct ablkcipher_request, base); struct virtio_crypto_sym_request *vc_sym_req = ablkcipher_request_ctx(req); struct virtio_crypto_request *vc_req = &vc_sym_req->base; @@ -561,8 +565,8 @@ static void virtio_crypto_ablkcipher_finalize_req( struct ablkcipher_request *req, int err) { - crypto_finalize_cipher_request(vc_sym_req->base.dataq->engine, - req, err); + crypto_finalize_ablkcipher_request(vc_sym_req->base...
2016 Dec 15
1
[Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver
...@@ -0,0 +1,474 @@ > > < > [..] > > < > > + > > < > > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > > < > > +{ > > < > > + struct virtio_crypto *vcrypto = vq->vdev->priv; > > < > > + struct virtio_crypto_request *vc_req; > > < > > + unsigned long flags; > > < > > + unsigned int len; > > < > > + struct ablkcipher_request *ablk_req; > > < > > + int error; > > < > > + > > < > > + spin_lock_irqsave(&vcrypto->lock,...
2016 Dec 15
1
[Qemu-devel] [PATCH v7 1/1] crypto: add virtio-crypto driver
...@@ -0,0 +1,474 @@ > > < > [..] > > < > > + > > < > > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > > < > > +{ > > < > > + struct virtio_crypto *vcrypto = vq->vdev->priv; > > < > > + struct virtio_crypto_request *vc_req; > > < > > + unsigned long flags; > > < > > + unsigned int len; > > < > > + struct ablkcipher_request *ablk_req; > > < > > + int error; > > < > > + > > < > > + spin_lock_irqsave(&vcrypto->lock,...
2016 Dec 14
0
[PATCH v7 1/1] crypto: add virtio-crypto driver
...rtio_crypto_alg_ablkcipher_close_session(ctx, 0); + } + + ret = virtio_crypto_alg_ablkcipher_init_sessions(ctx, key, keylen); + if (ret) { + virtcrypto_dev_put(ctx->vcrypto); + ctx->vcrypto = NULL; + + return ret; + } + + return 0; +} + +static int +__virtio_crypto_ablkcipher_do_req(struct virtio_crypto_request *vc_req, + struct ablkcipher_request *req, + struct data_queue *data_vq, + __u8 op) +{ + struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); + unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); + struct virtio_crypto_ablkcipher_ctx *ctx = vc_req->ablkcipher_ctx; + struct virtio_c...
2016 Dec 15
0
[PATCH v8 1/1] crypto: add virtio-crypto driver
...rtio_crypto_alg_ablkcipher_close_session(ctx, 0); + } + + ret = virtio_crypto_alg_ablkcipher_init_sessions(ctx, key, keylen); + if (ret) { + virtcrypto_dev_put(ctx->vcrypto); + ctx->vcrypto = NULL; + + return ret; + } + + return 0; +} + +static int +__virtio_crypto_ablkcipher_do_req(struct virtio_crypto_request *vc_req, + struct ablkcipher_request *req, + struct data_queue *data_vq, + __u8 op) +{ + struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); + unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); + struct virtio_crypto_ablkcipher_ctx *ctx = vc_req->ablkcipher_ctx; + struct virtio_c...
2016 Dec 14
2
[PATCH v7 0/1] virtio-crypto: add Linux driver
v7: - fix "BUG: smp_processor_id() in preemptible [00000000] code" reported by Halil, using get_cpu/put_cpu instead of calling smp_processor_id() directly. - fix a possible spinlock recursion in virtcrypto_dataq_callback(), we should release the spinlock before invoking the callback. - rebase on the latest kernel master tree. v6: - add patch 1/2 to make sparc architecture
2016 Dec 14
2
[PATCH v7 0/1] virtio-crypto: add Linux driver
v7: - fix "BUG: smp_processor_id() in preemptible [00000000] code" reported by Halil, using get_cpu/put_cpu instead of calling smp_processor_id() directly. - fix a possible spinlock recursion in virtcrypto_dataq_callback(), we should release the spinlock before invoking the callback. - rebase on the latest kernel master tree. v6: - add patch 1/2 to make sparc architecture
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...+#include <linux/cpu.h> > + > +#include <uapi/linux/virtio_crypto.h> > +#include "virtio_crypto_common.h" > + > + > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > +{ > + struct virtio_crypto *vcrypto = vq->vdev->priv; > + struct virtio_crypto_request *vc_req; > + unsigned long flags; > + unsigned int len; > + struct ablkcipher_request *ablk_req; > + int error; > + > + spin_lock_irqsave(&vcrypto->lock, flags); > + do { > + virtqueue_disable_cb(vq); > + while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL)...
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...+#include <linux/cpu.h> > + > +#include <uapi/linux/virtio_crypto.h> > +#include "virtio_crypto_common.h" > + > + > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > +{ > + struct virtio_crypto *vcrypto = vq->vdev->priv; > + struct virtio_crypto_request *vc_req; > + unsigned long flags; > + unsigned int len; > + struct ablkcipher_request *ablk_req; > + int error; > + > + spin_lock_irqsave(&vcrypto->lock, flags); > + do { > + virtqueue_disable_cb(vq); > + while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL)...
2016 Nov 28
0
[virtio-dev] Re: [PATCH v2 2/2] crypto: add virtio-crypto driver
...; > +#include <uapi/linux/virtio_crypto.h> > > +#include "virtio_crypto_common.h" > > + > > + > > +static void virtcrypto_dataq_callback(struct virtqueue *vq) > > +{ > > + struct virtio_crypto *vcrypto = vq->vdev->priv; > > + struct virtio_crypto_request *vc_req; > > + unsigned long flags; > > + unsigned int len; > > + struct ablkcipher_request *ablk_req; > > + int error; > > + > > + spin_lock_irqsave(&vcrypto->lock, flags); > > + do { > > + virtqueue_disable_cb(vq); > > + while ((vc_re...
2016 Nov 22
0
[PATCH v2 2/2] crypto: add virtio-crypto driver
...> +#include <linux/virtio_config.h> +#include <linux/cpu.h> + +#include <uapi/linux/virtio_crypto.h> +#include "virtio_crypto_common.h" + + +static void virtcrypto_dataq_callback(struct virtqueue *vq) +{ + struct virtio_crypto *vcrypto = vq->vdev->priv; + struct virtio_crypto_request *vc_req; + unsigned long flags; + unsigned int len; + struct ablkcipher_request *ablk_req; + int error; + + spin_lock_irqsave(&vcrypto->lock, flags); + do { + virtqueue_disable_cb(vq); + while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL) { + if (vc_req->type == VIRTIO_CRYPTO_S...
2016 Nov 28
0
[PATCH v3] crypto: add virtio-crypto driver
...> +#include <linux/virtio_config.h> +#include <linux/cpu.h> + +#include <uapi/linux/virtio_crypto.h> +#include "virtio_crypto_common.h" + + +static void virtcrypto_dataq_callback(struct virtqueue *vq) +{ + struct virtio_crypto *vcrypto = vq->vdev->priv; + struct virtio_crypto_request *vc_req; + unsigned long flags; + unsigned int len; + struct ablkcipher_request *ablk_req; + int error; + + spin_lock_irqsave(&vcrypto->lock, flags); + do { + virtqueue_disable_cb(vq); + while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL) { + if (vc_req->type == VIRTIO_CRYPTO_S...