Cc Paolo, Stefan, Xuan and linux-block.
On 10/19/23 17:52, Michael S. Tsirkin wrote:
On Thu, Oct 19, 2023 at 05:43:55PM +0800, zhenwei pi wrote:
Hi Michael,
This seems to have been ignored as you suggested.
LINK: https://www.spinics.net/lists/linux-virtualization/msg63015.html
Pls Cc more
Hi Michael,
This seems to have been ignored as you suggested.
LINK: https://www.spinics.net/lists/linux-virtualization/msg63015.html
On 9/4/23 14:10, zhenwei pi wrote:
The following codes have an implicit conversion from size_t to u32:
(u32)max_size = (size_t)virtio_max_dma_size(vdev
ontext.
Good catch. Will fix it.
Thanks Gonglei! Sorry I first misunderstood this as a problem within the
virtio-ccw driver, but it is actually about virtio-crypto. Thanks for
fixing this!
Regards,
Halil
--
zhenwei pi
___
Virtualization mailing list
The following codes have an implicit conversion from size_t to u32:
(u32)max_size = (size_t)virtio_max_dma_size(vdev);
This may lead overflow, Ex (size_t)4G -> (u32)0. Once
virtio_max_dma_size() has a larger size than U32_MAX, use U32_MAX
instead.
Signed-off-by: zhenwei pi
---
drivers/bl
On 7/4/23 14:21, Michael S. Tsirkin wrote:
On Wed, May 10, 2023 at 10:54:37AM +0800, zhenwei pi wrote:
Both split ring and packed ring use 32bits to describe the length of
a descriptor: see struct vring_desc and struct vring_packed_desc.
This means the max segment size supported by virtio
:37 +0800, zhenwei pi wrote:
Both split ring and packed ring use 32bits to describe the length of
a descriptor: see struct vring_desc and struct vring_packed_desc.
This means the max segment size supported by virtio is U32_MAX.
An example of virtio_max_dma_size in virtio_blk.c:
u32 v, max_size
On 5/18/23 18:09, Michael S. Tsirkin wrote:
On Thu, May 18, 2023 at 08:47:22AM +0800, zhenwei pi wrote:
On 5/17/23 18:39, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 04:35:55PM +0800, zhenwei pi wrote:
On 5/17/23 15:46, Christoph Hellwig wrote:
On Wed, May 17, 2023 at 03:43:03PM
On 5/17/23 18:39, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 04:35:55PM +0800, zhenwei pi wrote:
On 5/17/23 15:46, Christoph Hellwig wrote:
On Wed, May 17, 2023 at 03:43:03PM +0800, zhenwei pi wrote:
I have a plan to introduce 'Virtio Over Fabrics'(TCP) as Virtio
transport
On 5/17/23 15:46, Christoph Hellwig wrote:
On Wed, May 17, 2023 at 03:43:03PM +0800, zhenwei pi wrote:
I have a plan to introduce 'Virtio Over Fabrics'(TCP) as Virtio
transport, as mentioned in cover letter of this series:
3 weeks ago, I posted a proposal 'Virtio Over Fabrics':
https
On 5/17/23 15:39, Christoph Hellwig wrote:
On Wed, May 17, 2023 at 10:54:23AM +0800, zhenwei pi wrote:
All the vring based virtqueue methods could be abstratct in theory,
MST suggested that add/get bufs and kick functions are quite perfmance
sensitive, so export these functions from
On 5/17/23 14:10, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 12:58:10PM +0800, zhenwei pi wrote:
On 5/17/23 11:57, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 11:51:03AM +0800, zhenwei pi wrote:
On 5/17/23 11:46, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 10:54:22AM
On 5/17/23 11:57, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 11:51:03AM +0800, zhenwei pi wrote:
On 5/17/23 11:46, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 10:54:22AM +0800, zhenwei pi wrote:
v1 -> v2:
- Suggested by MST, use fast path for vring based performance
sensit
On 5/17/23 11:46, Michael S. Tsirkin wrote:
On Wed, May 17, 2023 at 10:54:22AM +0800, zhenwei pi wrote:
v1 -> v2:
- Suggested by MST, use fast path for vring based performance
sensitive API.
- Reduce changes in tools/virtio.
Add test result(no obvious change):
Before:
time ./vringh_t
eep it or rename it to
'vring_virtqueue_add_split'?
zhenwei pi (2):
virtio: abstract virtqueue related methods
tools/virtio: implement virtqueue in test
drivers/virtio/virtio_ring.c | 285 +-
include/linux/virtio.h | 441 +++
incl
that add/get bufs and kick functions are quite perfmance
sensitive, so export these functions from virtio_ring.ko, drivers
still call them in a fast path.
Cc: Stefan Hajnoczi
Signed-off-by: zhenwei pi
---
drivers/virtio/virtio_ring.c | 285 +-
include/linux/virtio.h | 441
virtqueue related functions has been abstract since commit
("virtio: abstract virtqueue related methods"), add compatible for
abstract API.
Signed-off-by: zhenwei pi
---
tools/virtio/linux/virtio.h | 355
1 file changed, 324 insertions(+), 31
On 5/12/23 19:35, Michael S. Tsirkin wrote:
On Fri, May 12, 2023 at 07:09:40PM +0800, zhenwei pi wrote:
On 5/12/23 18:46, Michael S. Tsirkin wrote:
On Fri, May 12, 2023 at 05:46:17PM +0800, zhenwei pi wrote:
There is already a virtqueue abstract structure in virtio subsystem
(see struct
On 5/12/23 18:46, Michael S. Tsirkin wrote:
On Fri, May 12, 2023 at 05:46:17PM +0800, zhenwei pi wrote:
There is already a virtqueue abstract structure in virtio subsystem
(see struct virtqueue in include/linux/virtio.h), however the vring
based virtqueue is used only in the past years
virtqueue related functions has been removed from virtio_ring.c since
commit("virtio: abstract virtqueue related methods"), rather than
compiling with drivers/virtio/virtio.c, implement virtqueue functions
here.
Signed-off-by: zhenwei pi
---
tools/virtio/Makefile | 4 +-
to
virtqueue_detach_unused_buf
virtqueue_get_vring_size
virtqueue_resize
virtqueue_is_broken
virtio_break_device
__virtio_unbreak_device
Cc: Stefan Hajnoczi
Signed-off-by: zhenwei pi
---
drivers/virtio/virtio.c | 362 +++
drivers/virtio/virtio_ring.c
with prefix *virtqueue*,
for example 'virtqueue_add_split', just keep it or rename it to
'vring_virtqueue_add_split'?
zhenwei pi (2):
virtio: abstract virtqueue related methods
tools/virtio: implement virtqueue in test
drivers/virtio/virtio.c | 362 ++
drivers
On 5/10/23 11:26, Xuan Zhuo wrote:
On Wed, 10 May 2023 10:54:37 +0800, zhenwei pi wrote:
Both split ring and packed ring use 32bits to describe the length of
a descriptor: see struct vring_desc and struct vring_packed_desc.
This means the max segment size supported by virtio is U32_MAX
On 5/10/23 11:39, Michael S. Tsirkin wrote:
On Wed, May 10, 2023 at 10:54:37AM +0800, zhenwei pi wrote:
Both split ring and packed ring use 32bits to describe the length of
a descriptor: see struct vring_desc and struct vring_packed_desc.
This means the max segment size supported by virtio
s 0.
Fixes: e6d6dd6c875e ("virtio: Introduce virtio_max_dma_size()")
Cc: Joerg Roedel
Signed-off-by: zhenwei pi
---
drivers/virtio/virtio_ring.c | 12
include/linux/virtio.h | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/virtio/virtio_rin
Looks good to me, thanks!
Acked-by: zhenwei pi
On 11/14/22 19:07, Wei Yongjun wrote:
From: Wei Yongjun
'vc_ctrl_req' is alloced in virtio_crypto_alg_skcipher_close_session(),
and should be freed in the invalid ctrl_status->status error handling
case. Otherwise there is a memory leak.
Fi
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
N1 decoder into QEMU.
- Implement RSA backend by nettle/hogweed.
Zhenwei Pi (1):
crypto: Introduce RSA algorithm
backends/cryptodev-builtin.c | 276 +
backends/cryptodev-vhost-user.c | 34 +++-
backends/cryptodev.c | 32 ++-
hw/virtio/virtio-crypto.c
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
- crypto: Introduce akcipher crypto class
- virtio-crypto: Introduce RSA algorithm
v1 -> v2:
- Update virtio_crypto.h from v2 version of related kernel patch.
v1:
- Support akcipher for virtio-crypto.
- Introduce akcipher class.
- Introduce ASN1 decoder into QEMU.
- Implement RSA backend by net
Hi, Michael
QEMU side was reviewed by Gonglei a week ago. To avoid this to be
ignored, PING!
On 5/31/22 20:08, Gonglei (Arei) wrote:
-Original Message-
From: zhenwei pi [mailto:pizhen...@bytedance.com]
Sent: Tuesday, May 31, 2022 9:48 AM
To: Gonglei (Arei)
Cc: qemu-de
On 6/1/22 15:59, David Hildenbrand wrote:
On 01.06.22 04:17, zhenwei pi wrote:
On 5/31/22 12:08, Jue Wang wrote:
On Mon, May 30, 2022 at 8:49 AM Peter Xu wrote:
On Mon, May 30, 2022 at 07:33:35PM +0800, zhenwei pi wrote:
A VM uses RAM of 2M huge page. Once a MCE(@HVAy in [HVAx,HVAz
On 5/31/22 12:08, Jue Wang wrote:
On Mon, May 30, 2022 at 8:49 AM Peter Xu wrote:
On Mon, May 30, 2022 at 07:33:35PM +0800, zhenwei pi wrote:
A VM uses RAM of 2M huge page. Once a MCE(@HVAy in [HVAx,HVAz)) occurs, the
2M([HVAx,HVAz)) of hypervisor becomes unaccessible, but the guest poisons
On 5/31/22 20:08, Gonglei (Arei) wrote:
-Original Message-
From: zhenwei pi [mailto:pizhen...@bytedance.com]
Sent: Tuesday, May 31, 2022 9:48 AM
To: Gonglei (Arei)
Cc: qemu-de...@nongnu.org; m...@redhat.com;
virtualization@lists.linux-foundation.org; helei.si...@bytedance.com;
berra
On 5/30/22 21:31, Gonglei (Arei) wrote:
-Original Message-
From: zhenwei pi [mailto:pizhen...@bytedance.com]
Sent: Friday, May 27, 2022 4:48 PM
To: m...@redhat.com; Gonglei (Arei)
Cc: qemu-de...@nongnu.org; virtualization@lists.linux-foundation.org;
helei.si...@bytedance.com; berra
he notifier and might end
up leaking memory here that we allocated?
+ unregister_memory_failure_notifier(>memory_failure_nb);
+ cancel_work_sync(>unpoison_memory_work);
+ }
+
Could we be leaking memory from the virtballoon_remove() path?
Yes, I'll fix the possible memor
On 5/30/22 15:41, David Hildenbrand wrote:
On 27.05.22 08:32, zhenwei pi wrote:
On 5/27/22 02:37, Peter Xu wrote:
On Wed, May 25, 2022 at 01:16:34PM -0700, Jue Wang wrote:
The hypervisor _must_ emulate poisons identified in guest physical
address space (could be transported from the source
On 5/30/22 13:02, HORIGUCHI NAOYA(堀口 直也) wrote:
On Fri, May 20, 2022 at 03:06:47PM +0800, zhenwei pi wrote:
Origianlly, unpoison_memory() is only used by hwpoison-inject, and
unpoisons a page which is poisoned by hwpoison-inject too. The kernel PTE
entry has no change during software poison
a enc=pkcs1 >/tmp/enc.pub
echo "Dec with priv key..."
keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec
cmp /tmp/data /tmp/dec
echo "Verify with pub key..."
keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1
Signed-off-by
r into QEMU.
- Implement RSA backend by nettle/hogweed.
Zhenwei Pi (1):
crypto: Introduce RSA algorithm
backends/cryptodev-builtin.c | 274 +
backends/cryptodev-vhost-user.c | 34 +++-
backends/cryptodev.c | 32 ++-
hw/virtio/virtio-crypto.c |
relationship between UE and CE.
So from the point of my view, to fix the corrupted page for VM seems
good enough. And yes, unpoisoning several pages does not help
significantly, but it is still a chance to make the virtualization better.
--
zhenwei pi
Hi, Andrew & Naoya
I would appreciate it if you could give me any hint about the changes of
memory/memory-failure!
On 5/20/22 15:06, zhenwei pi wrote:
Hi,
I'm trying to recover hardware corrupted page by virtio balloon, the
workflow of this feature like this:
Guest 5.MF
On 5/27/22 03:18, Michael S. Tsirkin wrote:
On Fri, May 20, 2022 at 03:06:48PM +0800, zhenwei pi wrote:
Introduce a new queue 'recover VQ', this allows guest to recover
hardware corrupted page:
Guest 5.MF -> 6.RVQ FE10.Unpoison p
RSA algorithm by gcrypt
test/crypto: Add test suite for crypto akcipher
tests/crypto: Add test suite for RSA keys
Zhenwei Pi (3):
virtio-crypto: header update
crypto: Introduce akcipher crypto class
crypto: Introduce RSA algorithm
backends/cryptodev-builtin.c | 2
On 5/25/22 03:35, Sean Christopherson wrote:
On Fri, May 20, 2022, zhenwei pi wrote:
@@ -59,6 +60,12 @@ enum virtio_balloon_config_read {
VIRTIO_BALLOON_CONFIG_READ_CMD_ID = 0,
};
+/* the request body to commucate with host side */
+struct __virtio_balloon_recover
%u, session_id:
0x%llx\n",
ctrl_status->status, destroy_session->session_id);
- return -EINVAL;
+ err = -EINVAL;
+ goto out;
}
err = 0;
This looks good to me, thanks!
Acked-by:
ion fault at
7f5be2e5a010
The 'HardwareCorrupted' in /proc/meminfo also shows 0 kB.
Signed-off-by: zhenwei pi
---
drivers/virtio/virtio_balloon.c | 243
include/uapi/linux/virtio_balloon.h | 16 ++
2 files changed, 259 insertions(+)
diff --git a/drivers/vir
add 'bool reset_kpte' to get a change
to fix the PTE entry if the page is fixed by hypervisor.
Signed-off-by: zhenwei pi
---
include/linux/mm.h | 2 +-
mm/hwpoison-inject.c | 2 +-
mm/memory-failure.c | 26 +++---
3 files changed, 21 insertions(+), 9 deletions(-)
diff
Introduce memory failure notifier, once hardware memory failure
occurs, after the kernel handles the corrupted page successfully,
someone who registered this chain gets noticed of the corrupted PFN.
Signed-off-by: zhenwei pi
---
include/linux/mm.h | 2 ++
mm/memory-failure.c | 33
red,
once the guest gets the 'corrupted_pages' with 0, then the guest could
unpoison all the poisoned pages which are recorded in the balloon driver.
zhenwei pi (3):
memory-failure: Introduce memory failure notifier
mm/memory-failure.c: support reset PTE during unpoison
virtio_ball
a enc=pkcs1 >/tmp/enc.pub
echo "Dec with priv key..."
keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec
cmp /tmp/data /tmp/dec
echo "Verify with pub key..."
keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1
Signed-off-by
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
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
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
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
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
-by: zhenwei pi
Reviewed-by: Daniel P. Berrangé
---
crypto/akcipher.c | 102
crypto/akcipherpriv.h | 55 +
crypto/meson.build| 1 +
include/crypto/akcipher.h | 158 ++
4 files changed, 316 insertions(+)
create
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
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
backend by nettle/hogweed.
Lei He (6):
qapi: crypto-akcipher: Introduce akcipher types to qapi
crypto: add ASN.1 DER decoder
crypto: Implement RSA algorithm by hogweed
crypto: Implement RSA algorithm by gcrypt
test/crypto: Add test suite for crypto akcipher
tests/crypto: Add test suite f
suite for crypto akcipher
Fixed the issues you pointed out.
Do you have suggestions about the other patches? Or I'll send the v6 series?
On 5/12/22 17:55, Daniel P. Berrangé wrote:
On Thu, Apr 28, 2022 at 09:59:35PM +0800, zhenwei pi wrote:
Update header from linux, support akcipher service
Hi, Michael
I would appreciate it if you could review this series!
On 5/6/22 21:16, zhenwei pi wrote:
v5 -> v6:
- Minor fix for crypto_engine_alloc_init_and_set().
- All the patches have been reviewed by Gonglei, add this in patch.
Thanks to Gonglei.
v4 -> v5:
- Fix poten
Hi, Lei
I would appreciate it if you could review this patch!
On 4/28/22 21:59, zhenwei pi wrote:
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
On 5/7/22 16:20, Naoya Horiguchi wrote:
On Sat, May 07, 2022 at 08:28:05AM +0800, zhenwei pi wrote:
On 5/7/22 00:28, David Hildenbrand wrote:
On 06.05.22 15:38, zhenwei pi wrote:
On 5/6/22 16:59, Naoya Horiguchi wrote:
On Fri, Apr 29, 2022 at 10:22:05PM +0800, zhenwei pi wrote
On 5/7/22 00:28, David Hildenbrand wrote:
On 06.05.22 15:38, zhenwei pi wrote:
On 5/6/22 16:59, Naoya Horiguchi wrote:
On Fri, Apr 29, 2022 at 10:22:05PM +0800, zhenwei pi wrote:
In the memory failure procedure, hwpoison_filter has higher priority,
if memory_filter() filters the error
On 5/6/22 16:59, Naoya Horiguchi wrote:
On Fri, Apr 29, 2022 at 10:22:05PM +0800, zhenwei pi wrote:
In the memory failure procedure, hwpoison_filter has higher priority,
if memory_filter() filters the error event, there is no need to do
the further work.
Could you clarify what problem you
arpenter
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Reviewed-by: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 57 ---
drivers/crypto/virtio/virtio_crypto_common.h | 17 --
.../virtio/virtio_crypto_skcipher_algs.c
lei
Signed-off-by: lei he
Signed-off-by: zhenwei pi
---
drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
in
wait wait
Test this patch, the guest side get ~200K/s operations with 300% CPU
utilization.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Reviewed-by: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 29 ++-
drivers/cry
From: lei he
Enable retry for virtio-crypto-dev, so that crypto-engine
can process cipher-requests parallelly.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Reviewed-by: Gonglei
Signed-off-by: lei he
Signed-off-by: zhenwei pi
---
drivers/crypto/virtio/virtio_crypto_core.c | 3 ++-
1
The new style shows more obviously:
- the variable we want to operate.
- an assignment statement in a single line.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Reviewed-by: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 40 ++-
.../virtio/vir
n crypto engine to improve performance for data queue,
this allows the larger depth instead of 1.
- Fix dst data length in akcipher service.
- Other style fix.
lei he (2):
virtio-crypto: adjust dst_len at ops callback
virtio-crypto: enable retry for virtio-crypto-dev
zhenwei pi (3):
virtio-cryp
On 5/6/22 17:34, Gonglei (Arei) wrote:
-Original Message-
From: zhenwei pi [mailto:pizhen...@bytedance.com]
Sent: Thursday, May 5, 2022 5:24 PM
To: Gonglei (Arei) ; m...@redhat.com
Cc: jasow...@redhat.com; herb...@gondor.apana.org.au;
linux-ker...@vger.kernel.org; virtualization
On 5/5/22 12:57, Michael S. Tsirkin wrote:
On Thu, May 05, 2022 at 03:14:40AM +, Gonglei (Arei) wrote:
-Original Message-
From: zhenwei pi [mailto:pizhen...@bytedance.com]
Sent: Thursday, May 5, 2022 10:35 AM
To: Gonglei (Arei) ; m...@redhat.com;
jasow...@redhat.com
Cc: herb
From: lei he
Enable retry for virtio-crypto-dev, so that crypto-engine
can process cipher-requests parallelly.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: lei he
Signed-off-by: zhenwei pi
---
drivers/crypto/virtio/virtio_crypto_core.c | 3 ++-
1 file changed, 2
he
Signed-off-by: zhenwei pi
---
drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
index 382ccec9ab12..2a60d0525
wait wait
Test this patch, the guest side get ~200K/s operations with 300% CPU
utilization.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 29 ++-
drivers/crypto/virtio/virtio_crypto_comm
arpenter
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 57 ---
drivers/crypto/virtio/virtio_crypto_common.h | 17 --
.../virtio/virtio_crypto_skcipher_algs.c | 50 ++--
The new style shows more obviously:
- the variable we want to operate.
- an assignment statement in a single line.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 40 ++-
.../virtio/virtio_crypto_skcipher_alg
.
lei he (2):
virtio-crypto: adjust dst_len at ops callback
virtio-crypto: enable retry for virtio-crypto-dev
zhenwei pi (3):
virtio-crypto: change code style
virtio-crypto: use private buffer for control request
virtio-crypto: wait ctrl queue instead of busy polling
that this driver is not used widely. So I'd like to rework a lot,
it would be best to complete this work in 5.18 window.
This gets different point with Jason. I would appreciate it if you could
give me any hint.
On 4/24/22 18:41, zhenwei pi wrote:
Hi, Lei
I'd like to move helper and callback functions(Eg
a enc=pkcs1 >/tmp/enc.pub
echo "Dec with priv key..."
keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec
cmp /tmp/data /tmp/dec
echo "Verify with pub key..."
keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1
Signed-off-by
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 | 4 +
tests/bench/test_akcipher_keys.inc
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 +-
1 file changed, 282 insertions(+), 3 deletions(-)
diff --git
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 | 520 +++
crypto/akcipher.c| 4
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
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 | 190 +++
crypto/der.h | 82 ++
crypto/meson.build | 1 +
tests/unit
-by: zhenwei pi
---
crypto/akcipher.c | 102
crypto/akcipherpriv.h | 55 +
crypto/meson.build| 1 +
include/crypto/akcipher.h | 158 ++
4 files changed, 316 insertions(+)
create mode 100644 crypto/akcipher.c
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
Update header from linux, support akcipher service.
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/include/standard-headers/linux
SA algorithm by gcrypt
test/crypto: Add test suite for crypto akcipher
tests/crypto: Add test suite for RSA keys
Zhenwei Pi (3):
virtio-crypto: header update
crypto: Introduce akcipher crypto class
crypto: Introduce RSA algorithm
backends/cryptodev-builtin.c | 272 -
On 4/26/22 14:12, Jason Wang wrote:
On Sun, Apr 24, 2022 at 6:45 PM zhenwei pi wrote:
Use temporary variable to make code easy to read and maintain.
/* Pad cipher's parameters */
vcrypto->ctrl.u.sym_create_session.op_type =
cpu_to_l
On 4/24/22 14:21, Jason Wang wrote:
On Fri, Apr 22, 2022 at 5:12 PM zhenwei pi wrote:
On 4/22/22 15:41, Jason Wang wrote:
在 2022/4/21 18:40, zhenwei pi 写道:
Originally, all of the control requests share a single buffer(
ctrl & input & ctrl_status fields in struct virtio_crypto), thi
From: lei he
Enable retry for virtio-crypto-dev, so that crypto-engine
can process cipher-requests parallelly.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: lei he
Signed-off-by: zhenwei pi
---
drivers/crypto/virtio/virtio_crypto_core.c | 3 ++-
1 file changed, 2
he
Signed-off-by: zhenwei pi
---
drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
index 1e98502830cf..1892901d2
wait wait
Test this patch, the guest side get ~200K/s operations with 300% CPU
utilization.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 29 ++-
drivers/crypto/virtio/virtio_crypto_comm
sending to host to avoid to divulge any information.
* Ex, virtio_crypto_ctrl_request::ctrl::u::destroy_session::padding[48]
*/
So use kzalloc to allocate buffer of struct virtio_crypto_ctrl_request.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: zhenwei pi
---
..
The new style shows more obviously:
- the variable we want to operate.
- an assignment statement in a single line.
Cc: Michael S. Tsirkin
Cc: Jason Wang
Cc: Gonglei
Signed-off-by: zhenwei pi
---
.../virtio/virtio_crypto_akcipher_algs.c | 40 ++-
.../virtio/virtio_crypto_skcipher_alg
ble retry for virtio-crypto-dev
zhenwei pi (3):
virtio-crypto: change code style
virtio-crypto: use private buffer for control request
virtio-crypto: wait ctrl queue instead of busy polling
.../virtio/virtio_crypto_akcipher_algs.c | 83 ++-
drivers/crypto/virtio/virtio_crypto_common
On 4/22/22 15:41, Jason Wang wrote:
在 2022/4/21 18:40, zhenwei pi 写道:
Originally, all of the control requests share a single buffer(
ctrl & input & ctrl_status fields in struct virtio_crypto), this
allows queue depth 1 only, the performance of control queue gets
limited by thi
On 4/22/22 15:46, Jason Wang wrote:
在 2022/4/21 18:40, zhenwei pi 写道:
Originally, after submitting request into virtio crypto control
queue, the guest side polls the result from the virt queue. This
works like following:
CPU0 CPU1 ... CPUx CPUy
1 - 100 of 169 matches
Mail list logo