qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org,
	peter.huangpeng@huawei.com, luonengjun@huawei.com,
	mst@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
	weidong.huang@huawei.com, mike.caraman@nxp.com, agraf@suse.de,
	xin.zeng@intel.com, claudio.fontana@huawei.com, nmorey@kalray.eu,
	vincent.jardin@6wind.com
Subject: Re: [Qemu-devel] [PATCH v2 00/15] virtio-crypto: introduce framework and device emulation
Date: Tue, 13 Sep 2016 09:57:46 +0100	[thread overview]
Message-ID: <20160913085746.GB30949@redhat.com> (raw)
In-Reply-To: <1473738741-220600-1-git-send-email-arei.gonglei@huawei.com>

On Tue, Sep 13, 2016 at 11:52:06AM +0800, Gonglei wrote:
> Changes since v1:
>  - rmmove mixed endian-ness handler for virtio-crypto device, just
>    use little-endian. [mst]
>  - add sg list support according virtio-crypto spec v10 (will be posted soon).
>  - fix a memory leak in session handler.
>  - add a feature page link in qemu.org (http://qemu-project.org/Features/VirtioCrypto)
>  - fix some trivial problems, sush as 's/Since 2.7/Since 2.8/g' in qapi-schema.json
>  - rebase the latest qemu master tree.
> 
> Please review, thanks!
> 
> This patch series realize the framework and emulation of a new
> virtio crypto device, which is similar with virtio net device.
>  
>  - I introduce the cryptodev backend as the client of virtio crypto device
>    which can be realized by different methods, such as cryptodev-linux in my series,
>    vhost-crypto kernel module, vhost-user etc.
>  - The patch set abides by the virtio crypto speccification.
>  - The virtio crypto support symmetric algorithms (including CIPHER and algorithm chainning)
>    at present, except HASH, MAC and AEAD services.
>  - unsupport hot plug/unplug cryptodev client at this moment.
> 
> Cryptodev-linux is a device that allows access to Linux kernel cryptographic drivers;
> thus allowing of userspace applications to take advantage of hardware accelerators.
> It can be found here:
> 
>  http://cryptodev-linux.org/
> 
> (please use the latest version)
> 
> To use the cryptodev-linux as the client, the cryptodev.ko should be insert on the host.
> 
>  # enter cryptodev-linux module root directory, then
>  make;make install


The cryptodev kernel module is not upstream and shows no sign of
ever being likely to be accepted & merged upstream. On that basis,
support for it in QEMU has a firm NACK from me, as trying to support
out of tree kernel modules long term never ends well. This is
particularly bad because it appears to be the only impl backend
you've provided in this series.

IMHO, the first default backend should ought to use the internal
QEMU crypto APIs for its impl, which delegate to nettle/gcrypt,
which in turn can take care of using the kernel for acceleration
if they so choose.

> then configuring QEMU shows:
> 
>  [...]
>  jemalloc support  no
>  avx2 optimization no
>  cryptodev-linux support yes
> 
> QEMU can then be started using the following parameters:
> 
> qemu-system-x86_64 \
>     [...] \
>         -cryptodev type=cryptodev-linux,id=cryptodev0 \
>         -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
>     [...]
> 
> The front-end linux kernel driver (Experimental at present) is publicly accessible from:
>  
>    https://github.com/gongleiarei/virtio-crypto-linux-driver.git
> 
> After insmod virtio-crypto.ko, you also can use cryptodev-linux test the crypto function
> in the guest. For example:


> 
> linux-guest:/home/gonglei/cryptodev-linux/tests # ./cipher -
> requested cipher CRYPTO_AES_CBC, got cbc(aes) with driver virtio_crypto_aes_cbc
> AES Test passed
> requested cipher CRYPTO_AES_CBC, got cbc(aes) with driver virtio_crypto_aes_cbc
> requested cipher CRYPTO_AES_CBC, got cbc(aes) with driver virtio_crypto_aes_cbc
> Test passed
> 
> QEMU code also can be accessible from:
> 
>  https://github.com/gongleiarei/qemu.git 
> 
>  branch virtio-crypto
> 
> For more information, please see:
>  http://qemu-project.org/Features/VirtioCrypto
> 
> 
> Gonglei (15):
>   crypto: introduce cryptodev backend and crypto legacy hardware
>   crypto: introduce crypto queue handler
>   crypto: add cryptoLegacyHW stuff
>   crypto: add symetric algorithms support
>   crypto: add cryptodev-linux as a cryptodev backend
>   crypto: add internal handle logic layer
>   virtio-crypto: introduce virtio-crypto.h
>   virtio-crypto-pci: add virtio crypto pci support
>   virtio-crypto: add virtio crypto realization
>   virtio-crypto: set capacity of crypto legacy hardware
>   virtio-crypto: add control queue handler
>   virtio-crypto: add destroy session logic
>   virtio-crypto: get correct input data address for each request
>   virtio-crypto: add data virtqueue processing handler
>   virtio-crypto: support scatter gather list
> 
>  configure                                      |   16 +
>  crypto/Makefile.objs                           |    3 +
>  crypto/crypto-queue.c                          |  206 +++++
>  crypto/crypto.c                                |  378 +++++++++

As a general point, please don't take the plain 'crypto'
namespace - that's way too generic a term.

I'd expect to see 'cryptodev.c' and 'cryptodev-queue.c'
really, since these files appear specific to the cryptodev

>  crypto/cryptodev-linux.c                       |  419 ++++++++++
>  hw/core/qdev-properties-system.c               |   86 ++
>  hw/virtio/Makefile.objs                        |    3 +-
>  hw/virtio/virtio-crypto-pci.c                  |   71 ++
>  hw/virtio/virtio-crypto.c                      | 1013 ++++++++++++++++++++++++
>  hw/virtio/virtio-pci.h                         |   15 +
>  include/crypto/crypto-clients.h                |   39 +

I'd expect header file names to match the name of the
.c file containing the impl. You've not added any
crypto-clients.c file - if the code is in crypto.c
then the crypto-clients.h content should be in
crypto.h too.

>  include/crypto/crypto-queue.h                  |   69 ++
>  include/crypto/crypto.h                        |  192 +++++

Again, cryptodev.h and crypto-queue.h are preferrable


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  parent reply	other threads:[~2016-09-13  8:58 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  3:52 [Qemu-devel] [PATCH v2 00/15] virtio-crypto: introduce framework and device emulation Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 01/15] crypto: introduce cryptodev backend and crypto legacy hardware Gonglei
2016-09-13  9:13   ` Daniel P. Berrange
2016-09-13  9:55     ` Gonglei (Arei)
2016-09-13  9:59       ` Daniel P. Berrange
2016-09-13 10:06         ` Gonglei (Arei)
2016-09-13 10:50     ` Paolo Bonzini
2016-09-13 11:04       ` Daniel P. Berrange
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 02/15] crypto: introduce crypto queue handler Gonglei
2016-09-13  9:20   ` Daniel P. Berrange
2016-09-13  9:58     ` Gonglei (Arei)
2016-09-13 10:58     ` Paolo Bonzini
2016-09-13 11:52       ` [Qemu-devel] [virtio-dev] " Ola Liljedahl
2016-09-14  1:07         ` Gonglei (Arei)
2016-09-14  8:24           ` Ola Liljedahl
2016-09-14  1:03       ` Gonglei (Arei)
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 03/15] crypto: add cryptoLegacyHW stuff Gonglei
2016-09-13  9:22   ` Daniel P. Berrange
2016-09-13 10:05     ` Gonglei (Arei)
2016-09-13 10:08       ` Daniel P. Berrange
2016-09-13 10:14         ` Gonglei (Arei)
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 04/15] crypto: add symetric algorithms support Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 05/15] crypto: add cryptodev-linux as a cryptodev backend Gonglei
2016-09-13  9:23   ` Daniel P. Berrange
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 06/15] crypto: add internal handle logic layer Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 07/15] virtio-crypto: introduce virtio-crypto.h Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 08/15] virtio-crypto-pci: add virtio crypto pci support Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 09/15] virtio-crypto: add virtio crypto realization Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 10/15] virtio-crypto: set capacity of crypto legacy hardware Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 11/15] virtio-crypto: add control queue handler Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 12/15] virtio-crypto: add destroy session logic Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 13/15] virtio-crypto: get correct input data address for each request Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 14/15] virtio-crypto: add data virtqueue processing handler Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 15/15] virtio-crypto: support scatter gather list Gonglei
2016-09-13  8:57 ` Daniel P. Berrange [this message]
2016-09-13  9:45   ` [Qemu-devel] [PATCH v2 00/15] virtio-crypto: introduce framework and device emulation Gonglei (Arei)
2016-09-13  9:54     ` Daniel P. Berrange
2016-09-13 10:08       ` Gonglei (Arei)
2016-09-13 10:58       ` Paolo Bonzini
2016-09-13 11:07         ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160913085746.GB30949@redhat.com \
    --to=berrange@redhat.com \
    --cc=agraf@suse.de \
    --cc=arei.gonglei@huawei.com \
    --cc=claudio.fontana@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=mike.caraman@nxp.com \
    --cc=mst@redhat.com \
    --cc=nmorey@kalray.eu \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vincent.jardin@6wind.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=weidong.huang@huawei.com \
    --cc=xin.zeng@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).