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

2022-03-22 Thread Jason Wang
This reverts commit 9e35276a5344f74d4a3600fc4100b3dd251d5c56. Issue were reported for the drivers that are using affinity managed IRQ where manually toggling IRQ status is not expected. And we forget to enable the interrupts in the restore path as well. In the future, we will rework on the

[PATCH 1/2] Revert "virtio-pci: harden INTX interrupts"

2022-03-22 Thread Jason Wang
This reverts commit 080cd7c3ac8701081d143a15ba17dd9475313188. Since the MSI-X interrupts hardening will be reverted in the next patch. We will rework the interrupt hardening in the future. Fixes: 080cd7c3ac87 ("virtio-pci: harden INTX interrupts") Signed-off-by: Jason Wang ---

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

2022-03-22 Thread Jason Wang
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 directly call virtio_device_ready() in > > the .restore:

[PATCH v3 6/6] virtio-crypto: Introduce RSA algorithm

2022-03-22 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 Then virtio-crypto gets request from guest side, and forwards the request to builtin driver to handle it. Test with a guest linux: 1, The self-test

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

2022-03-22 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 --- tests/bench/benchmark-crypto-akcipher.c | 163 ++ tests/bench/meson.build | 6 + tests/bench/test_akcipher_keys.inc | 277 +

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

2022-03-22 Thread zhenwei pi
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 & hardware requirement. Signed-off-by: lei he Signed-off-by: zhenwei pi ---

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

2022-03-22 Thread zhenwei pi
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 + crypto/meson.build| 1 + include/crypto/akcipher.h | 139

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

2022-03-22 Thread zhenwei pi
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 changed, 86 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json index

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

2022-03-22 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

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

2022-03-22 Thread zhenwei pi
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: Introduce RSA algorithm v1 -> v2: - Update virtio_crypto.h from v2

Re: [PATCH v8 2/5] mm: page_isolation: check specified range for unmovable pages

2022-03-22 Thread David Hildenbrand
On 21.03.22 19:23, Zi Yan wrote: > On 21 Mar 2022, at 13:30, David Hildenbrand wrote: > >> On 17.03.22 16:37, Zi Yan wrote: >>> From: Zi Yan >>> >>> Enable set_migratetype_isolate() to check specified sub-range for >>> unmovable pages during isolation. Page isolation is done >>> at

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

2022-03-22 Thread Stefano Garzarella
On Tue, Mar 22, 2022 at 10:09:06AM -0400, Michael S. Tsirkin wrote: On Tue, Mar 22, 2022 at 03:05:00PM +0100, Stefano Garzarella wrote: On Tue, Mar 22, 2022 at 09:36:14AM -0400, Michael S. Tsirkin wrote: > On Tue, Mar 22, 2022 at 11:38:23AM +0100, Stefano Garzarella wrote: > > virtio spec

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

2022-03-22 Thread Michael S. Tsirkin
On Tue, Mar 22, 2022 at 03:05:00PM +0100, Stefano Garzarella wrote: > On Tue, Mar 22, 2022 at 09:36:14AM -0400, Michael S. Tsirkin wrote: > > On Tue, Mar 22, 2022 at 11:38:23AM +0100, Stefano Garzarella wrote: > > > virtio spec requires drivers to set DRIVER_OK before using VQs. > > > This is set

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

