[Qemu-devel] [PATCH v3 0/5] crypto threads

Vladimir Sementsov-Ogievskiy posted 5 patches 5 years, 4 months ago
Test checkpatch passed
Test docker-quick@centos7 passed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181207161351.4380-1-vsementsov@virtuozzo.com
crypto/blockpriv.h        |  42 +++++--
include/crypto/block.h    |   2 +
block/crypto.c            |   1 +
block/qcow.c              |   2 +-
block/qcow2.c             |   4 +-
crypto/block-luks.c       |  57 +++++-----
crypto/block-qcow.c       |  26 ++---
crypto/block.c            | 225 +++++++++++++++++++++++++++++---------
tests/test-crypto-block.c |   3 +
9 files changed, 257 insertions(+), 105 deletions(-)
[Qemu-devel] [PATCH v3 0/5] crypto threads
Posted by Vladimir Sementsov-Ogievskiy 5 years, 4 months ago
Hi all.

v3:
01: add r-b by Daniel and Alberto
02: Alberto r-b
    encrypt->encdec for generic
03: qcrypto_cipher_*crypt_helper->
    qcrypto_block_cipher_*crypt_helper
04: rebased on previous renamings
    Daniel r-b
05: use size_t
    improve comment about n_threads
    don't use ret in qcrypto_block_luks_create
    do qemu_mutex_init at the end of open/create
    do qemu_mutex_destroy in free
    fix comment for qcrypto_block_get_cipher

v2:
05: fix compilation of test-crypto-block (I am ashamed:(
    and change QCryptoBlock interface to be a bit more safe.

These series are preliminary step before moving encryption code in
qcow2 to the threads. The first attempt of doing it is on list
([PATCH 00/11] qcow2: encryption threads : 
 https://lists.gnu.org/archive/html/qemu-block/2018-11/msg00729.html)
But it's approach with multiplying the whole QCryptoBlock per thread
was rejected. So, here is a solution to maintain multitasking inside
QCryptoBlock.

Vladimir Sementsov-Ogievskiy (5):
  crypto/block-luks: fix memory leak in qcrypto_block_luks_create
  crypto/block: refactor qcrypto_block_*crypt_helper functions
  crypto/block: rename qcrypto_block_*crypt_helper
  crypto/block: introduce qcrypto_block_*crypt_helper functions
  crypto: support multiple threads accessing one QCryptoBlock

 crypto/blockpriv.h        |  42 +++++--
 include/crypto/block.h    |   2 +
 block/crypto.c            |   1 +
 block/qcow.c              |   2 +-
 block/qcow2.c             |   4 +-
 crypto/block-luks.c       |  57 +++++-----
 crypto/block-qcow.c       |  26 ++---
 crypto/block.c            | 225 +++++++++++++++++++++++++++++---------
 tests/test-crypto-block.c |   3 +
 9 files changed, 257 insertions(+), 105 deletions(-)

-- 
2.18.0


Re: [Qemu-devel] [PATCH v3 0/5] crypto threads
Posted by Daniel P. Berrangé 5 years, 4 months ago
On Fri, Dec 07, 2018 at 07:13:46PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all.
> 
> v3:
> 01: add r-b by Daniel and Alberto
> 02: Alberto r-b
>     encrypt->encdec for generic
> 03: qcrypto_cipher_*crypt_helper->
>     qcrypto_block_cipher_*crypt_helper
> 04: rebased on previous renamings
>     Daniel r-b
> 05: use size_t
>     improve comment about n_threads
>     don't use ret in qcrypto_block_luks_create
>     do qemu_mutex_init at the end of open/create
>     do qemu_mutex_destroy in free
>     fix comment for qcrypto_block_get_cipher
> 
> v2:
> 05: fix compilation of test-crypto-block (I am ashamed:(
>     and change QCryptoBlock interface to be a bit more safe.
> 
> These series are preliminary step before moving encryption code in
> qcow2 to the threads. The first attempt of doing it is on list
> ([PATCH 00/11] qcow2: encryption threads : 
>  https://lists.gnu.org/archive/html/qemu-block/2018-11/msg00729.html)
> But it's approach with multiplying the whole QCryptoBlock per thread
> was rejected. So, here is a solution to maintain multitasking inside
> QCryptoBlock.

Thanks, I've queued this series for when 4.0 opens up.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|