Re: [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()

2018-12-07 Thread Michael S. Tsirkin
On Fri, Dec 07, 2018 at 03:34:41PM +0800, Dongli Zhang wrote: > VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead. > > Signed-off-by: Dongli Zhang > --- > drivers/virtio/virtio_pci_legacy.c | 6 -- > include/uapi/linux/virtio_pci.h| 2 -- > 2 files changed, 4

[PATCH] x86, boot: documentation whitespace fixup

2018-11-30 Thread Michael S. Tsirkin
Fix an extra space that sneaked in with commit 09c205afd "(x86, boot: Define the 2.12 bzImage boot protocol"). Signed-off-by: Michael S. Tsirkin --- Documentation/x86/boot.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/x86/boot.txt b/Documen

Re: [PATCH net-next 3/3] vhost: don't touch avail ring if in_order is negotiated

2018-11-23 Thread Michael S. Tsirkin
On Fri, Nov 23, 2018 at 11:00:16AM +0800, Jason Wang wrote: > Device use descriptors table in order, so there's no need to read > index from available ring. This eliminate the cache contention on > avail ring completely. Well this isn't what the in order feature says in the spec. It forces the

Re: [PATCH v1 2/8] mm: convert PG_balloon to PG_offline

2018-11-20 Thread Michael S. Tsirkin
imil Babka > Cc: "Kirill A. Shutemov" > Cc: Stephen Rothwell > Cc: Matthew Wilcox > Cc: "Michael S. Tsirkin" > Cc: Michal Hocko > Cc: Pavel Tatashin > Cc: Alexander Duyck > Cc: Naoya Horiguchi > Cc: Miles Chen > Cc: David Rientjes &

Re: virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON discussion

2018-11-07 Thread Michael S. Tsirkin
On Thu, Nov 08, 2018 at 10:49:20AM +0800, Wei Wang wrote: > On 11/07/2018 11:27 PM, Michael S. Tsirkin wrote: > > + LKML > > > On Wed, Nov 07, 2018 at 02:29:02PM +, Wang, Wei W wrote: > > > Hi Michael, > > > > > > > > > Thanks again f

Re: [PATCH 1/1] Add vhost_blk driver

2018-11-02 Thread Michael S. Tsirkin
On Fri, Nov 02, 2018 at 06:21:23PM +, Vitaly Mayatskikh wrote: > This driver accelerates host side of virtio-blk. > > Signed-off-by: Vitaly Mayatskikh > --- > drivers/vhost/Kconfig | 13 ++ > drivers/vhost/Makefile | 3 + > drivers/vhost/blk.c| 510

Re: [PATCH] MAINTAINERS: remove reference to bogus vsock file

