Re: drm: qxl: what's going on

2018-04-19 Thread Gerd Hoffmann
On Fri, Apr 20, 2018 at 02:26:11AM -0400, Chunyu Hu wrote: > Hello, > > I am seeing qxl driver is not working in my kvm machine with kernel 4.17, > (4.16 failed too). I'd like to consult your expert is there a fix for it > now? https://www.kraxel.org/cgit/linux/log/?h=drm-qxl-release cheers,

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

2018-04-19 Thread Jason Wang
On 2018年04月20日 02:40, 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 may have different device interfaces. That is to say, we will need different drivers in QEMU. It could be troublesome. And t

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 > > > > > > may have different d

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

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Bie, Tiwei > Sent: Friday, April 20, 2018 11:28 AM > To: Michael S. Tsirkin > Cc: Jason Wang ; alex.william...@redhat.com; > ddut...@redhat.com; Duyck, Alexander H ; > virtio-...@lists.oasis-open.org; linux-ker...@vger.kernel.org; > k...@vger.kernel.org; virt

Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > +static struct net_device *failover_get_bymac(u8 *mac, struct failover_ops > **ops) > +{ > + struct net_device *failover_dev; > + struct failover *failover; > + > + spin_lock(&failover_lock); > + list_for_each_ent

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

2018-04-19 Thread Tiwei Bie
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 > > > > > may have different device interfaces. That is to say, we will > > > > > need different

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

2018-04-19 Thread Jason Wang
On 2018年04月20日 01: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 [mst@tuck linux]$ size drivers/virtio/virtio_ring.o textdata bss dec hex filename 11392 820 0 122

Re: [PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:03PM -0700, Sridhar Samudrala wrote: > @@ -3010,6 +3043,7 @@ static __init int virtio_net_driver_init(void) > ret = register_virtio_driver(&virtio_net_driver); > if (ret) > goto err_virtio; > + > return 0; > err_virtio: > cpuhp

Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > This provides a generic interface for paravirtual drivers to listen > for netdev register/unregister/link change events from pci ethernet > devices with the same MAC and takeover their datapath. The notifier and > event handling c

[PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-19 Thread Sridhar Samudrala
Use the registration/notification framework supported by the generic failover infrastructure. Signed-off-by: Sridhar Samudrala --- drivers/net/hyperv/Kconfig | 1 + drivers/net/hyperv/hyperv_net.h | 2 + drivers/net/hyperv/netvsc_drv.c | 208 ++-- 3 f

[PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Sridhar Samudrala
This provides a generic interface for paravirtual drivers to listen for netdev register/unregister/link change events from pci ethernet devices with the same MAC and takeover their datapath. The notifier and event handling code is based on the existing netvsc implementation. It exposes 2 sets of i

[PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-04-19 Thread Sridhar Samudrala
This patch enables virtio_net to switch over to a VF datapath when a VF netdev is present with the same MAC address. It allows live migration of a VM with a direct attached VF without the need to setup a bond/team between a VF and virtio net device in the guest. The hypervisor needs to enable only

[PATCH v7 net-next 1/4] virtio_net: Introduce VIRTIO_NET_F_STANDBY feature bit

2018-04-19 Thread Sridhar Samudrala
This feature bit can be used by hypervisor to indicate virtio_net device to act as a standby for another device with the same MAC address. VIRTIO_NET_F_STANDBY is defined as bit 62 as it is a device feature bit. Signed-off-by: Sridhar Samudrala --- drivers/net/virtio_net.c| 2 +- includ

[PATCH net-next v7 0/4] Enable virtio_net to act as a standby for a passthru device

2018-04-19 Thread Sridhar Samudrala
The main motivation for this patch is to enable cloud service providers to provide an accelerated datapath to virtio-net enabled VMs in a transparent manner with no/minimal guest userspace changes. This also enables hypervisor controlled live migration to be supported with VMs that have direct att

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

2018-04-19 Thread Andrew Morton
On Thu, 19 Apr 2018 17:19:20 -0400 (EDT) Mikulas Patocka wrote: > > > In order to detect these bugs reliably I submit this patch that changes > > > kvmalloc to always use vmalloc if CONFIG_DEBUG_VM is turned on. > > > > > > ... > > > > > > --- linux-2.6.orig/mm/util.c 2018-04-18 15:46:23.0

[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG

2018-04-19 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Michael S. Tsirkin wrote: > Maybe make it conditional on CONFIG_DEBUG_SG too? > Otherwise I think you just trigger a hard to debug memory corruption. OK, here I resend the patch with CONFIG_DEBUG_SG. With CONFIG_DEBUG_SG, the DMA API will print a stacktrace where the misus

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

2018-04-19 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Andrew Morton wrote: > On Thu, 19 Apr 2018 12:12:38 -0400 (EDT) Mikulas Patocka > wrote: > > > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > > kmalloc fails. > > > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > > use

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

2018-04-19 Thread Andrew Morton
On Thu, 19 Apr 2018 12:12:38 -0400 (EDT) Mikulas Patocka wrote: > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > kmalloc fails. > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > uses DMA-API on the returned memory or frees it with kfree. Such

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 patch

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

2018-04-19 Thread Vlastimil Babka
On 04/19/2018 06:12 PM, Mikulas Patocka wrote: > From: Mikulas Patocka > Subject: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM > > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > kmalloc fails. > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc

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_notify > >> (drivers/virtio/virtio_mmio.c). > >

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

2018-04-19 Thread Paolo Bonzini
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_notify >> (drivers/virtio/virtio_mmio.c). >> >> Thanks, >> >> Paolo > That one uses weak barriers AFAIK. > > IIUC y

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 > > > > [mst@tuck linux]$ size drivers/virtio/virtio_rin

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

2018-04-19 Thread Paolo Bonzini
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 > > [mst@tuck linux]$ size drivers/virtio/virtio_ring.o >textdata bss dec hex filename > 11392 820

[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg

2018-04-19 Thread Michael S. Tsirkin
virtio is using barriers to order memory accesses, thus dma_wmb/rmb is a good match. Build-tested on x86: Before [mst@tuck linux]$ size drivers/virtio/virtio_ring.o textdata bss dec hex filename 11392 820 0 122122fb4 drivers/virtio/virtio_ring.o After mst@tuc

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

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 12:12:38PM -0400, Mikulas Patocka wrote: > > > On Wed, 18 Apr 2018, Mikulas Patocka wrote: > > > > > > > On Wed, 18 Apr 2018, David Miller wrote: > > > > > From: Mikulas Patocka > > > Date: Wed, 18 Apr 2018 12:44:25 -0400 (EDT) > > > > > > > The structure net_device

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

2018-04-19 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Eric Dumazet wrote: > > > On 04/19/2018 09:12 AM, Mikulas Patocka wrote: > > > > > > These bugs are hard to reproduce because vmalloc falls back to kmalloc > > only if memory is fragmented. > > > > This sentence is wrong. > > because kvmalloc() falls back to vmal

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

2018-04-19 Thread Eric Dumazet
On 04/19/2018 09:12 AM, Mikulas Patocka wrote: > > > These bugs are hard to reproduce because vmalloc falls back to kmalloc > only if memory is fragmented. > This sentence is wrong. because kvmalloc() falls back to vmalloc() ... ___ Virtualiz

[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Mikulas Patocka
On Wed, 18 Apr 2018, Mikulas Patocka wrote: > > > On Wed, 18 Apr 2018, David Miller wrote: > > > From: Mikulas Patocka > > Date: Wed, 18 Apr 2018 12:44:25 -0400 (EDT) > > > > > The structure net_device is followed by arbitrary driver-specific data > > > (accessible with the function netdev

Re: [PATCH v2 net 2/3] virtio_net: fix adding vids on big-endian

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 03:26:41PM +0200, Cornelia Huck wrote: > On Thu, 19 Apr 2018 08:30:49 +0300 > "Michael S. Tsirkin" wrote: > > > Programming vids (adding or removing them) still passes > > guest-endian values in the DMA buffer. That's wrong > > if guest is big-endian and when virtio 1 is e

Re: [PATCH v2 net 2/3] virtio_net: fix adding vids on big-endian

2018-04-19 Thread Cornelia Huck
On Thu, 19 Apr 2018 08:30:49 +0300 "Michael S. Tsirkin" wrote: > Programming vids (adding or removing them) still passes > guest-endian values in the DMA buffer. That's wrong > if guest is big-endian and when virtio 1 is enabled. > > Note: this is on top of a previous patch: > virtio_net:

Re: [PATCH v2 net 2/3] virtio_net: fix adding vids on big-endian

2018-04-19 Thread Jason Wang
On 2018年04月19日 13:30, Michael S. Tsirkin wrote: Programming vids (adding or removing them) still passes guest-endian values in the DMA buffer. That's wrong if guest is big-endian and when virtio 1 is enabled. Note: this is on top of a previous patch: virtio_net: split out ctrl buffer

Re: [PATCH v2 net 3/3] virtio_net: sparse annotation fix

2018-04-19 Thread Jason Wang
On 2018年04月19日 13:30, Michael S. Tsirkin wrote: offloads is a buffer in virtio format, should use the __virtio64 tag. Signed-off-by: Michael S. Tsirkin --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/vi

Re: [PATCH v2 net 1/3] virtio_net: split out ctrl buffer

2018-04-19 Thread Jason Wang
On 2018年04月19日 13:30, Michael S. Tsirkin wrote: When sending control commands, virtio net sets up several buffers for DMA. The buffers are all part of the net device which means it's actually allocated by kvmalloc so it's in theory (on extreme memory pressure) possible to get a vmalloc'ed buffe

Re: [PATCH net] virtio_net: split out ctrl buffer

2018-04-19 Thread kbuild test robot
Hi Michael, I love your patch! Yet something to improve: [auto build test ERROR on net/master] url: https://github.com/0day-ci/linux/commits/Michael-S-Tsirkin/virtio_net-split-out-ctrl-buffer/20180419-145754 config: i386-randconfig-a0-201815 (attached as .config) compiler: gcc-4.9 (Debian

Re: [PATCH net] virtio_net: split out ctrl buffer

2018-04-19 Thread kbuild test robot
Hi Michael, I love your patch! Yet something to improve: [auto build test ERROR on net/master] url: https://github.com/0day-ci/linux/commits/Michael-S-Tsirkin/virtio_net-split-out-ctrl-buffer/20180419-145754 config: x86_64-randconfig-x006-201815 (attached as .config) compiler: gcc-7 (Debian

Re: [RFC PATCH net-next v6 2/4] net: Introduce generic bypass module

2018-04-19 Thread Jiri Pirko
Thu, Apr 19, 2018 at 06:08:58AM CEST, m...@redhat.com wrote: >On Wed, Apr 18, 2018 at 10:32:06PM +0200, Jiri Pirko wrote: >> >> >> > With regards to alternate names for 'active', you suggested >> >> >> > 'stolen', but i >> >> >> > am not too happy with it. >> >> >> > netvsc uses vf_netdev, are you