Re: [PATCH v3] vdpa/vp_vdpa : add vdpa tool support in vp_vdpa

2022-04-28 Thread Jason Wang
在 2022/4/28 15:37, Cindy Lu 写道: this patch is to add the support for vdpa tool in vp_vdpa here is the example steps modprobe vp_vdpa modprobe vhost_vdpa echo :00:06.0>/sys/bus/pci/drivers/virtio-pci/unbind echo 1af4 1041 > /sys/bus/pci/drivers/vp-vdpa/new_id vdpa dev add name vdpa1 mgmtdev

Re: [PATCH] vdpa_sim_blk: add support for VIRTIO_BLK_T_FLUSH

2022-04-28 Thread Jason Wang
On Thu, Apr 28, 2022 at 11:13 PM Stefano Garzarella wrote: > > The simulator behaves like a ramdisk, so we don't have to do > anything when a VIRTIO_BLK_T_FLUSH request is received, but it > could be useful to test driver behavior. > > Let's expose the VIRTIO_BLK_F_FLUSH feature to inform the driv

Re: [PATCH V3 3/9] virtio: introduce config op to synchronize vring callbacks

2022-04-28 Thread Jason Wang
On Thu, Apr 28, 2022 at 5:13 PM Cornelia Huck wrote: > > On Mon, Apr 25 2022, Jason Wang wrote: > > > This patch introduces new virtio config op to vring > > callbacks. Transport specific method is required to make sure the > > write before this function is visible to the vring_interrupt() that i

Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs()

2022-04-28 Thread Jason Wang
On Thu, Apr 28, 2022 at 3:42 PM Cornelia Huck wrote: > > On Thu, Apr 28 2022, Jason Wang wrote: > > > On Thu, Apr 28, 2022 at 1:55 PM Michael S. Tsirkin wrote: > >> > >> On Thu, Apr 28, 2022 at 01:51:59PM +0800, Jason Wang wrote: > >> > On Thu, Apr 28, 2022 at 1:24 PM Michael S. Tsirkin > >> >

[PATCH] vdpa_sim_blk: add support for VIRTIO_BLK_T_FLUSH

2022-04-28 Thread Stefano Garzarella
The simulator behaves like a ramdisk, so we don't have to do anything when a VIRTIO_BLK_T_FLUSH request is received, but it could be useful to test driver behavior. Let's expose the VIRTIO_BLK_F_FLUSH feature to inform the driver that we support the flush command. Signed-off-by: Stefano Garzarell

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

2022-04-28 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 v5 7/9] test/crypto: Add test suite for crypto akcipher

2022-04-28 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 | 4 + tests/bench/test_akcipher_keys.inc

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

2022-04-28 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: lei he --- tests/unit/test-crypto-akcipher.c | 285 +- 1 file changed, 282 insertions(+), 3 deletions(-) diff --git a/tests/unit/

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

2022-04-28 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: lei he --- crypto/akcipher-gcrypt.c.inc | 520 +++ crypto/akcipher.c| 4

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

2022-04-28 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 v5 4/9] crypto: add ASN.1 DER decoder

2022-04-28 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 | 190 +++ crypto/der.h | 82 ++ crypto/meson.build | 1 + tests/unit/m

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

2022-04-28 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 v5 2/9] qapi: crypto-akcipher: Introduce akcipher types to qapi

2022-04-28 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 v5 1/9] virtio-crypto: header update

2022-04-28 Thread zhenwei pi
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/virt

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

2022-04-28 Thread zhenwei pi
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 akcipher requests from guest and uses the new akcipher service. The new feat

[PATCH net-next 2/2] vsock/virtio: add support for device suspend/resume

2022-04-28 Thread Stefano Garzarella
Implement .freeze and .restore callbacks of struct virtio_driver to support device suspend/resume. During suspension all connected sockets are reset and VQs deleted. During resume the VQs are re-initialized. Reported by: Vilas R K Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_tran

[PATCH net-next 1/2] vsock/virtio: factor our the code to initialize and delete VQs

2022-04-28 Thread Stefano Garzarella
Add virtio_vsock_vqs_init() and virtio_vsock_vqs_del() with the code that was in virtio_vsock_probe() and virtio_vsock_remove to initialize and delete VQs. These new functions will be used in the next commit to support device suspend/resume Signed-off-by: Stefano Garzarella --- net/vmw_vsock/vi

[PATCH net-next 0/2] vsock/virtio: add support for device suspend/resume

2022-04-28 Thread Stefano Garzarella
Vilas reported that virtio-vsock no longer worked properly after suspend/resume (echo mem >/sys/power/state). It was impossible to connect to the host and vice versa. Indeed, the support has never been implemented. This series implement .freeze and .restore callbacks of struct virtio_driver to su

Re: [PATCH v5 15/17] drm/shmem-helper: Make drm_gem_shmem_get_pages() private

2022-04-28 Thread Daniel Vetter
On Sun, Apr 24, 2022 at 10:04:22PM +0300, Dmitry Osipenko wrote: > VirtIO-GPU driver was the only user of drm_gem_shmem_get_pages() > and it now uses drm_gem_shmem_get_pages_sgt(). Make the get_pages() > private to drm_gem_shmem_helper. > > Signed-off-by: Dmitry Osipenko > --- > drivers/gpu/drm/

