Re: [PATCH] vdpa_sim: do not reset IOTLB during device reset

2020-05-14 Thread Michael S. Tsirkin
On Thu, May 14, 2020 at 03:25:49PM +0800, Jason Wang wrote: > We reset IOTLB during device reset this breaks the assumption that the > mapping needs to be controlled via vDPA DMA ops explicitly in a > incremental way. So the networking will be broken after e.g a guest > reset. > > Fix this by not

Re: [PATCH v6] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-14 Thread Michael S. Tsirkin
On Thu, May 14, 2020 at 01:22:37PM +0530, Bharat Bhushan wrote: > Different endpoint can support different page size, probe > endpoint if it supports specific page size otherwise use > global page sizes. > > Device attached to domain should support a minimum of > domain supported page sizes. If de

Re: [PATCH v3 4/4] drm/virtio: Support virtgpu exported resources

2020-05-13 Thread Michael S. Tsirkin
On Wed, Mar 11, 2020 at 08:20:04PM +0900, David Stevens wrote: > Add support for UUID-based resource sharing mechanism to virtgpu. This > implements the new virtgpu commands and hooks them up to dma-buf's > get_uuid callback. > > Signed-off-by: David Stevens > --- > drivers/gpu/drm/virtio/virtgp

Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-12 Thread Michael S. Tsirkin
On Tue, May 05, 2020 at 03:00:04PM +0530, Bharat Bhushan wrote: > Different endpoint can support different page size, probe > endpoint if it supports specific page size otherwise use > global page sizes. > > Signed-off-by: Bharat Bhushan > --- > v4->v5: > - Rebase to Linux v5.7-rc4 > > v3->v4:

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-08 Thread Michael S. Tsirkin
On Fri, May 08, 2020 at 12:52:34PM -0400, Michael S. Tsirkin wrote: > On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione wrote: > > This sysctl can be set to either zero or one. When zero (the default) > > the system lets all users call userfaultfd with or without > >

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-08 Thread Michael S. Tsirkin
On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione wrote: > This sysctl can be set to either zero or one. When zero (the default) > the system lets all users call userfaultfd with or without > UFFD_USER_MODE_ONLY, modulo other access controls. When > unprivileged_userfaultfd_user_mode_only

