[PATCH v6 9/9] crypto: Introduce RSA algorithm

2022-05-13 Thread zhenwei pi
There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and

[PATCH v6 8/9] tests/crypto: Add test suite for RSA keys

2022-05-13 Thread zhenwei pi
From: Lei He As Daniel suggested, Add tests suite for rsakey, as a way to prove that we can handle DER errors correctly. Signed-off-by: zhenwei pi Signed-off-by: lei he Reviewed-by: Daniel P. Berrangé --- tests/unit/test-crypto-akcipher.c | 285 +- 1 file changed,

[PATCH v6 7/9] test/crypto: Add test suite for crypto akcipher

2022-05-13 Thread zhenwei pi
From: Lei He Add unit test and benchmark test for crypto akcipher. Signed-off-by: lei he Signed-off-by: zhenwei pi Reviewed-by: Daniel P. Berrangé --- tests/bench/benchmark-crypto-akcipher.c | 157 ++ tests/bench/meson.build | 1 + tests/bench/test_akcipher_keys.inc

[PATCH v6 6/9] crypto: Implement RSA algorithm by gcrypt

2022-05-13 Thread zhenwei pi
From: Lei He Added gcryt implementation of RSA algorithm, RSA algorithm implemented by gcrypt has a higher priority than nettle because it supports raw padding. Signed-off-by: zhenwei pi Signed-off-by: lei he --- crypto/akcipher-gcrypt.c.inc | 597 +++ crypto/a

