Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-08 Thread Jason Wang
On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20:14AM +0800, Jason Wang wrote: On 2021/2/8 下午6:04, Eli Cohen wrote: On Mon, Feb 08, 2021 at 05:04:27PM +0800, Jason Wang wrote: On 2021/2/8 下午2:37, Eli Cohen wrote: On Mon, Feb 08, 2021 at 12:27:18PM +0800, Jason Wang wrote:

Re: [PATCH RFC v2 3/4] virtio-net: support transmit timestamp

2021-02-08 Thread Jason Wang
On 2021/2/9 上午2:55, Willem de Bruijn wrote: From: Willem de Bruijn Add optional PTP hardware tx timestamp offload for virtio-net. Accurate RTT measurement requires timestamps close to the wire. Introduce virtio feature VIRTIO_NET_F_TX_TSTAMP, the transmit equivalent to

Re: [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-08 Thread Jason Wang
On 2021/2/6 下午8:29, Si-Wei Liu wrote: While virtq is stopped, get_vq_state() is supposed to be called to get sync'ed with the latest internal avail_index from device. The saved avail_index is used to restate the virtq once device is started. Commit b35ccebe3ef7 introduced the

Re: [PATCH net] virtio-net: suppress bad irq warning for tx napi

2021-02-08 Thread Jason Wang
On 2021/2/9 上午3:08, Willem de Bruijn wrote: On Sun, Feb 7, 2021 at 10:29 PM Jason Wang wrote: On 2021/2/5 上午4:50, Willem de Bruijn wrote: On Wed, Feb 3, 2021 at 10:06 PM Jason Wang wrote: On 2021/2/4 上午2:28, Willem de Bruijn wrote: On Wed, Feb 3, 2021 at 12:33 AM Jason Wang wrote: On

Re: [PATCH] vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

2021-02-08 Thread Jason Wang
On 2021/2/9 上午2:38, Michael S. Tsirkin wrote: On Mon, Feb 08, 2021 at 05:17:41PM +0100, Stefano Garzarella wrote: It's legal to have 'offset + len' equal to sizeof(struct virtio_net_config), since 'ndev->config' is a 'struct virtio_net_config', so we can safely copy its content under this

Re: [PATCH] vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

2021-02-08 Thread Jason Wang
On 2021/2/9 上午12:17, Stefano Garzarella wrote: It's legal to have 'offset + len' equal to sizeof(struct virtio_net_config), since 'ndev->config' is a 'struct virtio_net_config', so we can safely copy its content under this condition. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-08 Thread Jason Wang
On 2021/2/8 下午6:04, Eli Cohen wrote: On Mon, Feb 08, 2021 at 05:04:27PM +0800, Jason Wang wrote: On 2021/2/8 下午2:37, Eli Cohen wrote: On Mon, Feb 08, 2021 at 12:27:18PM +0800, Jason Wang wrote: On 2021/2/6 上午7:07, Si-Wei Liu wrote: On 2/3/2021 11:36 PM, Eli Cohen wrote: When a change of

Re: [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-08 Thread Si-Wei Liu
On 2/7/2021 9:48 PM, Eli Cohen wrote: On Sat, Feb 06, 2021 at 04:29:24AM -0800, Si-Wei Liu wrote: While virtq is stopped, get_vq_state() is supposed to be called to get sync'ed with the latest internal avail_index from device. The saved avail_index is used to restate the virtq once

Re: [PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset

2021-02-08 Thread Si-Wei Liu
On 2/7/2021 9:35 PM, Eli Cohen wrote: On Sat, Feb 06, 2021 at 04:29:23AM -0800, Si-Wei Liu wrote: The mlx_features denotes the capability for which set of virtio features is supported by device. In principle, this field needs not be cleared during virtio device reset, as this capability is

RE: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-08 Thread Kasireddy, Vivek
Hi Gerd, Daniel, > -Original Message- > From: Daniel Vetter > Sent: Monday, February 08, 2021 1:39 AM > To: Gerd Hoffmann > Cc: Daniel Vetter ; Kasireddy, Vivek > ; > virtualization@lists.linux-foundation.org; dri-de...@lists.freedesktop.org; > Vetter, Daniel > ;

RE: [RFC PATCH 16/18] virt/mshv: mmap vp register page

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:31 PM > > Introduce mmap interface for a virtual processor, exposing a page for > setting and getting common registers while the VP is suspended. > > This provides a more performant and convenient way to get and set these > registers in

RE: [RFC PATCH 15/18] virt/mshv: get and set vp state ioctls

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:31 PM > To: linux-hyp...@vger.kernel.org > Cc: virtualization@lists.linux-foundation.org; linux-ker...@vger.kernel.org; > Michael Kelley > ; virem...@linux.microsoft.com; Sunil Muthuswamy > ; nunodasne...@linux.microsoft.com; >

RE: [RFC PATCH 11/18] virt/mshv: set up synic pages for intercept messages

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:31 PM > > Same idea as synic setup in drivers/hv/hv.c:hv_synic_enable_regs() > and hv_synic_disable_regs(). > Setting up synic registers in both vmbus driver and mshv would clobber > them, but the vmbus driver will not run in the root

RE: [RFC PATCH 10/18] virt/mshv: get and set vcpu registers ioctls

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Add ioctls for getting and setting virtual processor registers. > > Co-developed-by: Lillian Grassin-Drake > Signed-off-by: Lillian Grassin-Drake > Signed-off-by: Nuno Das Neves > --- > Documentation/virt/mshv/api.rst

RE: [RFC PATCH 08/18] virt/mshv: map and unmap guest memory

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Introduce ioctls for mapping and unmapping regions of guest memory. > > Uses a table of memory 'slots' similar to KVM, but the slot > number is not visible to userspace. > > For now, this simple implementation requires each new

RE: [RFC PATCH 07/18] virt/mshv: withdraw memory hypercall

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Withdraw the memory from a finalized partition and free the pages. > The partition is now cleaned up correctly when the fd is released. > > Co-developed-by: Lillian Grassin-Drake > Signed-off-by: Lillian Grassin-Drake >

RE: [RFC PATCH 06/18] virt/mshv: create, initialize, finalize, delete partition hypercalls

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Add hypercalls for fully setting up and mostly tearing down a guest > partition. > The teardown operation will generate an error as the deposited > memory has not been withdrawn. > This is fixed in the next patch. > >

RE: [RFC PATCH 04/18] virt/mshv: request version ioctl

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Reserve ioctl number in userpsace-api/ioctl/ioctl-number.rst > Introduce MSHV_REQUEST_VERSION ioctl. > Introduce documentation for /dev/mshv in Documentation/virt/mshv > > Signed-off-by: Nuno Das Neves > --- >

RE: [RFC PATCH 00/18] Microsoft Hypervisor root partition ioctl interface

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > This patch series provides a userspace interface for creating and running > guest > virtual machines while running on the Microsoft Hypervisor [0]. > > Since managing guest machines can only be done when Linux is the root >

Re: [PATCH net] virtio-net: suppress bad irq warning for tx napi

2021-02-08 Thread Willem de Bruijn
On Sun, Feb 7, 2021 at 10:29 PM Jason Wang wrote: > > > On 2021/2/5 上午4:50, Willem de Bruijn wrote: > > On Wed, Feb 3, 2021 at 10:06 PM Jason Wang wrote: > >> > >> On 2021/2/4 上午2:28, Willem de Bruijn wrote: > >>> On Wed, Feb 3, 2021 at 12:33 AM Jason Wang wrote: > On 2021/2/2 下午10:37,

[PATCH RFC v2 2/4] virtio-net: support receive timestamp

2021-02-08 Thread Willem de Bruijn
From: Willem de Bruijn Add optional PTP hardware rx timestamp offload for virtio-net. Accurate RTT measurement requires timestamps close to the wire. Introduce virtio feature VIRTIO_NET_F_RX_TSTAMP. If negotiated, the virtio-net header is expanded with room for a timestamp. A device may pass

[PATCH RFC v2 3/4] virtio-net: support transmit timestamp

2021-02-08 Thread Willem de Bruijn
From: Willem de Bruijn Add optional PTP hardware tx timestamp offload for virtio-net. Accurate RTT measurement requires timestamps close to the wire. Introduce virtio feature VIRTIO_NET_F_TX_TSTAMP, the transmit equivalent to VIRTIO_NET_F_RX_TSTAMP. The driver sets VIRTIO_NET_HDR_F_TSTAMP to

[PATCH RFC v2 4/4] virtio-net: support future packet transmit time

2021-02-08 Thread Willem de Bruijn
From: Willem de Bruijn Add optional transmit time (SO_TXTIME) offload for virtio-net. The Linux TCP/IP stack tries to avoid bursty transmission and network congestion through pacing: computing an skb delivery time based on congestion information. Userspace protocol implementations can achieve

[PATCH RFC v2 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time

2021-02-08 Thread Willem de Bruijn
From: Willem de Bruijn RFCv2 for four new features to the virtio network device: 1. pass tx flow state to host, for routing + telemetry 2. pass rx tstamp to guest, for better RTT estimation 3. pass tx tstamp to guest, idem 3. pass tx delivery time to host, for accurate pacing All would

[PATCH RFC v2 1/4] virtio-net: support transmit hash report

2021-02-08 Thread Willem de Bruijn
From: Willem de Bruijn Virtio-net supports sharing the flow hash from device to driver on rx. Do the same in the other direction for robust routing and telemetry. Linux derives ipv6 flowlabel and ECMP multipath from sk->sk_txhash, and updates this field on error with sk_rethink_txhash. Allow

Re: [PATCH] vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

2021-02-08 Thread Michael S. Tsirkin
On Mon, Feb 08, 2021 at 05:17:41PM +0100, Stefano Garzarella wrote: > It's legal to have 'offset + len' equal to > sizeof(struct virtio_net_config), since 'ndev->config' is a > 'struct virtio_net_config', so we can safely copy its content under > this condition. > > Fixes: 1a86b377aa21

Re: [PATCH net] vsock/virtio: update credit only if socket is not closed

2021-02-08 Thread Michael S. Tsirkin
On Mon, Feb 08, 2021 at 03:44:54PM +0100, Stefano Garzarella wrote: > If the socket is closed or is being released, some resources used by > virtio_transport_space_update() such as 'vsk->trans' may be released. > > To avoid a use after free bug we should only update the available credit > when we

Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path

2021-02-08 Thread Konrad Rzeszutek Wilk
On Fri, Feb 05, 2021 at 06:58:52PM +0100, Christoph Hellwig wrote: > On Wed, Feb 03, 2021 at 02:36:38PM -0500, Konrad Rzeszutek Wilk wrote: > > > So what? If you guys want to provide a new capability you'll have to do > > > work. And designing a new protocol based around the fact that the > > >

[PATCH] vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

2021-02-08 Thread Stefano Garzarella
It's legal to have 'offset + len' equal to sizeof(struct virtio_net_config), since 'ndev->config' is a 'struct virtio_net_config', so we can safely copy its content under this condition. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Cc: sta...@vger.kernel.org

Re: [vdpa_sim_net] 79991caf52: net/ipv4/ipmr.c:#RCU-list_traversed_in_non-reader_section

2021-02-08 Thread Joe Jin
On 2/7/21 12:15 PM, Dongli Zhang wrote: > Is it possible that the issue is not due to this change? Looks this issue does not related your change, from dmesg output, when issue occurred, virtio was not loaded: [  502.508450] [ cut here ] [  502.511859] WARNING: CPU: 0

Re: [PATCH iproute2-next v4 1/5] Add kernel headers

2021-02-08 Thread David Ahern
On 2/5/21 11:10 AM, Parav Pandit wrote: > diff --git a/vdpa/include/uapi/linux/vdpa.h b/vdpa/include/uapi/linux/vdpa.h > new file mode 100644 > index ..66a41e4e > --- /dev/null > +++ b/vdpa/include/uapi/linux/vdpa.h > @@ -0,0 +1,40 @@ > +/* SPDX-License-Identifier: GPL-2.0+ WITH

[PATCH net] vsock/virtio: update credit only if socket is not closed

2021-02-08 Thread Stefano Garzarella
If the socket is closed or is being released, some resources used by virtio_transport_space_update() such as 'vsk->trans' may be released. To avoid a use after free bug we should only update the available credit when we are sure the socket is still open and we have the lock held. Fixes:

Re: [PATCH V3 16/19] virtio-pci: introduce modern device module

2021-02-08 Thread Michael S. Tsirkin
On Mon, Feb 08, 2021 at 01:42:27PM +0800, Jason Wang wrote: > > On 2021/2/5 下午11:34, Michael S. Tsirkin wrote: > > On Mon, Jan 04, 2021 at 02:55:00PM +0800, Jason Wang wrote: > > > Signed-off-by: Jason Wang > > I don't exactly get why we need to split the modern driver out, > > and it can confuse

Re: [PATCH 00/11] target: fix cmd plugging and completion

2021-02-08 Thread Michael S. Tsirkin
On Thu, Feb 04, 2021 at 05:35:02AM -0600, Mike Christie wrote: > The following patches made over Martin's 5.12 branches fix two > issues: > > 1. target_core_iblock plugs and unplugs the queue for every > command. To handle this issue and handle an issue that > vhost-scsi and loop were avoiding by

[PATCH v3 7/7] drm/udl: Move vmap out of commit tail

2021-02-08 Thread Thomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit

[PATCH v3 3/7] drm: Add additional atomic helpers for shadow-buffered planes

2021-02-08 Thread Thomas Zimmermann
Several drivers use GEM buffer objects as shadow buffers for the actual framebuffer memory. Right now, drivers do these vmap operations in their commit tail, which is actually not allowed by the locking rules for the dma-buf reservation lock. The involved BO has to be vmapped in the plane's

[PATCH v3 6/7] drm/gm12u320: Move vmap out of commit tail

2021-02-08 Thread Thomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit

[PATCH v3 4/7] drm/mgag200: Move vmap out of commit tail

2021-02-08 Thread Thomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit

[PATCH v3 5/7] drm/cirrus: Move vmap out of commit tail

2021-02-08 Thread Thomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit

[PATCH v3 0/7] drm: Move vmap out of commit tail for SHMEM-based drivers

2021-02-08 Thread Thomas Zimmermann
Several SHMEM-based drivers use the BO as shadow buffer for the real framebuffer memory. Damage handling requires a vmap of the BO memory. But vmap/vunmap can acquire the dma-buf reservation lock, which is not allowed in commit tails. This patchset introduces a set of helpers that implement

[PATCH v3 2/7] drm/gem: Export drm_gem_vmap() and drm_gem_vunmap()

2021-02-08 Thread Thomas Zimmermann
The symbols will be required by the upcoming helpers for shadow-buffered planes. Signed-off-by: Thomas Zimmermann Tested-by: Gerd Hoffmann Acked-by: Gerd Hoffmann Reported-by: kernel test robot --- drivers/gpu/drm/drm_gem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v3 1/7] drm/simple-kms: Add plane-state helpers

2021-02-08 Thread Thomas Zimmermann
Just like regular plane-state helpers, drivers can use these new callbacks to create and destroy private plane state. v2: * make duplicate_state interface compatible with struct drm_plane_funcs Signed-off-by: Thomas Zimmermann Tested-by: Gerd Hoffmann Acked-by: Gerd Hoffmann

Re: [PATCH 0/6] drm: Move vmap out of commit tail for SHMEM-based drivers

2021-02-08 Thread Thomas Zimmermann
Hi Am 08.02.21 um 11:53 schrieb Gerd Hoffmann: On Sun, Feb 07, 2021 at 07:33:24PM +0100, Thomas Zimmermann wrote: Hi Am 05.02.21 um 10:05 schrieb Gerd Hoffmann: Hi, I smoke-tested the code by running fbdev, Xorg and weston with the converted mgag200 driver. Looks sane to me. Survived

Re: [PATCH 0/6] drm: Move vmap out of commit tail for SHMEM-based drivers

2021-02-08 Thread Gerd Hoffmann
On Sun, Feb 07, 2021 at 07:33:24PM +0100, Thomas Zimmermann wrote: > Hi > > Am 05.02.21 um 10:05 schrieb Gerd Hoffmann: > >Hi, > > > > > I smoke-tested the code by running fbdev, Xorg and weston with the > > > converted mgag200 driver. > > > > Looks sane to me. > > Survived cirrus smoke

Re: [PATCH 00/11] target: fix cmd plugging and completion

2021-02-08 Thread Stefan Hajnoczi
On Thu, Feb 04, 2021 at 05:35:02AM -0600, Mike Christie wrote: > The following patches made over Martin's 5.12 branches fix two > issues: > > 1. target_core_iblock plugs and unplugs the queue for every > command. To handle this issue and handle an issue that > vhost-scsi and loop were avoiding by

[PATCH] drm/qxl: properly handle device init failures

2021-02-08 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7 insertions(+) diff --git

Re: [PATCH v2 0/9] ALSA: add virtio sound driver

2021-02-08 Thread Anton Yakovlev
Hi Takashi, Thank you for your hints, I actually applied them all. The only question that I have is... On 03.02.2021 19:07, Takashi Iwai wrote: [snip] - Don't PCM stream names need to be unique? They are all the same string. What did you mean here? Substream names? thanks,

Re: [vdpa_sim_net] 79991caf52: net/ipv4/ipmr.c:#RCU-list_traversed_in_non-reader_section

2021-02-08 Thread Michael S. Tsirkin
On Sun, Feb 07, 2021 at 11:03:30AM +0800, kernel test robot wrote: > > Greeting, > > FYI, we noticed the following commit (built with gcc-9): > > commit: 79991caf5202c7989928be534727805f8f68bb8d ("vdpa_sim_net: Add support > for user supported devices") >

Re: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-08 Thread Daniel Vetter
On Mon, Feb 08, 2021 at 08:57:48AM +0100, Gerd Hoffmann wrote: > Hi, > > > > +/* extract pages referenced by sgt */ > > > +static struct page **extr_pgs(struct sg_table *sgt, int *nents, int > > > *last_len) > > > > Nack, this doesn't work on dma-buf. And it'll blow up at runtime when you > >

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-08 Thread Michael S. Tsirkin
On Mon, Feb 08, 2021 at 05:04:27PM +0800, Jason Wang wrote: > > On 2021/2/8 下午2:37, Eli Cohen wrote: > > On Mon, Feb 08, 2021 at 12:27:18PM +0800, Jason Wang wrote: > > > On 2021/2/6 上午7:07, Si-Wei Liu wrote: > > > > > > > > On 2/3/2021 11:36 PM, Eli Cohen wrote: > > > > > When a change of

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-08 Thread Jason Wang
On 2021/2/8 下午2:37, Eli Cohen wrote: On Mon, Feb 08, 2021 at 12:27:18PM +0800, Jason Wang wrote: On 2021/2/6 上午7:07, Si-Wei Liu wrote: On 2/3/2021 11:36 PM, Eli Cohen wrote: When a change of memory map occurs, the hardware resources are destroyed and then re-created again with the new