[PATCH vhost] virtio_ring: add BUG_ON() when vq is set to premapped mode and vq is not empty

2023-10-19 Thread Xuan Zhuo
Add BUG_ON check to make sure virtqueue_set_dma_premapped() is not misused. This function must be called immediately after creating the vq, or after vq reset, and before adding any buffers to it. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 5 + 1 file changed, 1 insertion(+),

Re: [PATCH net-next v1 13/19] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-10-19 Thread Xuan Zhuo
On Thu, 19 Oct 2023 02:38:16 -0400, "Michael S. Tsirkin" wrote: > On Tue, Oct 17, 2023 at 10:02:05AM +0800, Xuan Zhuo wrote: > > On Mon, 16 Oct 2023 16:44:34 -0700, Jakub Kicinski wrote: > > > On Mon, 16 Oct 2023 20:00:27 +0800 Xuan Zhuo wrote: > > > > @@ -305,9 +311,15 @@ static inline void vir

Re: [PATCH net-next v1 04/19] virtio_net: move to virtio_net.h

2023-10-19 Thread Xuan Zhuo
On Thu, 19 Oct 2023 14:12:55 +0800, Jason Wang wrote: > On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > > > Move some structure definitions and inline functions into the > > virtio_net.h file. > > Some of the functions are not inline one before the moving. I'm not > sure what's the criteria

Re: [PATCH v5 9/9] drm: ci: Update xfails

2023-10-19 Thread Daniel Stone
Hi Vignesh, On Thu, 19 Oct 2023 at 09:07, Vignesh Raman wrote: > +# Some tests crashes with malloc error and IGT tests floods > +# the CI log with error messages and we end up with a warning message > +# Job's log exceeded limit of 4194304 bytes. > +# Job execution will continue but no more outpu

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Jason Wang
On Thu, Oct 19, 2023 at 2:47 PM Si-Wei Liu wrote: > > > > On 10/18/2023 7:53 PM, Jason Wang wrote: > > On Wed, Oct 18, 2023 at 4:49 PM Si-Wei Liu wrote: > >> > >> > >> On 10/18/2023 12:00 AM, Jason Wang wrote: > Unfortunately, it's a must to stick to ABI. I agree it's a mess but we > do

Re: [PATCH net-next v1 13/19] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-10-19 Thread Michael S. Tsirkin
On Thu, Oct 19, 2023 at 03:13:48PM +0800, Xuan Zhuo wrote: > On Thu, 19 Oct 2023 02:38:16 -0400, "Michael S. Tsirkin" > wrote: > > On Tue, Oct 17, 2023 at 10:02:05AM +0800, Xuan Zhuo wrote: > > > On Mon, 16 Oct 2023 16:44:34 -0700, Jakub Kicinski > > > wrote: > > > > On Mon, 16 Oct 2023 20:00:2

Re: [PATCH] vsock: initialize the_virtio_vsock before using VQs

2023-10-19 Thread Stefano Garzarella
On Wed, Oct 18, 2023 at 09:32:47PM +0300, Alexandru Matei wrote: Once VQs are filled with empty buffers and we kick the host, it can send connection requests. If 'the_virtio_vsock' is not initialized before, replies are silently dropped and do not reach the host. Are replies really dropped or w

[PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-19 Thread Juergen Gross via Virtualization
As a preparation for replacing paravirt patching completely by alternative patching, move some backend functions and #defines to alternative code and header. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/alternative.h| 16 arch/x86/i

[PATCH v3 0/5] x86/paravirt: Get rid of paravirt patching

2023-10-19 Thread Juergen Gross via Virtualization
This is a small series getting rid of paravirt patching by switching completely to alternative patching for the same functionality. The basic idea is to add the capability to switch from indirect to direct calls via a special alternative patching option. This removes _some_ of the paravirt macro

[PATCH v3 3/5] x86/paravirt: introduce ALT_NOT_XEN

2023-10-19 Thread Juergen Gross via Virtualization
Introduce the macro ALT_NOT_XEN as a short form of ALT_NOT(X86_FEATURE_XENPV). Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Juergen Gross --- V3: - split off from next patch --- arch/x86/include/asm/paravirt.h | 42 --- arch/x86/include/asm/paravirt_types.h

[PATCH v3 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-19 Thread Juergen Gross via Virtualization
Instead of stacking alternative and paravirt patching, use the new ALT_FLAG_CALL flag to switch those mixed calls to pure alternative handling. This eliminates the need to be careful regarding the sequence of alternative and paravirt patching. For call depth tracking callthunks_setup() needs to b

[PATCH v3 5/5] x86/paravirt: remove no longer needed paravirt patching code

2023-10-19 Thread Juergen Gross via Virtualization
Now that paravirt is using the alternatives patching infrastructure, remove the paravirt patching code. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/paravirt.h | 18 arch/x86/include/asm/paravirt_types.h | 40 arch/x86/in

Re: [RFC v2 PATCH] vdpa_sim: implement .reset_map support

2023-10-19 Thread Stefano Garzarella
On Wed, Oct 18, 2023 at 04:47:48PM -0700, Si-Wei Liu wrote: On 10/18/2023 1:05 AM, Stefano Garzarella wrote: On Tue, Oct 17, 2023 at 10:11:33PM -0700, Si-Wei Liu wrote: RFC only. Not tested on vdpa-sim-blk with user virtual address. Works fine with vdpa-sim-net which uses physical address to

PING: [PATCH] virtio-blk: fix implicit overflow on virtio_max_dma_size

2023-10-19 Thread zhenwei pi via Virtualization
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); This m

Re: PING: [PATCH] virtio-blk: fix implicit overflow on virtio_max_dma_size

2023-10-19 Thread Michael S. Tsirkin
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 widely then: Paolo Bonzini (reviewer:VIRTIO BLOCK AND SCSI DRIVERS) Stefan Hajn

[PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask

2023-10-19 Thread Jakub Sitnicki via Virtualization
Since commit 19e226e8cc5d ("virtio: Make vp_set_vq_affinity() take a mask.") it is actually not needed to have a local copy of the cpu mask. Pass the cpu mask we got as argument to set the irq affinity hint. Cc: Caleb Raitto Signed-off-by: Jakub Sitnicki --- drivers/virtio/virtio_pci_common.c

[PATCH 2/2] virtio_pci: Switch away from deprecated irq_set_affinity_hint

2023-10-19 Thread Jakub Sitnicki via Virtualization
Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity hints") irq_set_affinity_hint is being phased out. Switch to new interfaces for setting and applying irq affinity hints. Signed-off-by: Jakub Sitnicki --- drivers/virtio/virtio_pci_common.c | 4 ++-- 1 file changed, 2 inser

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-19 Thread kernel test robot
ttps://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/x86-paravirt-move-some-functions-and-defines-to-alternative/20231019-171709 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue patch link: https://lore.

Re: [PATCH RFC 1/1] x86/paravirt: introduce param to disable pv sched_clock

2023-10-19 Thread Vitaly Kuznetsov
Dongli Zhang writes: > As mentioned in the linux kernel development document, "sched_clock() is > used for scheduling and timestamping". While there is a default native > implementation, many paravirtualizations have their own implementations. > > About KVM, it uses kvm_sched_clock_read() and the

Re: [PATCH v3 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-19 Thread kernel test robot
ttps://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/x86-paravirt-move-some-functions-and-defines-to-alternative/20231019-171709 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue patch link: https://lore.

Re: [PATCH v3 5/5] x86/paravirt: remove no longer needed paravirt patching code

2023-10-19 Thread kernel test robot
ttps://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/x86-paravirt-move-some-functions-and-defines-to-alternative/20231019-171709 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue patch link: https://lore.

Re: [PATCH 2/2] virtio_pci: Switch away from deprecated irq_set_affinity_hint

2023-10-19 Thread Xuan Zhuo
On Thu, 19 Oct 2023 12:16:25 +0200, Jakub Sitnicki wrote: > Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity > hints") irq_set_affinity_hint is being phased out. > > Switch to new interfaces for setting and applying irq affinity hints. > > Signed-off-by: Jakub Sitnicki Rev

Re: [PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask

2023-10-19 Thread Xuan Zhuo
On Thu, 19 Oct 2023 12:16:24 +0200, Jakub Sitnicki wrote: > Since commit 19e226e8cc5d ("virtio: Make vp_set_vq_affinity() take a > mask.") it is actually not needed to have a local copy of the cpu mask. Could you give more info to prove this? If you are right, I think you should delete all code

Re: [PATCH RFC 1/1] x86/paravirt: introduce param to disable pv sched_clock

2023-10-19 Thread David Woodhouse
On Thu, 2023-10-19 at 08:40 -0700, Sean Christopherson wrote: > > > Normally, it should be up to the hypervisor to tell the guest which > > clock to use, i.e. if TSC is reliable or not. Let me put my question > > this way: if TSC on the particular host is good for everything, why > > does the hype

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Si-Wei Liu
On 10/19/2023 7:39 AM, Eugenio Perez Martin wrote: On Thu, Oct 19, 2023 at 10:27 AM Jason Wang wrote: On Thu, Oct 19, 2023 at 2:47 PM Si-Wei Liu wrote: On 10/18/2023 7:53 PM, Jason Wang wrote: On Wed, Oct 18, 2023 at 4:49 PM Si-Wei Liu wrote: On 10/18/2023 12:00 AM, Jason Wang wrote:

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Si-Wei Liu
On 10/17/2023 10:27 PM, Jason Wang wrote: If we do this without a negotiation, IOTLB will not be clear but the Qemu will try to re-program the IOTLB after reset. Which will break? 1) stick the exact old behaviour with just one line of check It's not just one line of check here, the old be

Re: [PATCH RFC 1/1] x86/paravirt: introduce param to disable pv sched_clock

2023-10-19 Thread Dongli Zhang
Hi Vitaly, Sean and David, On 10/19/23 08:40, Sean Christopherson wrote: > On Thu, Oct 19, 2023, Vitaly Kuznetsov wrote: >> Dongli Zhang writes: >> >>> As mentioned in the linux kernel development document, "sched_clock() is >>> used for scheduling and timestamping". While there is a default nati

Re: [PATCH vhost v4 00/16] vdpa: Add support for vq descriptor mappings

2023-10-19 Thread Si-Wei Liu
For patches 05-16: Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Thanks for the fixes! On 10/18/2023 10:14 AM, Dragos Tatulea wrote: This patch series adds support for vq descriptor table mappings which are used to improve vdpa live migration downtime. The improvement comes from using smalle

Re: [RFC v2 PATCH] vdpa_sim: implement .reset_map support

2023-10-19 Thread Si-Wei Liu
On 10/19/2023 2:29 AM, Stefano Garzarella wrote: On Wed, Oct 18, 2023 at 04:47:48PM -0700, Si-Wei Liu wrote: On 10/18/2023 1:05 AM, Stefano Garzarella wrote: On Tue, Oct 17, 2023 at 10:11:33PM -0700, Si-Wei Liu wrote: RFC only. Not tested on vdpa-sim-blk with user virtual address. Works fi

Re: Re: PING: [PATCH] virtio-blk: fix implicit overflow on virtio_max_dma_size

2023-10-19 Thread zhenwei pi via Virtualization
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 w

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Jason Wang
On Fri, Oct 20, 2023 at 6:28 AM Si-Wei Liu wrote: > > > > On 10/19/2023 7:39 AM, Eugenio Perez Martin wrote: > > On Thu, Oct 19, 2023 at 10:27 AM Jason Wang wrote: > >> On Thu, Oct 19, 2023 at 2:47 PM Si-Wei Liu wrote: > >>> > >>> > >>> On 10/18/2023 7:53 PM, Jason Wang wrote: > On Wed, Oct

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Si-Wei Liu
On 10/19/2023 9:11 PM, Jason Wang wrote: On Fri, Oct 20, 2023 at 6:28 AM Si-Wei Liu wrote: On 10/19/2023 7:39 AM, Eugenio Perez Martin wrote: On Thu, Oct 19, 2023 at 10:27 AM Jason Wang wrote: On Thu, Oct 19, 2023 at 2:47 PM Si-Wei Liu wrote: On 10/18/2023 7:53 PM, Jason Wang wrote:

Re: [PATCH net-next v1 08/19] virtio_net: sq support premapped mode

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > If the xsk is enabling, the xsk tx will share the send queue. > But the xsk requires that the send queue use the premapped mode. > So the send queue must support premapped mode. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c

Re: [PATCH net-next v1 09/19] virtio_net: xsk: bind/unbind xsk

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > This patch implement the logic of bind/unbind xsk pool to sq and rq. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/Makefile | 2 +- > drivers/net/virtio/main.c | 10 +- > drivers/net/virtio/virtio_net.h | 18 > dri

Re: [PATCH net-next v1 10/19] virtio_net: xsk: prevent disable tx napi

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Since xsk's TX queue is consumed by TX NAPI, if sq is bound to xsk, then > we must stop tx napi from being disabled. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio/main.c | 10 +- > 1 file chan

Re: [PATCH net-next v1 11/19] virtio_net: xsk: tx: support tx

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > The driver's tx napi is very important for XSK. It is responsible for > obtaining data from the XSK queue and sending it out. > > At the beginning, we need to trigger tx napi. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c

Re: [PATCH net-next v1 12/19] virtio_net: xsk: tx: support wakeup

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > xsk wakeup is used to trigger the logic for xsk xmit by xsk framework or > user. > > Virtio-Net does not support to actively generate an interruption, so it > tries to trigger tx NAPI on the tx interrupt cpu. > > Consider the effect of cache. Wh

Re: [PATCH net-next v1 14/19] virtio_net: xsk: tx: virtnet_sq_free_unused_buf() check xsk buffer

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > virtnet_sq_free_unused_buf() check xsk buffer. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio/main.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/virtio/ma

Re: [PATCH net-next v1 15/19] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Implement the logic of filling vq with XSK buffer. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c | 13 +++ > drivers/net/virtio/virtio_net.h | 5 +++ > drivers/net/virtio/xsk.c| 66 ++

Re: [PATCH net-next v1 16/19] virtio_net: xsk: rx: introduce receive_xsk() to recv xsk buffer

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Implementing the logic of xsk rx. If this packet is not for XSK > determined in XDP, then we need to copy once to generate a SKB. > If it is for XSK, it is a zerocopy receive packet process. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/vir

Re: [PATCH net-next v1 18/19] virtio_net: update tx timeout record

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > If send queue sent some packets, we update the tx timeout > record to prevent the tx timeout. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio/xsk.c | 10 ++ > 1 file changed, 10 insertions(+) >