qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] encrypt in threads


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] encrypt in threads
Date: Thu, 29 Nov 2018 18:28:44 +0000

On 27.11.2018 16:08, Daniel P. Berrangé wrote:
> On Thu, Nov 22, 2018 at 01:01:20PM +0000, Vladimir Sementsov-Ogievskiy wrote:
>> 21.11.2018 20:30, Vladimir Sementsov-Ogievskiy wrote:
>>> Hi Daniel!
>>>
>>> After moving compression to threads in Qcow2 it's an obvious next step to
>>> "threadyfy" encryption in Qcow2 too.
>>>
>>> But it turned out to be not as simple as I assumed. If I call 
>>> qcrypto_block_encrypt
>>> in parallel threads with the same first argument (block), it just produce 
>>> wrong
>>> things (pattern verification fails in iotests)..
>>>
>>> So, can you advise the way to parallelize encryption/decryption?
>>>
>> Hmm, just creating QCryptoBlock per each thread helped. Is it correct thing 
>> to do?
> That's rather a heavy weight approach and would cause pain when we want
> to support future options such as keyslot updates, and in the future,
> LUKSv2 with master key changes.
>
> Probably what's needed is change to QCryptoBlock struct so that there
> can be multiple QCryptoCipher instances allocated - one per thread.
>
> We might also need to introduce some locking around usage of the
> QCryptoIVGen object, since that has a QCryptoCipher handle too.


Can we also create QCryptoIVGen per thread, as QCryptoCipher? Or it 
should be one? If one, why my implementation with QCryptoBlock per 
thread works (at least it passes iotests, hmm)


>
> Regards,
> Daniel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]