2018-10-22 Thread Michael S. Tsirkin
On Mon, Oct 22, 2018 at 01:39:50PM +0100, Stefan Hajnoczi wrote: > On Fri, Oct 12, 2018 at 04:46:37PM +0100, Stefan Hajnoczi wrote: > > The file drivers/vhost/vsock.h never existed. Remove the bogus > > MAINTAINERS reference. > > > > Fixes: 433fc58e6bf2c8bd97e57153ed28e64fd78207b8 ("VSOCK:

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Michael S. Tsirkin
On Thu, Oct 11, 2018 at 10:13:31PM +0800, Tiwei Bie wrote: > On Thu, Oct 11, 2018 at 09:48:48AM -0400, Michael S. Tsirkin wrote: > > On Thu, Oct 11, 2018 at 08:12:21PM +0800, Tiwei Bie wrote: > > > > > But if it's not too late, I second for a OUT_OF_ORDER feature. > >

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Michael S. Tsirkin
On Thu, Oct 11, 2018 at 08:12:21PM +0800, Tiwei Bie wrote: > > > But if it's not too late, I second for a OUT_OF_ORDER feature. > > > Starting from in order can have much simpler code in driver. > > > > > > Thanks > > > > It's tricky to change the flag polarity because of compatibility > > with

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Michael S. Tsirkin
On Fri, Sep 28, 2018 at 07:37:37AM +0800, Jason Wang wrote: > > > On 2018年09月28日 01:04, Michael S. Tsirkin wrote: > > On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > > > The access of vsock is not protected by vhost_vsock_lock. This may > >

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Michael S. Tsirkin
On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > The access of vsock is not protected by vhost_vsock_lock. This may > lead to use after free since vhost_vsock_dev_release() may free the > pointer at the same time. > > Fix this by holding the lock during the access. > > Reported-by:

Re: [PATCH net-next 06/11] tuntap: split out XDP logic

2018-09-06 Thread Michael S. Tsirkin
On Thu, Sep 06, 2018 at 12:05:21PM +0800, Jason Wang wrote: > This patch split out XDP logic into a single function. This make it to > be reused by XDP batching path in the following patch. > > Signed-off-by: Jason Wang > --- > drivers/net/tun.c | 84

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-06 Thread Michael S. Tsirkin
On Tue, Aug 07, 2018 at 05:56:59AM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-08-06 at 16:46 +0300, Michael S. Tsirkin wrote: > > > > > Right, we'll need some quirk to disable balloons in the guest I > > > suppose. > > > > > > Passing

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-06 Thread Michael S. Tsirkin
On Mon, Aug 06, 2018 at 08:24:06AM -0700, Christoph Hellwig wrote: > On Mon, Aug 06, 2018 at 04:36:43PM +0300, Michael S. Tsirkin wrote: > > On Mon, Aug 06, 2018 at 02:32:28PM +0530, Anshuman Khandual wrote: > > > On 08/05/2018 05:54 AM, Michael S. Tsirkin wrote: > > > &

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-04 Thread Michael S. Tsirkin
On Fri, Aug 03, 2018 at 08:16:21PM -0500, Benjamin Herrenschmidt wrote: > On Fri, 2018-08-03 at 22:07 +0300, Michael S. Tsirkin wrote: > > On Fri, Aug 03, 2018 at 10:58:36AM -0500, Benjamin Herrenschmidt wrote: > > > On Fri, 2018-08-03 at 00:05 -0700, Christoph Hellwig wrote: &

[PATCH 2/2] tools/virtio: add kmalloc_array stub

2018-07-25 Thread Michael S. Tsirkin
Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()") Signed-off-by: Michael S. Tsirkin --- tools/virtio/linux/kernel.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index fca8381bbe04..fb22bccfbc8a 10064

[PATCH 1/2] tools/virtio: add dma barrier stubs

2018-07-25 Thread Michael S. Tsirkin
Fixes: 55e49dc43a8 ("virtio_ring: switch to dma_XX barriers for rpmsg") Signed-off-by: Michael S. Tsirkin --- tools/virtio/asm/barrier.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h index 0a

Re: [RFC 4/4] virtio: Add platform specific DMA API translation for virito devices

2018-07-25 Thread Michael S. Tsirkin
On Mon, Jul 23, 2018 at 07:46:09AM +0530, Anshuman Khandual wrote: > There is a redundant definition of virtio_has_iommu_quirk in the tools > directory (tools/virtio/linux/virtio_config.h) which does not seem to > be used any where. I guess that can be removed without problem. It's there just to

Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-11 Thread Michael S. Tsirkin
On Wed, Jul 11, 2018 at 01:09:49PM +0200, Michal Hocko wrote: > But let me note that I am not really convinced how this (or previous) > approach will really work in most workloads. We tend to cache heavily so > there is rarely any memory free. It might be that it's worth flushing the cache when

Re: [PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-06-25 Thread Michael S. Tsirkin
On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: > On 06/26/2018 09:37 AM, Michael S. Tsirkin wrote: > > On Mon, Jun 25, 2018 at 08:05:10PM +0800, Wei Wang wrote: > > > > > @@ -326,17 +353,6 @@ static void stats_handle_request(struct

[PATCH] kvm: fix typo in flag name

2018-06-07 Thread Michael S. Tsirkin
KVM_X86_DISABLE_EXITS_HTL really refers to exit on halt. Obviously a typo: should be named KVM_X86_DISABLE_EXITS_HLT. Fixes: caa057a2cad ("KVM: X86: Provide a capability to disable HLT intercepts") Cc: sta...@vger.kernel.org Signed-off-by: Michael S. Tsirkin --- arch/x86

Re: KMSAN: uninit-value in _copy_to_iter (2)

2018-06-07 Thread Michael S. Tsirkin
On Thu, Jun 07, 2018 at 07:04:49PM +0100, Al Viro wrote: > On Thu, Jun 07, 2018 at 08:59:06PM +0300, Michael S. Tsirkin wrote: > > On Thu, Jun 07, 2018 at 06:43:55PM +0100, Al Viro wrote: > > > On Thu, Jun 07, 2018 at 06:38:48PM +0300, Michael S. Tsirkin wrote: > &

Re: [PATCH] virtio_ring: switch to dma_XX barriers for rpmsg

2018-05-30 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 07:48:24PM +0200, Paolo Bonzini wrote: > On 19/04/2018 19:46, Michael S. Tsirkin wrote: > >> This should be okay, but I wonder if there should be a virtio_wmb(...) > >> or an "if (weak_barriers) wmb()" before the "writel" in vm_

Re: [net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-05-29 Thread Michael S. Tsirkin
sg_node *node = kmalloc(sizeof *node, GFP_KERNEL); > > + struct vhost_msg_node *node = kzalloc(sizeof *node, GFP_KERNEL); > > if (!node) > > return NULL; > > node->vq = vq; As I pointed out, we don't need to init the whole structure. The proper fix is th

Re: [RFC PATCH net-next 00/12] XDP batching for TUN/vhost_net

2018-05-25 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 05:04:21PM +0800, Jason Wang wrote: > Hi all: > > We do not support XDP batching for TUN since it can only receive one > packet a time from vhost_net. This series tries to remove this > limitation by: > > - introduce a TUN specific msg_control that can hold a pointer to

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-25 Thread Michael S. Tsirkin
On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > I re-read that discussion and I'm still unclear on the > > original question, since I got several apparently > > conflicting a

Re: [PATCH net] vhost: synchronize IOTLB message with dev cleanup

2018-05-24 Thread Michael S. Tsirkin
t;vhost: new device IOTLB API") > Signed-off-by: Jason Wang <jasow...@redhat.com> We should think of a way to have a per-vq lock here, but for now: Acked-by: Michael S. Tsirkin <m...@redhat.com> > --- > drivers/vhost/vhost.c | 3 +++ > 1 file changed, 3

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-23 Thread Michael S. Tsirkin
subj: s/virito/virtio/ On Tue, May 22, 2018 at 12:03:17PM +0530, Anshuman Khandual wrote: > This adds a hook which a platform can define in order to allow it to > force the use of the DMA API for all virtio devices even if they don't > have the VIRTIO_F_IOMMU_PLATFORM flag set. We want to use

Re: KASAN: use-after-free Read in vhost_chr_write_iter

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:50:29AM +0800, Jason Wang wrote: > > > On 2018年05月21日 22:42, Michael S. Tsirkin wrote: > > On Mon, May 21, 2018 at 10:38:10AM +0800, Jason Wang wrote: > > > On 2018年05月18日 17:24, Jason Wang wrote: > > > > On 2018年05月17日 21:45, DaeRy

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: > > > On 2018年05月22日 06:08, Michael S. Tsirkin wrote: > > On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > > > From: Jason Wang <jasow...@redhat.com> > > > Date: Fri, 18 May 2018

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: > > > On 2018年05月22日 06:08, Michael S. Tsirkin wrote: > > On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > > > From: Jason Wang <jasow...@redhat.com> > > > Date: Fri, 18 May 2018

Re: [RFC PATCH net-next 10/12] vhost_net: build xdp buff

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 09:56:11AM -0700, Jesse Brandeburg wrote: > On Mon, 21 May 2018 17:04:31 +0800 Jason wrote: > > This patch implement build XDP buffers in vhost_net. The idea is do > > userspace copy in vhost_net and build XDP buff based on the > > page. Vhost_net can then submit one or an

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > From: Jason Wang > Date: Fri, 18 May 2018 21:00:43 +0800 > > > We return -EIO on device down but can not raise EPOLLOUT after it was > > up. This may confuse user like vhost which expects tuntap to raise > >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Sat, May 19, 2018 at 09:09:11AM +0800, Jason Wang wrote: > > > On 2018年05月18日 22:46, Michael S. Tsirkin wrote: > > On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: > > > > > > On 2018年05月18日 22:06, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH net 0/4] Fix several issues of virtio-net mergeable XDP

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 04:35:02PM +0800, Jason Wang wrote: > Hi: > > Please review the patches that tries to fix sevreal issues of > virtio-net mergeable XDP. > > Thanks I think we should do 3/4 differently. The rest looks good, and probably needed on stable. Thanks! > Jason Wang (4): >

Re: [PATCH net 2/4] virtio-net: correctly transmit XDP buff after linearizing

2018-05-21 Thread Michael S. Tsirkin
p the refcnt of original page and go for xmit path. > > Fixes: 72979a6c3590 ("virtio_net: xdp, add slowpath case for non contiguous > buffers") > Cc: John Fastabend <john.fastab...@gmail.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> Acked-by: Michael S

Re: [PATCH net 1/4] virtio-net: correctly redirect linearized packet

2018-05-21 Thread Michael S. Tsirkin
riginal page. > > Fixes: 186b3c998c50 ("virtio-net: support XDP_REDIRECT") > Reported-by: David Ahern <dsah...@gmail.com> > Tested-by: David Ahern <dsah...@gmail.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> Acked-by: Michael S. Tsirkin <m...@

Re: [PATCH net 4/4] virito-net: fix leaking page for gso packet during mergeable XDP

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 04:35:06PM +0800, Jason Wang wrote: > We need to drop refcnt to xdp_page if we see a gso packet. Otherwise > it will be leaked. Fixing this by moving the check of gso packet above > the linearizing logic. > > Cc: John Fastabend > Fixes:

Re: [PATCH net 3/4] virtio-net: reset num_buf to 1 after linearizing packet

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 04:35:05PM +0800, Jason Wang wrote: > If we successfully linearize the packets, num_buf were set to zero > which was wrong since we now have only 1 buffer to be used for e.g in > the error path of receive_mergeable(). Zero num_buf will lead the code > try to pop the buffers

Re: KASAN: use-after-free Read in vhost_chr_write_iter

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 10:38:10AM +0800, Jason Wang wrote: > > > On 2018年05月18日 17:24, Jason Wang wrote: > > > > > > On 2018年05月17日 21:45, DaeRyong Jeong wrote: > > > We report the crash: KASAN: use-after-free Read in vhost_chr_write_iter > > > > > > This crash has been found in v4.17-rc1

Re: [RFC PATCH net-next 12/12] vhost_net: batch submitting XDP buffers to underlayer sockets

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 05:04:33PM +0800, Jason Wang wrote: > This patch implements XDP batching for vhost_net with tun. This is > done by batching XDP buffs in vhost and submit them when: > > - vhost_net can not build XDP buff (mostly because of the size of packet) > - #batched exceeds the

Re: [RFC PATCH net-next 06/12] tuntap: enable premmption early

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 05:04:27PM +0800, Jason Wang wrote: > Signed-off-by: Jason Wang typo in subject > --- > drivers/net/tun.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 44d4f3d..24ecd82

Re: [PATCH] kvm: rename HINTS_DEDICATED to KVM_HINTS_REALTIME

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 01:04:31PM -0300, Eduardo Habkost wrote: > CCing qemu-devel, as I'm now discussing userspace. > > On Thu, May 17, 2018 at 10:55:33PM +0300, Michael S. Tsirkin wrote: > > On Thu, May 17, 2018 at 03:46:58PM -0300, Eduardo Habkost wrote: > > > On Th

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: > > > On 2018年05月18日 22:06, Michael S. Tsirkin wrote: > > On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: > > > > > > On 2018年05月18日 21:26, Jason Wang wrote: > > > > > >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: > > > On 2018年05月18日 21:26, Jason Wang wrote: > > > > > > On 2018年05月18日 21:13, Michael S. Tsirkin wrote: > > > On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: > > > >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: > We return -EIO on device down but can not raise EPOLLOUT after it was > up. This may confuse user like vhost which expects tuntap to raise > EPOLLOUT to re-enable its TX routine after tuntap is down. This could > be easily reproduced by

Re: [PATCH] kvm: rename HINTS_DEDICATED to KVM_HINTS_REALTIME

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 11:41:23AM +0200, Paolo Bonzini wrote: > On 17/05/2018 20:46, Eduardo Habkost wrote: > > My understanding of the original patch is that the intention is > > to tell the guest that it is very unlikely to be preempted, so it > > can choose a more appropriate spinlock

Re: [PATCH] kvm: rename HINTS_DEDICATED to KVM_HINTS_REALTIME

2018-05-17 Thread Michael S. Tsirkin
On Thu, May 17, 2018 at 03:46:58PM -0300, Eduardo Habkost wrote: > On Thu, May 17, 2018 at 05:54:24PM +0300, Michael S. Tsirkin wrote: > > HINTS_DEDICATED seems to be somewhat confusing: > > > > Guest doesn't really care whether it's the only task running on a host &g

[PATCH] kvm: rename HINTS_DEDICATED to KVM_HINTS_REALTIME

2018-05-17 Thread Michael S. Tsirkin
on a memory access, post copy migration can cause preemption, etc. Let's call it KVM_HINTS_REALTIME which seems to better match what guests expect. Also, the flag most be set on all vCPUs - current guests assume this. Note so in the documentation. Signed-off-by: Michael S. Tsirkin <m...@redhat.

Re: [PATCH net V2] tun: fix use after free for ptr_ring

2018-05-11 Thread Michael S. Tsirkin
was introduced by commit 4df0bfc79904 ("tun: fix a memory leak > for tfile->tx_array"). > > Reported-by: syzbot+e8b902c3c3fadf0a9...@syzkaller.appspotmail.com > Cc: Eric Dumazet <eric.duma...@gmail.com> > Cc: Cong Wang <xiyou.wangc...@gmail.com> > Cc: Micha

Re: [PATCH net] tun: fix use after free for ptr_ring

2018-05-11 Thread Michael S. Tsirkin
was introduced by commit 4df0bfc79904 ("tun: fix a memory leak > for tfile->tx_array"). > > Reported-by: syzbot+e8b902c3c3fadf0a9...@syzkaller.appspotmail.com > Cc: Eric Dumazet <eric.duma...@gmail.com> > Cc: Cong Wang <xiyou.wangc...@gmail.com> > Cc: Micha

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-05-07 Thread Michael S. Tsirkin
P_KERNEL); > + struct vhost_msg_node *node = kzalloc(sizeof *node, GFP_KERNEL); > if (!node) > return NULL; > node->vq = vq; Let's just init the msg though. OK it seems this is the best we can do for now, we need a new feature bit to fix it for 32 bit us

Re: [PATCH 0/6] virtio-console: spec compliance fixes

2018-05-06 Thread Michael S. Tsirkin
On Sun, May 06, 2018 at 08:24:30PM +0200, Amit Shah wrote: > On (Thu) 03 May 2018 [22:28:32], Michael S. Tsirkin wrote: > > On Thu, May 03, 2018 at 05:45:29AM +0200, Amit Shah wrote: > > > (apologies if you received a dup) > > > > > > On (Tue) 24 Apr 2018

Re: [PATCH 0/6] virtio-console: spec compliance fixes

2018-05-03 Thread Michael S. Tsirkin
On Thu, May 03, 2018 at 05:45:29AM +0200, Amit Shah wrote: > (apologies if you received a dup) > > On (Tue) 24 Apr 2018 [21:41:29], Michael S. Tsirkin wrote: > > On Fri, Apr 20, 2018 at 09:17:59PM +0300, Michael S. Tsirkin wrote: > > > Turns out virtio console tr

Re: [RFC] virtio: support VIRTIO_F_IO_BARRIER

2018-05-03 Thread Michael S. Tsirkin
On Thu, May 03, 2018 at 10:59:55AM +0800, Tiwei Bie wrote: > This patch introduces the support for VIRTIO_F_IO_BARRIER. > When this feature is negotiated, driver will use the barriers > suitable for hardware devices. > > Signed-off-by: Tiwei Bie Thanks! > --- >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Thu, May 03, 2018 at 09:11:16AM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > > > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote: > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > > > On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > > > O

Re: [PATCH] vhost: make msg padding explicit

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 10:04:46AM -0400, David Miller wrote: > From: "Michael S. Tsirkin" <m...@redhat.com> > Date: Wed, 2 May 2018 16:36:37 +0300 > > > Ouch. True - and in particular the 32 bit ABI on 64 bit kernels doesn't > > work at all. Hmm. It's rela

[PATCH] Revert "vhost: make msg padding explicit"

2018-05-02 Thread Michael S. Tsirkin
This reverts commit 93c0d549c4c5a7382ad70de6b86610b7aae57406. Unfortunately the padding will break 32 bit userspace. Ouch. Need to add some compat code, revert for now. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/uapi/linux/vhost.h | 1 - 1 file changed, 1 deletion(-)

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > This commit introduces the event idx support in packed > > > ring. This feature is temporarily disabled, because the > > >

Re: [PATCH] vhost: make msg padding explicit

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 02:28:09AM -0400, Kevin Easton wrote: > On Tue, May 01, 2018 at 02:05:51PM -0400, David Miller wrote: > > From: "Michael S. Tsirkin" <m...@redhat.com> > > Date: Tue, 1 May 2018 20:19:19 +0300 > > > > > On Tue, May 01

Re: [PATCH] vhost: make msg padding explicit

2018-05-01 Thread Michael S. Tsirkin
On Tue, May 01, 2018 at 11:28:22AM -0400, David Miller wrote: > From: "Michael S. Tsirkin" <m...@redhat.com> > Date: Fri, 27 Apr 2018 19:02:05 +0300 > > > There's a 32 bit hole just after type. It's best to > > give it a name, this way compiler is

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-04-27 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 06:11:31PM +0200, Dmitry Vyukov wrote: > On Fri, Apr 27, 2018 at 6:05 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > >> The struct vhost_msg within struct vhost_msg_node is copi

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-04-27 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 06:11:31PM +0200, Dmitry Vyukov wrote: > On Fri, Apr 27, 2018 at 6:05 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > >> The struct vhost_msg within struct vhost_msg_node is copi

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-04-27 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > The struct vhost_msg within struct vhost_msg_node is copied to userspace, > so it should be allocated with kzalloc() to ensure all structure padding > is zeroed. > > Signed-off-by: Kevin Easton > Reported-by:

[PATCH] vhost: make msg padding explicit

2018-04-27 Thread Michael S. Tsirkin
There's a 32 bit hole just after type. It's best to give it a name, this way compiler is forced to initialize it with rest of the structure. Reported-by: Kevin Easton <ke...@guarana.org> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/uapi/linux/vhost.h | 1 + 1 fil

Re: [RFC v3 0/5] virtio: support packed ring

2018-04-26 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 11:56:05AM +0800, Jason Wang wrote: > > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > Hello everyone, > > > > This RFC implements packed ring support in virtio driver. > > > > Some simple functional tests have been done with Jason's > > packed ring implementation in

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 05:50:20PM -0400, Mikulas Patocka wrote: > How is the user or developer supposed to learn about this option, if > he gets no crash at all? Look in /sys/kernel/debug/fail* ? That actually lets you filter by module, process etc. I think this patch conflates two things: 1.

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 03:36:14PM -0400, Mikulas Patocka wrote: > People on this list argue "this should be a kernel parameter". How about making it a writeable attribute, so it's easy to turn on/off after boot. Then you can keep it deterministic, userspace can play with the attribute at random

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 02:54:26PM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > > > On Thu, Apr 26, 2018 at 12:07:25PM -0400, Mikulas Patocka wrote: > > > > IIUC debug kernels mainly exist so people who experience e.g. mem

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 02:58:08PM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > > > How do you make sure QA tests a specific corner case? Add it to > > the test plan :) > > BTW. how many "lines of code" of corporat

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 12:07:25PM -0400, Mikulas Patocka wrote: > > IIUC debug kernels mainly exist so people who experience e.g. memory > > corruption can try and debug the failure. In this case, CONFIG_DEBUG_SG > > will *already* catch a failure early. Nothing special needs to be done. > > The

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 11:44:21AM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, James Bottomley wrote: > > > On Thu, 2018-04-26 at 11:05 -0400, Mikulas Patocka wrote: > > > > > > On Thu, 26 Apr 2018, James Bottomley wrote: > > [...] > > > > Perhaps find out beforehand instead of

Re: [RFC v2 1/2] virtio: add pmem driver

2018-04-25 Thread Michael S. Tsirkin
On Wed, Apr 25, 2018 at 04:54:13PM +0530, Pankaj Gupta wrote: > diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h > index 6d5c3b2..5ebd049 100644 > --- a/include/uapi/linux/virtio_ids.h > +++ b/include/uapi/linux/virtio_ids.h > @@ -43,5 +43,6 @@ > #define

Re: [PATCH 1/6] virtio_console: don't tie bufs to a vq

2018-04-24 Thread Michael S. Tsirkin
On Sat, Apr 21, 2018 at 09:30:05AM +0200, Greg Kroah-Hartman wrote: > On Fri, Apr 20, 2018 at 09:18:01PM +0300, Michael S. Tsirkin wrote: > > an allocated buffer doesn't need to be tied to a vq - > > only vq->vdev is ever used. Pass the function the > > just

Re: [PATCH 0/6] virtio-console: spec compliance fixes

2018-04-24 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 09:17:59PM +0300, Michael S. Tsirkin wrote: > Turns out virtio console tries to take a buffer out of an active vq. > Works by sheer luck, and is explicitly forbidden by spec. And while > going over it I saw that error handling is also broken - > failure is eas

Re: [RFC v2] virtio: support packed ring

2018-04-23 Thread Michael S. Tsirkin
On Tue, Apr 24, 2018 at 09:37:47AM +0800, Tiwei Bie wrote: > On Tue, Apr 24, 2018 at 04:29:51AM +0300, Michael S. Tsirkin wrote: > > On Tue, Apr 24, 2018 at 09:16:38AM +0800, Tiwei Bie wrote: > > > On Tue, Apr 24, 2018 at 04:05:07AM +0300, Michael S. Tsirkin wrote: > >

Re: [RFC v2] virtio: support packed ring

2018-04-23 Thread Michael S. Tsirkin
On Tue, Apr 24, 2018 at 09:16:38AM +0800, Tiwei Bie wrote: > On Tue, Apr 24, 2018 at 04:05:07AM +0300, Michael S. Tsirkin wrote: > > On Tue, Apr 24, 2018 at 08:54:52AM +0800, Jason Wang wrote: > > > > > > > > > On 2018年04月23日 17:29, Tiwei Bie wrote: > &

Re: [RFC v2] virtio: support packed ring

2018-04-23 Thread Michael S. Tsirkin
On Tue, Apr 24, 2018 at 08:54:52AM +0800, Jason Wang wrote: > > > On 2018年04月23日 17:29, Tiwei Bie wrote: > > On Mon, Apr 23, 2018 at 01:42:14PM +0800, Jason Wang wrote: > > > On 2018年04月01日 22:12, Tiwei Bie wrote: > > > > Hello everyone, > > > > > > > > This RFC implements packed ring support

Re: [RFC V3 PATCH 0/8] Packed ring for vhost

2018-04-23 Thread Michael S. Tsirkin
On Mon, Apr 23, 2018 at 03:31:20PM -0400, Konrad Rzeszutek Wilk wrote: > On Mon, Apr 23, 2018 at 01:34:52PM +0800, Jason Wang wrote: > > Hi all: > > > > This RFC implement packed ring layout. The code were tested with > > Tiwei's RFC V2 a thttps://lkml.org/lkml/2018/4/1/48. Some fixups and > >

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 08:20:23AM -0400, Mikulas Patocka wrote: > > > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > > On Thu, Apr 19, 2018 at 12:12:38PM -0400, Mikulas Patocka wrote: > > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > > > uses DMA-API on the returned

[PATCH 3/6] virtio_console: free buffers after reset

2018-04-20 Thread Michael S. Tsirkin
l.org Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- drivers/char/virtio_console.c | 49 +-- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 3e56f32..26a66f

[PATCH 4/6] virtio_console: drop custom control queue cleanup

2018-04-20 Thread Michael S. Tsirkin
We now cleanup all VQs on device removal - no need to handle the control VQ specially. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- drivers/char/virtio_console.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/char/virtio_console.c b/driver

[PATCH 1/6] virtio_console: don't tie bufs to a vq

2018-04-20 Thread Michael S. Tsirkin
an allocated buffer doesn't need to be tied to a vq - only vq->vdev is ever used. Pass the function the just what it needs - the vdev. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- drivers/char/virtio_console.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions

[PATCH 0/6] virtio-console: spec compliance fixes

2018-04-20 Thread Michael S. Tsirkin
Turns out virtio console tries to take a buffer out of an active vq. Works by sheer luck, and is explicitly forbidden by spec. And while going over it I saw that error handling is also broken - failure is easy to trigger if I force allocations to fail. Lightly tested. Michael S. Tsirkin (6

[PATCH 2/6] virtio: add ability to iterate over vqs

2018-04-20 Thread Michael S. Tsirkin
For cleanup it's helpful to be able to simply scan all vqs and discard all data. Add an iterator to do that. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/linux/virtio.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/virtio.h b/include/linux/virtio.h

[PATCH 5/6] virtio_console: move removal code

2018-04-20 Thread Michael S. Tsirkin
Will make it reusable for error handling. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- drivers/char/virtio_console.c | 72 +-- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/char/virtio_console.c b/driver

[PATCH 6/6] virtio_console: reset on out of memory

2018-04-20 Thread Michael S. Tsirkin
When out of memory and we can't add ctrl vq buffers, probe fails. Unfortunately the error handling is out of spec: it calls del_vqs without bothering to reset the device first. To fix, call the full cleanup function in this case. Cc: sta...@vger.kernel.org Signed-off-by: Michael S. Tsirkin &l

Re: [virtio-dev] [pci PATCH v7 2/5] virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices

2018-04-20 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 09:08:51AM -0700, Alexander Duyck wrote: > On Fri, Apr 20, 2018 at 8:28 AM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Fri, Apr 20, 2018 at 07:56:14AM -0700, Alexander Duyck wrote: > >> > I think for virtio it should include the feat

Re: [virtio-dev] [pci PATCH v7 2/5] virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices

2018-04-20 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 07:56:14AM -0700, Alexander Duyck wrote: > > I think for virtio it should include the feature bit, yes. > > Adding feature bit is very easy - post a patch to the virtio TC mailing > > list, wait about a week to give people time to respond (two weeks if it > > is around

Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-20 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 11:52:47AM +0800, Jason Wang wrote: > > The biggest issue is that you let userspace poke at the > > device which is also allowed by the IOMMU to poke at > > kernel memory (needed for kernel driver to work). > > I don't quite get. The userspace driver could be built on top

Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-20 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 03:50:41AM +, Liang, Cunming wrote: > > > > -Original Message- > > From: Bie, Tiwei > > Sent: Friday, April 20, 2018 11:28 AM > > To: Michael S. Tsirkin <m...@redhat.com> > > Cc: Jason Wang <jasow...@redh

Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 11:28:07AM +0800, Tiwei Bie wrote: > On Thu, Apr 19, 2018 at 09:40:23PM +0300, Michael S. Tsirkin wrote: > > On Tue, Apr 10, 2018 at 03:25:45PM +0800, Jason Wang wrote: > > > > > > One problem is that, different virtio ring compatible devices >

Re: [PATCH v2 net 0/3] virtio: ctrl buffer fixes

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 04:34:22PM -0400, David Miller wrote: > From: "Michael S. Tsirkin" <m...@redhat.com> > Date: Thu, 19 Apr 2018 08:30:47 +0300 > > > Here are a couple of fixes related to the virtio control buffer. > > Lightly tested on x86 only. >

Re: [pci PATCH v7 0/5] Add support for unmanaged SR-IOV

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 03:54:49PM -0700, Alexander Duyck wrote: > On Thu, Mar 15, 2018 at 11:40 AM, Alexander Duyck > wrote: > > This series is meant to add support for SR-IOV on devices when the VFs are > > not managed by the kernel. Examples of recent patches

Re: [virtio-dev] [pci PATCH v7 2/5] virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices

2018-04-19 Thread Michael S. Tsirkin
On Tue, Apr 03, 2018 at 12:06:03PM -0700, Alexander Duyck wrote: > On Tue, Apr 3, 2018 at 11:27 AM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Tue, Apr 03, 2018 at 10:32:00AM -0700, Alexander Duyck wrote: > >> On Tue, Apr 3, 2018 at 6:12 AM, Michael S. Tsirkin

Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 03:25:45PM +0800, Jason Wang wrote: > > > > One problem is that, different virtio ring compatible devices > > > > may have different device interfaces. That is to say, we will > > > > need different drivers in QEMU. It could be troublesome. And > > > > that's what this

Re: [PATCH] virtio_ring: switch to dma_XX barriers for rpmsg

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 07:48:24PM +0200, Paolo Bonzini wrote: > On 19/04/2018 19:46, Michael S. Tsirkin wrote: > >> This should be okay, but I wonder if there should be a virtio_wmb(...) > >> or an "if (weak_barriers) wmb()" before the "writel" in vm_

Re: [PATCH] virtio_ring: switch to dma_XX barriers for rpmsg

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 07:39:21PM +0200, Paolo Bonzini wrote: > On 19/04/2018 19:35, Michael S. Tsirkin wrote: > > virtio is using barriers to order memory accesses, thus > > dma_wmb/rmb is a good match. > > > > Build-tested on x86: Before > > > >

[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg

2018-04-19 Thread Michael S. Tsirkin
g Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- It's good in theory, but could one of RPMSG maintainers please review and ack this patch? Or even better test it? All these barriers are useless on Intel anyway ... include/linux/virtio_ring.h | 4 ++-- 1 file changed, 2 insertio

  1   2   3   4   5   6   7   8   9   10   >