Re: [PATCH] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-04-28 Thread Christophe Marie Francois Dupont de Dinechin
[Resend, still struggling with new laptop email settings] > On 28 Apr 2022, at 13:03, Michael S. Tsirkin wrote: > > On Thu, Apr 28, 2022 at 11:55:31AM +0200, Christophe Marie Francois Dupont de > Dinechin wrote: >> >> >>> On 28 Apr 2022, at 11:51, Christophe Marie Francois Dupont de Dinechin

Re: [PATCH] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-04-28 Thread Christophe Marie Francois Dupont de Dinechin
> On 28 Apr 2022, at 13:03, Michael S. Tsirkin wrote: > > On Thu, Apr 28, 2022 at 11:55:31AM +0200, Christophe Marie Francois Dupont de > Dinechin wrote: >> >> >>> On 28 Apr 2022, at 11:51, Christophe Marie Francois Dupont de Dinechin >>> wrote: >>> >>> >>> On 28 Apr 2022, at 11:46

Re: [PATCH 3/3] virtio-pci: Use cpumask_available to fix compilation error

2022-04-28 Thread Michael S. Tsirkin
On Thu, Apr 28, 2022 at 11:48:01AM +0200, Christophe Marie Francois Dupont de Dinechin wrote: > > > > On 15 Apr 2022, at 10:48, Michael S. Tsirkin wrote: > > > > On Thu, Apr 14, 2022 at 05:08:55PM +0200, Christophe de Dinechin wrote: > >> With GCC 12 and defconfig, we get the following error:

Re: [PATCH] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-04-28 Thread Michael S. Tsirkin
On Thu, Apr 28, 2022 at 11:55:31AM +0200, Christophe Marie Francois Dupont de Dinechin wrote: > > > > On 28 Apr 2022, at 11:51, Christophe Marie Francois Dupont de Dinechin > > wrote: > > > > > > > >> On 28 Apr 2022, at 11:46, Christophe Marie Francois Dupont de Dinechin > >> wrote: > >>

Re: [PATCH] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-04-28 Thread Christophe Marie Francois Dupont de Dinechin
> On 28 Apr 2022, at 11:51, Christophe Marie Francois Dupont de Dinechin > wrote: > > > >> On 28 Apr 2022, at 11:46, Christophe Marie Francois Dupont de Dinechin >> wrote: >> >> >> >>> On 15 Apr 2022, at 05:51, Murilo Opsfelder Araújo >>> wrote: >>> >>> On 4/14/22 23:30, Murilo Opsfe

Re: [PATCH] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-04-28 Thread Christophe Marie Francois Dupont de Dinechin
> On 28 Apr 2022, at 11:46, Christophe Marie Francois Dupont de Dinechin > wrote: > > > >> On 15 Apr 2022, at 05:51, Murilo Opsfelder Araújo >> wrote: >> >> On 4/14/22 23:30, Murilo Opsfelder Araujo wrote: >>> GCC 12 enhanced -Waddress when comparing array address to null [0], >>> which w

Re: [PATCH 3/3] virtio-pci: Use cpumask_available to fix compilation error

2022-04-28 Thread Christophe Marie Francois Dupont de Dinechin
> On 15 Apr 2022, at 10:48, Michael S. Tsirkin wrote: > > On Thu, Apr 14, 2022 at 05:08:55PM +0200, Christophe de Dinechin wrote: >> With GCC 12 and defconfig, we get the following error: >> >> | CC drivers/virtio/virtio_pci_common.o >> | drivers/virtio/virtio_pci_common.c: In function

Re: [PATCH] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-04-28 Thread Christophe Marie Francois Dupont de Dinechin
> On 15 Apr 2022, at 05:51, Murilo Opsfelder Araújo > wrote: > > On 4/14/22 23:30, Murilo Opsfelder Araujo wrote: >> GCC 12 enhanced -Waddress when comparing array address to null [0], >> which warns: >> drivers/virtio/virtio_pci_common.c: In function ‘vp_del_vqs’: >> drivers/virtio/vi

Re: [PATCH V3 3/9] virtio: introduce config op to synchronize vring callbacks

2022-04-28 Thread Cornelia Huck
On Mon, Apr 25 2022, Jason Wang wrote: > This patch introduces new virtio config op to vring > callbacks. Transport specific method is required to make sure the > write before this function is visible to the vring_interrupt() that is Which kind of writes? I.e., what is the scope? > called after

Re: [PATCH V3 2/9] virtio: use virtio_reset_device() when possible

2022-04-28 Thread Cornelia Huck
On Mon, Apr 25 2022, Jason Wang wrote: > This allows us to do common extension without duplicating code. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio

Re: [PATCH V3 1/9] virtio: use virtio_device_ready() in virtio_device_restore()

2022-04-28 Thread Cornelia Huck
On Mon, Apr 25 2022, Jason Wang wrote: > From: Stefano Garzarella > > It will allow us to do extension on virtio_device_ready() without > duplicating code. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Signe

Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs()

2022-04-28 Thread Cornelia Huck
On Thu, Apr 28 2022, Jason Wang wrote: > On Thu, Apr 28, 2022 at 1:55 PM Michael S. Tsirkin wrote: >> >> On Thu, Apr 28, 2022 at 01:51:59PM +0800, Jason Wang wrote: >> > On Thu, Apr 28, 2022 at 1:24 PM Michael S. Tsirkin wrote: >> > > >> > > On Thu, Apr 28, 2022 at 11:04:41AM +0800, Jason Wang