[PATCH v6 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 Thread zhenwei pi
From: Lei He Implement RSA algorithm by hogweed from nettle. Thus QEMU supports a 'real' RSA backend to handle request from guest side. It's important to test RSA offload case without OS & hardware requirement. Signed-off-by: lei he Signed-off-by: zhenwei pi --- crypto/akcipher-nettle.c.inc |

[PATCH v6 4/9] crypto: add ASN.1 DER decoder

2022-05-13 Thread zhenwei pi
From: Lei He Add an ANS.1 DER decoder which is used to parse asymmetric cipher keys Signed-off-by: zhenwei pi Signed-off-by: lei he --- crypto/der.c | 189 +++ crypto/der.h | 81 ++ crypto/meson.build | 1 + tests/unit/m

[PATCH v6 3/9] crypto: Introduce akcipher crypto class

2022-05-13 Thread zhenwei pi
Introduce new akcipher crypto class 'QCryptoAkCIpher', which supports basic asymmetric operations: encrypt, decrypt, sign and verify. Suggested by Daniel P. Berrangé, also add autoptr cleanup for the new class. Thanks to Daniel! Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenw

[PATCH v6 2/9] qapi: crypto-akcipher: Introduce akcipher types to qapi

2022-05-13 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA related types. Reviewed-by: Daniel P. Berrangé Signed-off-by: Lei He Signed-off-by: zhenwei pi --- qapi/crypto.json | 64 1 file changed, 64 insertions(+) diff --git a/qapi/crypto.json b

[PATCH v6 1/9] virtio-crypto: header update

2022-05-13 Thread zhenwei pi
Update header from linux, support akcipher service. Reviewed-by: Daniel P. Berrangé Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi --- .../standard-headers/linux/virtio_crypto.h| 82 ++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/in

[PATCH v6 0/9] Introduce akcipher service for virtio-crypto

2022-05-13 Thread zhenwei pi
v5 -> v6: - Fix build errors and codestyles. - Add parameter 'Error **errp' for qcrypto_akcipher_rsakey_parse. - Report more detailed errors. - Fix buffer length check and return values of akcipher-nettle, allows caller to pass a buffer with larger size than actual needed. A million thanks to Da

Re: [PATCH v3] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-13 Thread Srivatsa S. Bhat
On 5/13/22 10:46 AM, Elliot Berman wrote: > From: Prakruthi Deepak Heragu > > During hotplug, the stolen time data structure is unmapped and memset. > There is a possibility of the timer IRQ being triggered before memset > and stolen time is getting updated as part of this timer IRQ handler. This

RE: About restoring the state in vhost-vdpa device

2022-05-13 Thread Parav Pandit via Virtualization
Hi Gautam, Please fix your email client to have right response format. Otherwise, it will be confusing for the rest and us to follow the conversation. More below. > From: Gautam Dawar > Sent: Friday, May 13, 2022 1:48 PM > > Our proposal diverge in step 7: Instead of enabling *all* the > > vir

RE: About restoring the state in vhost-vdpa device

2022-05-13 Thread Parav Pandit via Virtualization
> From: Eugenio Perez Martin > Sent: Wednesday, May 11, 2022 3:44 PM > > This is a proposal to restore the state of the vhost-vdpa device at the > destination after a live migration. It uses as many available features both > from the device and from qemu as possible so we keep the communication

Re: [GIT PULL] virtio: last minute fixup

2022-05-13 Thread Eric W. Biederman
Linus Torvalds writes: > On Thu, May 12, 2022 at 10:10 AM Linus Torvalds > wrote: >> >> And most definitely not just random data that can be trivially >> auto-generated after-the-fact. > > Put another way: when people asked for change ID's and I said "we have > links", I by no means meant that "

Re: [PATCH RESEND v5 1/4] PCI: Clean up pci_scan_slot()

2022-05-13 Thread Bjorn Helgaas
On Thu, May 12, 2022 at 04:56:42PM +0200, Niklas Schnelle wrote: > On Thu, 2022-05-05 at 10:38 +0200, Niklas Schnelle wrote: > > While determining the next PCI function is factored out of > > pci_scan_slot() into next_fn() the former still handles the first > > function as a special case. This dupl

Re: [External] [PATCH v5 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 Thread Daniel P . Berrangé
On Fri, May 13, 2022 at 08:26:14PM +0800, 何磊 wrote: > > > > On May 13, 2022, at 6:55 PM, Daniel P. Berrangé wrote: > > > > On Thu, Apr 28, 2022 at 09:59:39PM +0800, zhenwei pi wrote: > >> From: Lei He > >> > >> Implement RSA algorithm by hogweed from nettle. Thus QEMU supports > >> a 'real' R

Re: [GIT PULL] virtio: last minute fixup

2022-05-13 Thread Michael S. Tsirkin
On Wed, May 11, 2022 at 02:24:23PM +0200, Jörg Rödel wrote: > On Tue, May 10, 2022 at 11:23:11AM -0700, Linus Torvalds wrote: > > And - once again - I want to complain about the "Link:" in that commit. > > I have to say that for me (probably for others as well) those Link tags > pointing to the pa

Re: [PATCH v5 6/9] crypto: Implement RSA algorithm by gcrypt

2022-05-13 Thread Daniel P . Berrangé
On Thu, Apr 28, 2022 at 09:59:40PM +0800, zhenwei pi wrote: > From: Lei He > > Added gcryt implementation of RSA algorithm, RSA algorithm > implemented by gcrypt has a higher priority than nettle because > it supports raw padding. > > Signed-off-by: lei he > --- > crypto/akcipher-gcrypt.c.inc

Re: [PATCH v5 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 Thread Daniel P . Berrangé
On Thu, Apr 28, 2022 at 09:59:39PM +0800, zhenwei pi wrote: > From: Lei He > > Implement RSA algorithm by hogweed from nettle. Thus QEMU supports > a 'real' RSA backend to handle request from guest side. It's > important to test RSA offload case without OS & hardware requirement. > > Signed-off-

Re: [PATCH v5 8/9] tests/crypto: Add test suite for RSA keys

2022-05-13 Thread Daniel P . Berrangé
On Thu, Apr 28, 2022 at 09:59:42PM +0800, zhenwei pi wrote: > From: Lei He > > As Daniel suggested, Add tests suite for rsakey, as a way to prove > that we can handle DER errors correctly. > > Signed-off-by: lei he > --- > tests/unit/test-crypto-akcipher.c | 285 +-

Re: [PATCH v5 0/9] Introduce akcipher service for virtio-crypto

2022-05-13 Thread Michael S. Tsirkin
On Fri, May 13, 2022 at 06:19:10AM -0400, Michael S. Tsirkin wrote: > On Thu, Apr 28, 2022 at 09:59:34PM +0800, zhenwei pi wrote: > > Hi, Lei & MST > > > > Daniel has started to review the akcipher framework and nettle & gcrypt > > implementation, this part seems to be ready soon. Thanks a lot to

Re: [PATCH v5 0/9] Introduce akcipher service for virtio-crypto

2022-05-13 Thread Michael S. Tsirkin
On Thu, Apr 28, 2022 at 09:59:34PM +0800, zhenwei pi wrote: > Hi, Lei & MST > > Daniel has started to review the akcipher framework and nettle & gcrypt > implementation, this part seems to be ready soon. Thanks a lot to Daniel! > > And the last patch "crypto: Introduce RSA algorithm" handles akci