2022-03-22 Thread Michael S. Tsirkin
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 directly call virtio_device_ready() in > the .restore: > > PM: suspend exit > irq 22: nobody cared (try booting

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

2022-03-22 Thread Stefano Garzarella
On Tue, Mar 22, 2022 at 09:36:14AM -0400, Michael S. Tsirkin wrote: On Tue, Mar 22, 2022 at 11:38:23AM +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: [PATCH net] vsock/virtio: enable VQs early on probe

2022-03-22 Thread Michael S. Tsirkin
On Tue, Mar 22, 2022 at 11:38:23AM +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. So this is

Re: [PATCH] virtio: pci: Sanity check the bar index in find_shm_cap

2022-03-22 Thread Michael S. Tsirkin
On Tue, Mar 22, 2022 at 09:20:27AM +, Keir Fraser wrote: > On Tue, Mar 22, 2022 at 11:36:23AM +0800, Jason Wang wrote: > > On Mon, Mar 21, 2022 at 11:49 PM Keir Fraser wrote: > > > > > > The bar index is used as an index into the device's resource list > > > and should be checked as within

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

2022-03-22 Thread Stefano Garzarella
After waking up a suspended VM, the kernel prints the following trace for virtio drivers which do not directly call virtio_device_ready() in the .restore: PM: suspend exit irq 22: nobody cared (try booting with the "irqpoll" option) Call Trace: dump_stack_lvl+0x38/0x49

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

2022-03-22 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] drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes

2022-03-22 Thread Liu Zixian via Virtualization
drm_cvt_mode may return NULL and we should check it. This bug is found by syzkaller: FAULT_INJECTION stacktrace: [ 168.567394] FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 [ 168.567403] CPU: 1 PID: 6425 Comm: syz Kdump: loaded Not tainted

Re: [PATCH] dt-bindings: virtio: mmio: add optional virtio,wakeup property

2022-03-22 Thread Krzysztof Kozlowski
On 22/03/2022 07:19, Minghao Xue wrote: > Hi Krzysztof, > > Thanks for your comment. First of all, which "generic wakeup-source > property" do you mean? There is only one generic - wakeup-source. > Could you give an example? I find "wakeup-source" > property in several binding files. Are you

Re: [PATCH v8 00/16] virtio pci support VIRTIO_F_RING_RESET (refactor vring)

2022-03-22 Thread Jason Wang
在 2022/3/14 下午5:34, Xuan Zhuo 写道: The virtio spec already supports the virtio queue reset function. This patch set is to add this function to the kernel. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 Also regarding MMIO support for

Re: [PATCH v8 11/16] virtio_ring: packed: extract the logic of alloc queue

2022-03-22 Thread Jason Wang
在 2022/3/14 下午5:34, Xuan Zhuo 写道: Separate the logic of packed to create vring queue. For the convenience of passing parameters, add a structure vring_packed. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 121

Re: [PATCH v8 07/16] virtio_ring: split: extract the logic of alloc state and extra

2022-03-22 Thread Jason Wang
在 2022/3/14 下午5:34, Xuan Zhuo 写道: Separate the logic of creating desc_state, desc_extra, and subsequent patches will call it independently. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 52 +--- 1 file changed, 37 insertions(+), 15 deletions(-)

Re: [PATCH v8 10/16] virtio_ring: split: implement virtqueue_resize_split()

2022-03-22 Thread Jason Wang
在 2022/3/14 下午5:34, Xuan Zhuo 写道: virtio ring split supports resize. Only after the new vring is successfully allocated based on the new num, we will release the old vring. In any case, an error is returned, indicating that the vring still points to the old vring. In the case of an error, we

Re: [PATCH v8 01/16] virtio: add helper virtqueue_get_vring_max_size()

2022-03-22 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 07:21:18PM +0800, Xuan Zhuo wrote: > On Mon, 14 Mar 2022 07:18:27 -0400, "Michael S. Tsirkin" > wrote: > > On Mon, Mar 14, 2022 at 10:50:08AM +0100, Cornelia Huck wrote: > > > On Mon, Mar 14 2022, Xuan Zhuo wrote: > > > > > > > Record the maximum queue num supported by

Re: [PATCH v8 16/16] virtio_ring: introduce virtqueue_resize()

2022-03-22 Thread Jason Wang
在 2022/3/14 下午5:34, Xuan Zhuo 写道: Introduce virtqueue_resize() to implement the resize of vring. Based on these, the driver can dynamically adjust the size of the vring. For example: ethtool -G. virtqueue_resize() implements resize based on the vq reset function. In case of failure to allocate