Re: [EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 02:51:32PM +0200, Auger Eric wrote: > Hi, > > On 5/7/20 1:32 PM, Michael S. Tsirkin wrote: > > On Thu, May 07, 2020 at 11:24:29AM +, Bharat Bhushan wrote: > >> > >> > >>> -----Original Message- > >>> From: Mi

Re: [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory()

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 01:37:30PM +0200, David Hildenbrand wrote: > On 07.05.20 13:34, Michael S. Tsirkin wrote: > > On Thu, May 07, 2020 at 01:33:23PM +0200, David Hildenbrand wrote: > >>>> I get: > >>>> > >>>> error: sha1 information is

Re: [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory()

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 01:24:38PM +0200, David Hildenbrand wrote: > On 07.05.20 12:46, Michael S. Tsirkin wrote: > > On Thu, May 07, 2020 at 12:31:11PM +0200, David Hildenbrand wrote: > >> virtio-mem wants to offline and remove a memory block once it unplugged > >>

Re: [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory()

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 01:33:23PM +0200, David Hildenbrand wrote: > >> I get: > >> > >> error: sha1 information is lacking or useless (mm/memory_hotplug.c). > >> error: could not build fake ancestor > >> > >> which version is this against? Pls post patches on top of some tag > >> in Linus' tree if

Re: [EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 11:24:29AM +, Bharat Bhushan wrote: > > > > -Original Message- > > From: Michael S. Tsirkin > > Sent: Wednesday, May 6, 2020 5:53 AM > > To: Bharat Bhushan > > Cc: jean-phili...@linaro.org; j...@8bytes.org; jasow...@redhat

Re: [PATCH v3 00/15] virtio-mem: paravirtualized memory

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 12:31:04PM +0200, David Hildenbrand wrote: > This series is based on latest linux-next. The patches are located at: > https://github.com/davidhildenbrand/linux.git virtio-mem-v3 > > Patch #1 - #10 where contained in v2 and only contain minor modifications > (mostly smal

Re: [PATCH v3 05/15] mm: Allow to offline unmovable PageOffline() pages via MEM_GOING_OFFLINE

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 12:31:09PM +0200, David Hildenbrand wrote: > virtio-mem wants to allow to offline memory blocks of which some parts > were unplugged (allocated via alloc_contig_range()), especially, to later > offline and remove completely unplugged memory blocks. The important part > is th

Re: [PATCH v3 10/15] MAINTAINERS: Add myself as virtio-mem maintainer

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 12:31:14PM +0200, David Hildenbrand wrote: > Let's make sure patches/bug reports find the right person. > > Cc: "Michael S. Tsirkin" > Signed-off-by: David Hildenbrand Make this patch 2 in the series, or even squash into patch 1. > --- &

Re: [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory()

2020-05-07 Thread Michael S. Tsirkin
On Thu, May 07, 2020 at 12:31:11PM +0200, David Hildenbrand wrote: > virtio-mem wants to offline and remove a memory block once it unplugged > all subblocks (e.g., using alloc_contig_range()). Let's provide > an interface to do that from a driver. virtio-mem already supports to > offline partially

[PATCH v2] virtio_net: fix lockdep warning on 32 bit

2020-05-07 Thread Michael S. Tsirkin
down the warning by switching to u64_stats_update_begin_irqsave - that works by disabling interrupts on 32 bit only, is a NOP on 64 bit. Reported-by: Thomas Gleixner Suggested-by: Eric Dumazet Signed-off-by: Michael S. Tsirkin --- changes from v1: builds now. lightly tested drivers/ne

Re: [PATCH net-next 2/2] virtio-net: fix the XDP truesize calculation for mergeable buffers

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 04:21:15PM +0800, Jason Wang wrote: > > On 2020/5/6 下午3:37, Michael S. Tsirkin wrote: > > On Wed, May 06, 2020 at 02:16:33PM +0800, Jason Wang wrote: > > > We should not exclude headroom and tailroom when XDP is set. So this > > > patch

Re: performance bug in virtio net xdp

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 04:37:41PM +0800, Jason Wang wrote: > > On 2020/5/6 下午4:08, Michael S. Tsirkin wrote: > > So for mergeable bufs, we use ewma machinery to guess the correct buffer > > size. If we don't guess correctly, XDP has to do aggressive copies. > > >

Re: performance bug in virtio net xdp

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 10:37:57AM +0200, Jesper Dangaard Brouer wrote: > On Wed, 6 May 2020 04:08:27 -0400 > "Michael S. Tsirkin" wrote: > > > So for mergeable bufs, we use ewma machinery to guess the correct buffer > > size. If we don't guess correc

Re: [PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 04:19:40PM +0800, Jason Wang wrote: > > On 2020/5/6 下午3:53, Michael S. Tsirkin wrote: > > On Wed, May 06, 2020 at 02:16:32PM +0800, Jason Wang wrote: > > > We tried to reserve space for vnet header before > > > xdp.data_hard_start. But th

Re: [PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 04:34:36PM +0800, Jason Wang wrote: > > On 2020/5/6 下午4:21, Jesper Dangaard Brouer wrote: > > On Wed, 6 May 2020 14:16:32 +0800 > > Jason Wang wrote: > > > > > We tried to reserve space for vnet header before > > > xdp.data_hard_start. But this is useless since the packe

Re: [GIT PULL] vhost: fixes

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 11:25:46AM +0200, Stefano Garzarella wrote: > On Wed, May 06, 2020 at 03:19:55AM -0400, Michael S. Tsirkin wrote: > > On Wed, May 06, 2020 at 03:28:47AM +, Justin He wrote: > > > Hi Michael > > > > > > > -----Original Messag

performance bug in virtio net xdp

2020-05-06 Thread Michael S. Tsirkin
So for mergeable bufs, we use ewma machinery to guess the correct buffer size. If we don't guess correctly, XDP has to do aggressive copies. Problem is, xdp paths do not update the ewma at all, except sometimes with XDP_PASS. So whatever we happen to have before we attach XDP, will mostly stay aro

Re: [PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 02:16:32PM +0800, Jason Wang wrote: > We tried to reserve space for vnet header before > xdp.data_hard_start. But this is useless since the packet could be > modified by XDP which may invalidate the information stored in the > header and there's no way for XDP to know the ex

Re: [PATCH net-next 2/2] virtio-net: fix the XDP truesize calculation for mergeable buffers

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 02:16:33PM +0800, Jason Wang wrote: > We should not exclude headroom and tailroom when XDP is set. So this > patch fixes this by initializing the truesize from PAGE_SIZE when XDP > is set. > > Cc: Jesper Dangaard Brouer > Signed-off-by: Jason Wang Seems too aggressive, w

Re: [GIT PULL] vhost: fixes

2020-05-06 Thread Michael S. Tsirkin
On Wed, May 06, 2020 at 03:28:47AM +, Justin He wrote: > Hi Michael > > > -Original Message- > > From: Michael S. Tsirkin > > Sent: Monday, May 4, 2020 8:16 PM > > To: Linus Torvalds > > Cc: k...@vger.kernel.org; virtualizat...@lists.linux-founda

Re: [PATCH -next] vdpasim: remove unused variable 'ret'

2020-05-05 Thread Michael S. Tsirkin
On Fri, Apr 10, 2020 at 07:54:22PM +0800, YueHaibing wrote: > drivers/vdpa/vdpa_sim/vdpa_sim.c:92:6: warning: > variable ‘ret’ set but not used [-Wunused-but-set-variable] > > Signed-off-by: YueHaibing > --- Either this, or BUG_ON. Jason? > drivers/vdpa/vdpa_sim/vdpa_sim.c | 15 +++--

Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2020 at 03:00:04PM +0530, Bharat Bhushan wrote: > Different endpoint can support different page size, probe > endpoint if it supports specific page size otherwise use > global page sizes. > > Signed-off-by: Bharat Bhushan > --- > v4->v5: > - Rebase to Linux v5.7-rc4 > > v3->v4:

[PATCH] virtio_net: fix lockdep warning on 32 bit

2020-05-05 Thread Michael S. Tsirkin
32 bit only, is a NOP on 64 bit. Reported-by: Thomas Gleixner Suggested-by: Eric Dumazet Signed-off-by: Michael S. Tsirkin --- I'm not thrilled about this but this seems the best we can do for now. Completely untested. Thomas, can you pls let me know the config I need to trigger the wa

[GIT PULL] vhost: fixes

2020-05-04 Thread Michael S. Tsirkin
0b841030625cde5f784dd62aec72d6a766faae70: vhost: vsock: kick send_pkt worker once device is started (2020-05-02 10:28:21 -0400) virtio: fixes A couple of bug fixes. Signed-off-by: Michael S. Tsirkin

Re: [PATCH v4] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-05-04 Thread Michael S. Tsirkin
On Mon, May 04, 2020 at 01:48:34PM +0200, Cornelia Huck wrote: > On Thu, 30 Apr 2020 15:04:42 +0100 > Stefan Hajnoczi wrote: > > > A userspace process holding a file descriptor to a virtio_blk device can > > still invoke block_device_operations after hot unplug. This leads to a > > use-after-fre

Re: [PATCH] vhost: vsock: don't send pkt when vq is not started

2020-04-30 Thread Michael S. Tsirkin
6 PM > > > To: Justin He > > > Cc: Stefan Hajnoczi ; Michael S. Tsirkin > > > ; Jason Wang ; > > > k...@vger.kernel.org; virtualizat...@lists.linux-foundation.org; > > > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Kaly Xin > > > &

Re: [RFC/PATCH 1/1] virtio: Introduce MMIO ops

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 07:03:21PM +0530, Srivatsa Vaddagiri wrote: > * Jan Kiszka [2020-04-30 14:59:50]: > > > >I believe ivshmem2_virtio requires hypervisor to support PCI device > > >emulation > > >(for life-cycle management of VMs), which our hypervisor may not support. PCI is mostly just 2

Re: [PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 11:14:10AM +0100, Stefan Hajnoczi wrote: > On Thu, Apr 30, 2020 at 10:43:23AM +0200, Stefano Garzarella wrote: > > On Wed, Apr 29, 2020 at 05:53:45PM +0100, Stefan Hajnoczi wrote: > > > A userspace process holding a file descriptor to a virtio_blk device can > > > still invo

Re: [RFC/PATCH 0/1] virtio_mmio: hypervisor specific interfaces for MMIO

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 03:32:55PM +0530, Srivatsa Vaddagiri wrote: > The Type-1 hypervisor we are dealing with does not allow for MMIO transport. How about PCI then? -- MST

Re: [PATCH] vhost: fix default for vhost_iotlb

2020-04-29 Thread Michael S. Tsirkin
On Wed, Apr 29, 2020 at 04:23:04PM +0200, Arnd Bergmann wrote: > During randconfig build testing, I ran into a configuration that has > CONFIG_VHOST=m, CONFIG_VHOST_IOTLB=m and CONFIG_VHOST_RING=y, which > makes the iotlb implementation left out from vhost_ring, and in turn > leads to a link failur

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-29 Thread Michael S. Tsirkin
On Wed, Apr 29, 2020 at 12:26:43PM +0200, Jan Kiszka wrote: > On 29.04.20 12:20, Michael S. Tsirkin wrote: > > On Wed, Apr 29, 2020 at 03:39:53PM +0530, Srivatsa Vaddagiri wrote: > > > That would still not work I think where swiotlb is used for pass-thr > > > devices &g

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-29 Thread Michael S. Tsirkin
On Wed, Apr 29, 2020 at 03:39:53PM +0530, Srivatsa Vaddagiri wrote: > That would still not work I think where swiotlb is used for pass-thr devices > (when private memory is fine) as well as virtio devices (when shared memory is > required). So that is a separate question. When there are multiple u

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-29 Thread Michael S. Tsirkin
On Wed, Apr 29, 2020 at 03:14:10PM +0530, Srivatsa Vaddagiri wrote: > * Michael S. Tsirkin [2020-04-29 02:50:41]: > > > So it seems that with modern Linux, all one needs > > to do on x86 is mark the device as untrusted. > > It's already possible to do this with ACP

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-28 Thread Michael S. Tsirkin
On Wed, Apr 29, 2020 at 01:42:13PM +0800, Lu Baolu wrote: > On 2020/4/29 12:57, Michael S. Tsirkin wrote: > > On Wed, Apr 29, 2020 at 10:22:32AM +0800, Lu Baolu wrote: > > > On 2020/4/29 4:41, Michael S. Tsirkin wrote: > > > > On Tue, Apr 28, 2020 at 11:19:52PM +

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-28 Thread Michael S. Tsirkin
On Wed, Apr 29, 2020 at 10:22:32AM +0800, Lu Baolu wrote: > On 2020/4/29 4:41, Michael S. Tsirkin wrote: > > On Tue, Apr 28, 2020 at 11:19:52PM +0530, Srivatsa Vaddagiri wrote: > > > * Michael S. Tsirkin [2020-04-28 12:17:57]: > > > > > > > Okay, but how is

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-28 Thread Michael S. Tsirkin
On Tue, Apr 28, 2020 at 11:19:52PM +0530, Srivatsa Vaddagiri wrote: > * Michael S. Tsirkin [2020-04-28 12:17:57]: > > > Okay, but how is all this virtio specific? For example, why not allow > > separate swiotlbs for any type of device? > > For example, this might make se

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-28 Thread Michael S. Tsirkin
On Tue, Apr 28, 2020 at 05:09:18PM +0530, Srivatsa Vaddagiri wrote: > For better security, its desirable that a guest VM's memory is > not accessible to any entity that executes outside the context of > guest VM. In case of virtio, backend drivers execute outside the > context of guest VM and in ge

Re: [PATCH v2] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-28 Thread Michael S. Tsirkin
On Tue, Apr 28, 2020 at 04:57:15PM +0100, Stefan Hajnoczi wrote: > On Tue, Apr 28, 2020 at 11:25:07AM -0400, Michael S. Tsirkin wrote: > > On Tue, Apr 28, 2020 at 03:30:09PM +0100, Stefan Hajnoczi wrote: > > > A userspace process holding a file descriptor to a virtio_blk devi

Re: [PATCH v2] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-28 Thread Michael S. Tsirkin
On Tue, Apr 28, 2020 at 03:30:09PM +0100, Stefan Hajnoczi wrote: > A userspace process holding a file descriptor to a virtio_blk device can > still invoke block_device_operations after hot unplug. For example, a > program that has /dev/vdb open can call ioctl(HDIO_GETGEO) after hot > unplug to inv

[PULL] vhost: cleanups and fixes

2019-10-15 Thread Michael S. Tsirkin
245cdd9fbd396483d501db83047116e2530f245f: vhost/test: stop device before reset (2019-10-13 09:38:27 -0400) virtio: fixes Some minor bugfixes Signed-off-by: Michael S. Tsirkin Michael S

Re: [PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-15 Thread Michael S. Tsirkin
On Mon, Oct 14, 2019 at 09:43:25AM +0800, Jason Wang wrote: > > On 2019/10/13 上午4:27, Michael S. Tsirkin wrote: > > On Sat, Oct 12, 2019 at 03:28:49PM +0800, Jason Wang wrote: > > > On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: > > > > The idea is to support mu

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Michael S. Tsirkin
On Sun, Oct 13, 2019 at 03:29:34PM +0200, Jan Kiszka wrote: > On 13.10.19 14:20, Michael S. Tsirkin wrote: > > On Sun, Oct 13, 2019 at 02:01:03PM +0200, Jan Kiszka wrote: > >> On 13.10.19 13:52, Michael S. Tsirkin wrote: > >>> On Sun, Oct 13, 2019 at 11:03:30AM +0200,

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Michael S. Tsirkin
On Sun, Oct 13, 2019 at 02:01:03PM +0200, Jan Kiszka wrote: > On 13.10.19 13:52, Michael S. Tsirkin wrote: > > On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> Various changes in the recent kernel versions broke the bu

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Michael S. Tsirkin
On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: > From: Jan Kiszka > > Various changes in the recent kernel versions broke the build due to > missing function and header stubs. > > Signed-off-by: Jan Kiszka Thanks! I think it's already fixes in the vhost tree. That tree also includ

[PATCH RFC v4 3/5] vhost: batching fetches

2019-10-13 Thread Michael S. Tsirkin
With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2

[PATCH RFC v4 4/5] vhost/net: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 32

[PATCH RFC v4 1/5] vhost: option to fetch descriptors through an independent struct

2019-10-13 Thread Michael S. Tsirkin
x27;s been kept as simple as possible for ease of review. A follow-up patch gets us back the performance by adding batching. To simplify benchmarking, I kept the old code around so one can switch back and forth between old and new code. This will go away in the final submission. Signed-off-by: Mich

[PATCH RFC v4 0/5] vhost: ring format independence

2019-10-13 Thread Michael S. Tsirkin
in response to comment by Jason Wang - minor code tweaks Changes from v2: - fixed indirect descriptor batching reported by Jason Wang Changes from v1: - typo fixes Michael S. Tsirkin (5): vhost: option to fetch descriptors through an independent struct

[PATCH RFC v4 2/5] vhost/test: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 17

[PATCH RFC v4 5/5] vhost: last descriptor must have NEXT clear

2019-10-13 Thread Michael S. Tsirkin
fetch_buf already guarantees we exit on a descriptor without a NEXT flag. Add a BUG_ON statement to make sure we don't overflow the buffer in case of a bug. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vhost/vhos

[PATCH RFC v3 4/4] vhost/net: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 32

[PATCH RFC v3 3/4] vhost: batching fetches

2019-10-13 Thread Michael S. Tsirkin
With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2

[PATCH RFC v3 0/4] vhost: ring format independence

2019-10-13 Thread Michael S. Tsirkin
use new code: echo 1 > /sys/module/vhost_test/parameters/newcode or echo 1 > /sys/module/vhost_net/parameters/newcode Changes from v2: - fixed indirect descriptor batching Changes from v1: - typo fixes Michael S. Tsirkin (4): vhost: option to fetch descr

[PATCH RFC v3 2/4] vhost/test: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 17

[PATCH RFC v3 1/4] vhost: option to fetch descriptors through an independent struct

2019-10-13 Thread Michael S. Tsirkin
x27;s been kept as simple as possible for ease of review. A follow-up patch gets us back the performance by adding batching. To simplify benchmarking, I kept the old code around so one can switch back and forth between old and new code. This will go away in the final submission. Signed-off-by: Mich

Re: [PATCH net 0/2] vsock: don't allow half-closed socket in the host transports

2019-10-12 Thread Michael S. Tsirkin
On Fri, Oct 11, 2019 at 04:34:57PM +0200, Stefano Garzarella wrote: > On Fri, Oct 11, 2019 at 10:19:13AM -0400, Michael S. Tsirkin wrote: > > On Fri, Oct 11, 2019 at 03:07:56PM +0200, Stefano Garzarella wrote: > > > We are implementing a test suite for the VSOCK sockets

Re: [PATCH RFC v1 0/2] vhost: ring format independence

2019-10-12 Thread Michael S. Tsirkin
On Sat, Oct 12, 2019 at 03:31:50PM +0800, Jason Wang wrote: > > On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: > > So the idea is as follows: we convert descriptors to an > > independent format first, and process that converting to > > iov later. > > > > Th

Re: [PATCH RFC v1 2/2] vhost: batching fetches

2019-10-12 Thread Michael S. Tsirkin
On Sat, Oct 12, 2019 at 03:30:52PM +0800, Jason Wang wrote: > > On 2019/10/11 下午9:46, Michael S. Tsirkin wrote: > > With this patch applied, new and old code perform identically. > > > > Lots of extra optimizations are now possible, e.g. > > we can fetch multiple he

Re: [PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-12 Thread Michael S. Tsirkin
On Sat, Oct 12, 2019 at 03:28:49PM +0800, Jason Wang wrote: > > On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: > > The idea is to support multiple ring formats by converting > > to a format-independent array of descriptors. > > > > This costs extra cycles, but we

Re: [PATCH RFC v1 0/2] vhost: ring format independence

2019-10-12 Thread Michael S. Tsirkin
On Sat, Oct 12, 2019 at 04:15:42PM +0800, Jason Wang wrote: > > On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: > > So the idea is as follows: we convert descriptors to an > > independent format first, and process that converting to > > iov later. > > > > Th

[PATCH RFC v2 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-12 Thread Michael S. Tsirkin
can switch back and forth by writing into a module parameter. This will go away in the final submission. This patch causes a minor performance degradation, it's been kept as simple as possible for ease of review. Next patch gets us back the performance by adding batching. Signed-off-by: Mich

[PATCH RFC v2 2/2] vhost: batching fetches

2019-10-12 Thread Michael S. Tsirkin
With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2

[PATCH RFC v2 0/2] vhost: ring format independence

2019-10-12 Thread Michael S. Tsirkin
this first step is ready to go in is to batch indirect descriptors as well. Integrating into vhost-net is basically s/vhost_get_vq_desc/vhost_get_vq_desc_batch/ - or add a module parameter like I did in the test module. Changes from v1: - typo fixes Michael S. Tsirkin (2): vhost

Re: [PATCH net 2/2] vhost/vsock: don't allow half-closed socket in the host

2019-10-11 Thread Michael S. Tsirkin
On Fri, Oct 11, 2019 at 03:07:58PM +0200, Stefano Garzarella wrote: > vmci_transport never allowed half-closed socket on the host side. > In order to provide the same behaviour, we changed the > vhost_transport_stream_has_data() to return 0 (no data available) > if the peer (guest) closed the conne

Re: [PATCH net 1/2] vsock: add half-closed socket details in the implementation notes

2019-10-11 Thread Michael S. Tsirkin
On Fri, Oct 11, 2019 at 03:07:57PM +0200, Stefano Garzarella wrote: > vmci_transport never allowed half-closed socket on the host side. > Since we want to have the same behaviour across all transports, we > add a section in the "Implementation notes". > > Cc: Jorgen Hansen > Cc: Adit Ranadive >

Re: [PATCH net 0/2] vsock: don't allow half-closed socket in the host transports

2019-10-11 Thread Michael S. Tsirkin
On Fri, Oct 11, 2019 at 03:07:56PM +0200, Stefano Garzarella wrote: > We are implementing a test suite for the VSOCK sockets and we discovered > that vmci_transport never allowed half-closed socket on the host side. > > As Jorgen explained [1] this is due to the implementation of VMCI. > > Since

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-11 Thread Michael S. Tsirkin
On Fri, Oct 11, 2019 at 03:40:48PM +0200, Stefano Garzarella wrote: > On Sun, Sep 1, 2019 at 8:56 AM Michael S. Tsirkin wrote: > > On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: >

[PATCH RFC v1 2/2] vhost: batching fetches

2019-10-11 Thread Michael S. Tsirkin
With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2

[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-11 Thread Michael S. Tsirkin
can switch back and forth by writing into a module parameter. This will go away in the final submission. This patch causes a minor performance degradation, it's been kept as simple as possible for ease of review. Next patch gets us back the performance by adding batching. Signed-off-by: Mich

[PATCH RFC v1 0/2] vhost: ring format independence

2019-10-11 Thread Michael S. Tsirkin
. Michael S. Tsirkin (2): vhost: option to fetch descriptors through an independent struct vhost: batching fetches drivers/vhost/test.c | 19 ++- drivers/vhost/vhost.c | 333 +- drivers/vhost/vhost.h | 20 ++- 3 files changed, 365 insertions(+), 7

[PATCH] vhost/test: stop device before reset

2019-10-07 Thread Michael S. Tsirkin
When device stop was moved out of reset, test device wasn't updated to stop before reset, this resulted in a use after free. Fix by invoking stop appropriately. Fixes: b211616d7125 ("vhost: move -net specific code out") Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c

Re: [PATCH RFC net-next 2/2] drivers: net: virtio_net: Add tx_timeout function

2019-10-07 Thread Michael S. Tsirkin
On Sun, Oct 06, 2019 at 03:45:15PM -0300, jcfara...@gmail.com wrote: > From: Julio Faracco > > To enable dev_watchdog, virtio_net should have a tx_timeout defined > (.ndo_tx_timeout). This is only a skeleton to throw a warn message. It > notifies the event in some specific queue of device. This

Re: [PATCH RFC net-next 0/2] drivers: net: virtio_net: Implement

2019-10-07 Thread Michael S. Tsirkin
On Sun, Oct 06, 2019 at 03:45:13PM -0300, jcfara...@gmail.com wrote: > From: Julio Faracco > > Driver virtio_net is not handling error events for TX provided by > dev_watchdog. This event is reached when transmission queue is having > problems to transmit packets. To enable it, driver should ha

Re: [PATCH v11 0/6] mm / virtio: Provide support for unused page reporting

2019-10-01 Thread Michael S. Tsirkin
On Tue, Oct 01, 2019 at 09:21:46AM -0700, Alexander Duyck wrote: > I thought what Michal was asking for was what was the benefit of using the > boundary pointer. I added a bit up above and to the description for patch > 3 as on a 32G VM it adds up to about a 18% difference without factoring in > th

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

2019-09-27 Thread Michael S. Tsirkin
On Fri, Sep 27, 2019 at 09:17:56PM +0800, Jason Wang wrote: > > On 2019/9/27 下午8:46, Michael S. Tsirkin wrote: > > On Fri, Sep 27, 2019 at 08:17:47PM +0800, Jason Wang wrote: > > > On 2019/9/27 下午5:41, Michael S. Tsirkin wrote: > > > > On Fri, Sep 27, 2019 at 1

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

2019-09-27 Thread Michael S. Tsirkin
On Fri, Sep 27, 2019 at 08:17:47PM +0800, Jason Wang wrote: > > On 2019/9/27 下午5:41, Michael S. Tsirkin wrote: > > On Fri, Sep 27, 2019 at 11:27:12AM +0800, Jason Wang wrote: > > > On 2019/9/26 下午9:14, Tiwei Bie wrote: > > > > On Thu, Sep 26, 2019 at 04:35:18A

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

2019-09-27 Thread Michael S. Tsirkin
On Fri, Sep 27, 2019 at 11:27:12AM +0800, Jason Wang wrote: > > On 2019/9/26 下午9:14, Tiwei Bie wrote: > > On Thu, Sep 26, 2019 at 04:35:18AM -0400, Michael S. Tsirkin wrote: > > > On Thu, Sep 26, 2019 at 12:54:27PM +0800, Tiwei Bie wrote: > > [...] > > > >

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

2019-09-27 Thread Michael S. Tsirkin
On Fri, Sep 27, 2019 at 04:47:43PM +0800, Jason Wang wrote: > > On 2019/9/27 下午12:54, Tiwei Bie wrote: > > On Fri, Sep 27, 2019 at 11:46:06AM +0800, Jason Wang wrote: > > > On 2019/9/26 下午12:54, Tiwei Bie wrote: > > > > + > > > > +static long vhost_mdev_start(struct vhost_mdev *m) > > > > +{ > > >

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

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 09:14:39PM +0800, Tiwei Bie wrote: > > 4. Does device need to limit max ring size? > > 5. Does device need to limit max number of queues? > > I think so. It's helpful to have ioctls to report the max > ring size and max number of queues. Also, let's not repeat the vhost ne

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

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 12:54:27PM +0800, Tiwei Bie wrote: > This patch introduces a mdev based hardware vhost backend. > This backend is built on top of the same abstraction used > in virtio-mdev and provides a generic vhost interface for > userspace to accelerate the virtio devices in guest. > >

Re: [PATCH net-next] tuntap: Fallback to automq on TUNSETSTEERINGEBPF prog negative return

2019-09-25 Thread Michael S. Tsirkin
On Sun, Sep 22, 2019 at 03:46:19PM -0700, Matt Cover wrote: > Unless of course we can simply state via > documentation that any negative return > for which a define doesn't exist is > undefined behavior. In which case, > there is no old vs new behavior and > no need for an ioctl. Simply the > under

Re: [PATCH v10 3/6] mm: Introduce Reported pages

2019-09-23 Thread Michael S. Tsirkin
On Mon, Sep 23, 2019 at 05:47:24PM +0200, David Hildenbrand wrote: > On 23.09.19 17:45, David Hildenbrand wrote: > > On 23.09.19 17:37, Michael S. Tsirkin wrote: > >> On Mon, Sep 23, 2019 at 08:28:00AM -0700, Alexander Duyck wrote: > >>> On Mon, Sep 23, 2019

Re: [PATCH v10 3/6] mm: Introduce Reported pages

2019-09-23 Thread Michael S. Tsirkin
On Mon, Sep 23, 2019 at 05:45:29PM +0200, David Hildenbrand wrote: > On 23.09.19 17:37, Michael S. Tsirkin wrote: > > On Mon, Sep 23, 2019 at 08:28:00AM -0700, Alexander Duyck wrote: > >> On Mon, Sep 23, 2019 at 8:00 AM Michael S. Tsirkin wrote: > >>> > >&

Re: [PATCH v10 3/6] mm: Introduce Reported pages

2019-09-23 Thread Michael S. Tsirkin
On Mon, Sep 23, 2019 at 08:28:00AM -0700, Alexander Duyck wrote: > On Mon, Sep 23, 2019 at 8:00 AM Michael S. Tsirkin wrote: > > > > On Mon, Sep 23, 2019 at 07:50:15AM -0700, Alexander Duyck wrote: > > > > > +static inline void > > > > > +page_reporti

Re: [PATCH v10 3/6] mm: Introduce Reported pages

2019-09-23 Thread Michael S. Tsirkin
On Mon, Sep 23, 2019 at 07:50:15AM -0700, Alexander Duyck wrote: > > > +static inline void > > > +page_reporting_reset_boundary(struct zone *zone, unsigned int order, int > > > mt) > > > +{ > > > + int index; > > > + > > > + if (order < PAGE_REPORTING_MIN_ORDER) > > > + return;

Re: [PATCH v10 3/6] mm: Introduce Reported pages

2019-09-23 Thread Michael S. Tsirkin
On Wed, Sep 18, 2019 at 10:52:49AM -0700, Alexander Duyck wrote: > From: Alexander Duyck > > In order to pave the way for free page reporting in virtualized > environments we will need a way to get pages out of the free lists and > identify those pages after they have been returned. To accomplish

Re: [PATCH] vhost: It's better to use size_t for the 3rd parameter of vhost_exceeds_weight()

2019-09-23 Thread Michael S. Tsirkin
On Mon, Sep 23, 2019 at 03:46:41PM +0800, wangxu wrote: > From: Wang Xu > > Caller of vhost_exceeds_weight(..., total_len) in drivers/vhost/net.c > usually pass size_t total_len, which may be affected by rx/tx package. > > Signed-off-by: Wang Xu Puts a bit more pressure on the register file .

Re: [PATCH net-next] tuntap: Fallback to automq on TUNSETSTEERINGEBPF prog negative return

2019-09-22 Thread Michael S. Tsirkin
On Sun, Sep 22, 2019 at 10:43:19AM -0700, Matt Cover wrote: > On Sun, Sep 22, 2019 at 5:37 AM Michael S. Tsirkin wrote: > > > > On Fri, Sep 20, 2019 at 11:58:43AM -0700, Matthew Cover wrote: > > > Treat a negative return from a TUNSETSTEERINGEBPF bpf prog as a sig

Re: [PATCH net-next] tuntap: Fallback to automq on TUNSETSTEERINGEBPF prog negative return

2019-09-22 Thread Michael S. Tsirkin
On Fri, Sep 20, 2019 at 11:58:43AM -0700, Matthew Cover wrote: > Treat a negative return from a TUNSETSTEERINGEBPF bpf prog as a signal > to fallback to tun_automq_select_queue() for tx queue selection. > > Compilation of this exact patch was tested. > > For functional testing 3 additional printk

Re: [PATCH v10 5/6] virtio-balloon: Pull page poisoning config out of free page hinting

2019-09-18 Thread Michael S. Tsirkin
On Wed, Sep 18, 2019 at 10:53:05AM -0700, Alexander Duyck wrote: > From: Alexander Duyck > > Currently the page poisoning setting wasn't being enabled unless free page > hinting was enabled. However we will need the page poisoning tracking logic > as well for unused page reporting. As such pull i

Re: [RFC v4 0/3] vhost: introduce mdev based hardware backend

2019-09-18 Thread Michael S. Tsirkin
On Wed, Sep 18, 2019 at 01:51:21PM +0800, Jason Wang wrote: > > On 2019/9/17 下午6:58, Tiwei Bie wrote: > > On Tue, Sep 17, 2019 at 11:32:03AM +0800, Jason Wang wrote: > > > On 2019/9/17 上午9:02, Tiwei Bie wrote: > > > > This RFC is to demonstrate below ideas, > > > > > > > > a) Build vhost-mdev on

Re: [PATCH v6] virtio-fs: add virtiofs filesystem

2019-09-18 Thread Michael S. Tsirkin
ek Goyal > Signed-off-by: Miklos Szeredi Overall this looks ok to me. Handling full vq by a timer is really gross but it's correct - just terribly inefficient. I think you should add a MAINTAINERS entry though, we want virtualizat...@lists.linux-foundation.org Cc'd on pa

[PULL] vhost: a last minute revert

2019-09-14 Thread Michael S. Tsirkin
14 15:21:51 -0400) virtio: a last minute revert 32 bit build got broken by the latest defence in depth patch. Revert and we'll try again in the next cycle. Signed-off

Re: [PATCH] vhost: Fix compile time error

2019-09-14 Thread Michael S. Tsirkin
_1879' declared with attribute error: > BUILD_BUG_ON failed: sizeof(_s) > sizeof(long) > > Fixes: a89db445fbd7 ("vhost: block speculation of translated descriptors") > Cc: Michael S. Tsirkin > Cc: Jason Wang > Signed-off-by: Guenter Roeck > ---

<    5   6   7   8   9   10   11   12   13   14   >