Re: [PATCH] virtio: use virtio_device_ready() in virtio_device_restore()

2022-03-23 Thread Jason Wang
On Wed, Mar 23, 2022 at 4:04 PM Stefano Garzarella wrote: > > On Wed, Mar 23, 2022 at 11:10:27AM +0800, Jason Wang wrote: > >On Tue, Mar 22, 2022 at 10:07 PM Michael S. Tsirkin wrote: > >> > >> On Tue, Mar 22, 2022 at 12:43:13PM +0100, Stefano Garzarella wrote: > >> > After waking up a suspended

[PATCH net v2 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Stefano Garzarella
The first patch fixes a virtio-spec violation. The other two patches complete the driver configuration before using the VQs in the probe. The patch order should simplify backporting in stable branches. v2: - patch 1 is not changed from v1 - added 2 patches to complete the driver configuration

[PATCH net v2 1/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefano Garzarella
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio-vsock driver uses VQs in the probe function to fill rx and event VQs with new buffers. Let's fix this, calling virtio_device_ready() before using VQs in the probe function.

[PATCH net v2 2/3] vsock/virtio: initialize vdev->priv before using VQs

2022-03-23 Thread Stefano Garzarella
When we fill VQs with empty buffers and kick the host, it may send an interrupt. `vdev->priv` must be initialized before this since it is used in the virtqueue callback. Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") Suggested-by: Michael S. Tsirkin

[PATCH net v2 3/3] vsock/virtio: read the negotiated features before using VQs

2022-03-23 Thread Stefano Garzarella
Complete the driver configuration, reading the negotiated features, before using the VQs and tell the device that the driver is ready in the virtio_vsock_probe(). Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin Signed-off-by: Stefano

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
Am 22.03.22 um 10:34 schrieb Cong Liu: qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as DEVICE_nGnRE, it can not support unaligned access. Well that some ARM boards doesn't allow unaligned access to MMIO space is a well known bug of those ARM

Re: Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread zhenwei pi
On 3/23/22 13:17, Eric Biggers wrote: On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: v2 -> v3: - Introduce akcipher types to qapi - Add test/benchmark suite for akcipher class - Seperate 'virtio_crypto: Support virtio crypto asym operation' into: - crypto: Introduce akcipher

Re: [PATCH v2] virtio: pci: sanity check bar indexes

2022-03-23 Thread Jason Wang
On Tue, Mar 22, 2022 at 11:20 PM Keir Fraser wrote: > > The bar index is used as an index into the device's resource list > and should be checked as within range for a standard bar. > > Also clean up an existing check to consistently use PCI_STD_NUM_BARS. > > Signed-off-by: Keir Fraser > --- >

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Robin Murphy
On 2022-03-23 07:15, Christian König wrote: Am 22.03.22 um 10:34 schrieb Cong Liu: qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as DEVICE_nGnRE, it can not support unaligned access. Well that some ARM boards doesn't allow unaligned access to

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Gerd Hoffmann
On Wed, Mar 23, 2022 at 09:45:13AM +, Robin Murphy wrote: > On 2022-03-23 07:15, Christian König wrote: > > Am 22.03.22 um 10:34 schrieb Cong Liu: > > > qxl use ioremap to map ram_header and rom, in the arm64 implementation, > > > the device is mapped as DEVICE_nGnRE, it can not support

Re: [PATCH] virtio: use virtio_device_ready() in virtio_device_restore()

2022-03-23 Thread Stefano Garzarella
On Wed, Mar 23, 2022 at 11:10:27AM +0800, Jason Wang wrote: On Tue, Mar 22, 2022 at 10:07 PM Michael S. Tsirkin wrote: On Tue, Mar 22, 2022 at 12:43:13PM +0100, Stefano Garzarella wrote: > After waking up a suspended VM, the kernel prints the following trace > for virtio drivers which do not

Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
Hi Cong, well than Dave must decide what to do here. When QXL emulates a device it should also not use memory accesses which won't work on a physical device. BTW: Your patch is really buggy, it misses the cases in ttm_module.c Regards, Christian. Am 23.03.22 um 09:48 schrieb

Re: [PATCH v2] virtio: pci: sanity check bar indexes

2022-03-23 Thread Jason Wang
On Wed, Mar 23, 2022 at 5:13 PM Keir Fraser wrote: > > On Wed, Mar 23, 2022 at 03:57:59PM +0800, Jason Wang wrote: > > On Tue, Mar 22, 2022 at 11:20 PM Keir Fraser wrote: > > > > > > The bar index is used as an index into the device's resource list > > > and should be checked as within range for

Re: [PATCH 2/2] Revert "virtio_pci: harden MSI-X interrupts"

2022-03-23 Thread Jason Wang
On Wed, Mar 23, 2022 at 5:05 PM Marc Zyngier wrote: > > On Wed, 23 Mar 2022 03:15:24 +, > Jason Wang wrote: > > > > This reverts commit 9e35276a5344f74d4a3600fc4100b3dd251d5c56. Issue > > were reported for the drivers that are using affinity managed IRQ > > where manually toggling IRQ status

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
Am 23.03.22 um 10:45 schrieb Robin Murphy: On 2022-03-23 07:15, Christian König wrote: Am 22.03.22 um 10:34 schrieb Cong Liu: qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as DEVICE_nGnRE, it can not support unaligned access. Well that some ARM

Re: [PATCH v2] virtio: pci: sanity check bar indexes

2022-03-23 Thread Michael S. Tsirkin
On Wed, Mar 23, 2022 at 03:57:59PM +0800, Jason Wang wrote: > On Tue, Mar 22, 2022 at 11:20 PM Keir Fraser wrote: > > > > The bar index is used as an index into the device's resource list > > and should be checked as within range for a standard bar. > > > > Also clean up an existing check to

Re: [PATCH v3 3/6] crypto: Introduce akcipher crypto class

2022-03-23 Thread Daniel P . Berrangé
On Wed, Mar 23, 2022 at 10:49:09AM +0800, zhenwei pi wrote: > Support basic asymmetric operations: encrypt, decrypt, sign and > verify. > > Co-developed-by: lei he > Signed-off-by: lei he > Signed-off-by: zhenwei pi > --- > crypto/akcipher.c | 78 + >

Re: 回复: Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
Hi Cong, yes I've seen that, but that is still not sufficient. You need to update the check in ttm_module.c as well or otherwise your userspace mapping might not work correctly either. Regards, Christian. Am 23.03.22 um 11:00 schrieb liuco...@kylinos.cn: Hi Christian, another commit fix

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Robin Murphy
On 2022-03-23 10:11, Gerd Hoffmann wrote: On Wed, Mar 23, 2022 at 09:45:13AM +, Robin Murphy wrote: On 2022-03-23 07:15, Christian K�nig wrote: Am 22.03.22 um 10:34 schrieb Cong Liu: qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as

Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread Michael S. Tsirkin
On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: > v2 -> v3: > - Introduce akcipher types to qapi > - Add test/benchmark suite for akcipher class > - Seperate 'virtio_crypto: Support virtio crypto asym operation' into: > - crypto: Introduce akcipher crypto class > - virtio-crypto:

Re: [PATCH v3 2/6] crypto-akcipher: Introduce akcipher types to qapi

2022-03-23 Thread Daniel P . Berrangé
On Wed, Mar 23, 2022 at 10:49:08AM +0800, zhenwei pi wrote: > From: Lei He > > Introduce akcipher types, also include RSA & ECDSA related types. > > Signed-off-by: Lei He > Signed-off-by: zhenwei pi > --- > qapi/crypto.json | 86 > 1 file

Re: [PATCH v2] virtio: pci: sanity check bar indexes

2022-03-23 Thread Michael S. Tsirkin
On Wed, Mar 23, 2022 at 01:21:55PM +, Keir Fraser wrote: > On Wed, Mar 23, 2022 at 08:01:42AM -0400, Michael S. Tsirkin wrote: > > On Wed, Mar 23, 2022 at 03:57:59PM +0800, Jason Wang wrote: > > > On Tue, Mar 22, 2022 at 11:20 PM Keir Fraser wrote: > > > > > > > > The bar index is used as an

Re: [PATCH net v2 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Michael S. Tsirkin
On Wed, Mar 23, 2022 at 09:49:51AM +0100, Stefano Garzarella wrote: > The first patch fixes a virtio-spec violation. The other two patches > complete the driver configuration before using the VQs in the probe. > > The patch order should simplify backporting in stable branches. Ok but I think the

Re: [PATCH net v2 2/3] vsock/virtio: initialize vdev->priv before using VQs

2022-03-23 Thread Stefan Hajnoczi
On Wed, Mar 23, 2022 at 09:49:53AM +0100, Stefano Garzarella wrote: > When we fill VQs with empty buffers and kick the host, it may send > an interrupt. `vdev->priv` must be initialized before this since it > is used in the virtqueue callback. > > Fixes: 0deab087b16a ("vsock/virtio: use RCU to

Re: [PATCH v3 1/6] virtio-crypto: header update

2022-03-23 Thread Daniel P . Berrangé
On Wed, Mar 23, 2022 at 10:49:07AM +0800, zhenwei pi wrote: > Update header from linux, support akcipher service. I'm assuming this is updated for *non-merged* Linux headers, since I don't see these changes present in current linux.git > > Reviewed-by: Gonglei > Signed-off-by: lei he >

Re: [PATCH net v2 1/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefano Garzarella
On Wed, Mar 23, 2022 at 01:44:42PM +, Stefan Hajnoczi wrote: On Wed, Mar 23, 2022 at 09:49:52AM +0100, Stefano Garzarella wrote: virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio-vsock driver uses VQs in the probe

Re: Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread zhenwei pi
On 3/23/22 20:36, Michael S. Tsirkin wrote: On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: v2 -> v3: - Introduce akcipher types to qapi - Add test/benchmark suite for akcipher class - Seperate 'virtio_crypto: Support virtio crypto asym operation' into: - crypto: Introduce

Re: [PATCH v3 2/6] crypto-akcipher: Introduce akcipher types to qapi

2022-03-23 Thread Daniel P . Berrangé
On Wed, Mar 23, 2022 at 10:49:08AM +0800, zhenwei pi wrote: > From: Lei He > > Introduce akcipher types, also include RSA & ECDSA related types. > > Signed-off-by: Lei He > Signed-off-by: zhenwei pi > --- > qapi/crypto.json | 86 > 1 file

Re: [PATCH v3 5/6] tests/crypto: Add test suite for crypto akcipher

2022-03-23 Thread Daniel P . Berrangé
On Wed, Mar 23, 2022 at 10:49:11AM +0800, zhenwei pi wrote: > From: Lei He > > Add unit test and benchmark test for crypto akcipher. > > Signed-off-by: lei he > Signed-off-by: zhenwei pi > --- > tests/bench/benchmark-crypto-akcipher.c | 163 ++ > tests/bench/meson.build |

Re: [PATCH net v2 1/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefan Hajnoczi
On Wed, Mar 23, 2022 at 09:49:52AM +0100, Stefano Garzarella wrote: > virtio spec requires drivers to set DRIVER_OK before using VQs. > This is set automatically after probe returns, but virtio-vsock > driver uses VQs in the probe function to fill rx and event VQs > with new buffers. > > Let's

Re: [PATCH v3 4/6] crypto: Implement RSA algorithm by hogweed

2022-03-23 Thread Daniel P . Berrangé
On Wed, Mar 23, 2022 at 10:49:10AM +0800, zhenwei pi wrote: > From: Lei He > > Introduce ASN.1 decoder, and 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 &

Re: [PATCH net v2 3/3] vsock/virtio: read the negotiated features before using VQs

2022-03-23 Thread Stefan Hajnoczi
On Wed, Mar 23, 2022 at 09:49:54AM +0100, Stefano Garzarella wrote: > Complete the driver configuration, reading the negotiated features, > before using the VQs and tell the device that the driver is ready in > the virtio_vsock_probe(). > > Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for

Re: Re: [PATCH v3 1/6] virtio-crypto: header update

2022-03-23 Thread zhenwei pi
On 3/23/22 23:38, Daniel P. Berrangé wrote: On Wed, Mar 23, 2022 at 10:49:07AM +0800, zhenwei pi wrote: Update header from linux, support akcipher service. I'm assuming this is updated for *non-merged* Linux headers, since I don't see these changes present in current linux.git Hi, The

Re: [PATCH net v2 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Stefano Garzarella
On Wed, Mar 23, 2022 at 09:22:02AM -0400, Michael S. Tsirkin wrote: On Wed, Mar 23, 2022 at 09:49:51AM +0100, Stefano Garzarella wrote: The first patch fixes a virtio-spec violation. The other two patches complete the driver configuration before using the VQs in the probe. The patch order

[PATCH net v3 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Stefano Garzarella
The first patch fixes a virtio-spec violation. The other two patches complete the driver configuration before using the VQs in the probe. The patch order should simplify backporting in stable branches. v3: - re-ordered the patch to improve bisectability [MST] v2:

[PATCH net v3 2/3] vsock/virtio: read the negotiated features before using VQs

2022-03-23 Thread Stefano Garzarella
Complete the driver configuration, reading the negotiated features, before using the VQs in the virtio_vsock_probe(). Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella ---

[PATCH net v3 1/3] vsock/virtio: initialize vdev->priv before using VQs

2022-03-23 Thread Stefano Garzarella
When we fill VQs with empty buffers and kick the host, it may send an interrupt. `vdev->priv` must be initialized before this since it is used in the virtqueue callbacks. Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") Suggested-by: Michael S. Tsirkin

[PATCH net v3 3/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefano Garzarella
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio-vsock driver uses VQs in the probe function to fill rx and event VQs with new buffers. Let's fix this, calling virtio_device_ready() before using VQs in the probe function.

Re: [PATCH 1/2] vdpa: mlx5: prevent cvq work from hogging CPU

2022-03-23 Thread Jason Wang
On Thu, Mar 24, 2022 at 8:54 AM Hillf Danton wrote: > > On Tue, 22 Mar 2022 09:59:14 +0800 Jason Wang wrote: > > > > Yes, there will be no "infinite" loop, but since the loop is triggered > > by userspace. It looks to me it will delay the flush/drain of the > > workqueue forever which is still

Re: [PATCH 1/2] vdpa: mlx5: prevent cvq work from hogging CPU

2022-03-23 Thread Hillf Danton
On Tue, 22 Mar 2022 09:59:14 +0800 Jason Wang wrote: > > Yes, there will be no "infinite" loop, but since the loop is triggered > by userspace. It looks to me it will delay the flush/drain of the > workqueue forever which is still suboptimal. Usually it is barely possible to shoot two birds

Re: Re: Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread zhenwei pi
On 3/24/22 02:03, Eric Biggers wrote: On Wed, Mar 23, 2022 at 03:32:37PM +0800, zhenwei pi wrote: On 3/23/22 13:17, Eric Biggers wrote: On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: v2 -> v3: - Introduce akcipher types to qapi - Add test/benchmark suite for akcipher class -

Re: [PATCH net v3 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Michael S. Tsirkin
On Wed, Mar 23, 2022 at 06:36:22PM +0100, Stefano Garzarella wrote: > The first patch fixes a virtio-spec violation. The other two patches > complete the driver configuration before using the VQs in the probe. > > The patch order should simplify backporting in stable branches. Series: