Re: [PATCH] vdpa/mlx5: Use write memory barrier after updating CQ index

2020-12-09 Thread Michael S. Tsirkin
On Wed, Dec 09, 2020 at 08:58:46AM +0200, Eli Cohen wrote: > On Wed, Dec 09, 2020 at 01:46:22AM -0500, Michael S. Tsirkin wrote: > > On Wed, Dec 09, 2020 at 08:02:30AM +0200, Eli Cohen wrote: > > > On Tue, Dec 08, 2020 at 04:45:04PM -0500, Michael S. Tsirkin wrote: > > > > On Sun, Dec 06, 2020 at 1

Re: [PATCH RESEND v2] virtio-input: add multi-touch support

2020-12-09 Thread Michael S. Tsirkin
On Tue, Dec 08, 2020 at 11:01:50PM +0200, Vasyl Vavrychuk wrote: > From: Mathias Crombez > Cc: sta...@vger.kernel.org I don't believe this is appropriate for stable, looks like a new feature to me. > > Without multi-touch slots allocated, ABS_MT_SLOT events will be lost by > input_handle_abs_e

Re: Howto listen to/handle gpio state changes ? Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-09 Thread Linus Walleij
On Tue, Dec 8, 2020 at 3:07 PM Enrico Weigelt, metux IT consult wrote: > I've been looking for some more direct notification callback for gpio > consumers: here the consumer would register itself as a listener on > some gpio_desc and called back when something changes (with data what > exactly ch

Re: [RFC PATCH 00/27] vDPA software assisted live migration

2020-12-09 Thread Jason Wang
- Original Message - > On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote: > > This series enable vDPA software assisted live migration for vhost-net > > devices. This is a new method of vhost devices migration: Instead of > > relay on vDPA device's dirty logging capability, SW a

Re: [PATCH net-next] tun: fix ubuf refcount incorrectly on error path

2020-12-09 Thread Jason Wang
On 2020/12/8 上午10:32, Jason Wang wrote: On 2020/12/7 下午9:38, wangyunjian wrote: I think the newly added code is easy to miss this problem, so I want to copy ubuf_info until we're sure there's no errors. Thanks, Yunjian But isn't this actually a disabling of zerocopy? Thanks Sorry, I m

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-09 Thread Jason Wang
On 2020/12/8 下午3:02, Enrico Weigelt, metux IT consult wrote: On 08.12.20 03:36, Jason Wang wrote: Hi, So we endup with two solutions (without a prompt): 1) using select, user may end up with driver without transport IMHO not an entirely unusual situation in other places of the kernel, eg. o

Re: [PATCH v3 05/19] vdpa_sim: remove the limit of IOTLB entries

2020-12-09 Thread Stefano Garzarella
On Mon, Dec 07, 2020 at 12:00:07PM +0800, Jason Wang wrote: On 2020/12/4 上午1:04, Stefano Garzarella wrote: The simulated devices can support multiple queues, so this limit should be defined according to the number of queues supported by the device. Since we are in a simulator, let's simply rem

Re: [PATCH v3 13/19] vdpa_sim: add get_config callback in vdpasim_dev_attr

2020-12-09 Thread Stefano Garzarella
On Mon, Dec 07, 2020 at 01:29:17PM +0800, Jason Wang wrote: On 2020/12/4 上午1:05, Stefano Garzarella wrote: The get_config callback can be used by the device to fill the config structure. The callback will be invoked in vdpasim_get_config() before copying bytes into caller buffer. Move vDPA-net

Re: [PATCH] vdpa/mlx5: Use write memory barrier after updating CQ index

2020-12-09 Thread Michael S. Tsirkin
On Wed, Dec 09, 2020 at 11:38:36AM +0200, Eli Cohen wrote: > On Wed, Dec 09, 2020 at 03:05:42AM -0500, Michael S. Tsirkin wrote: > > On Wed, Dec 09, 2020 at 08:58:46AM +0200, Eli Cohen wrote: > > > On Wed, Dec 09, 2020 at 01:46:22AM -0500, Michael S. Tsirkin wrote: > > > > On Wed, Dec 09, 2020 at 0

Re: [PATCH net] vhost_net: fix high cpu load when sendmsg fails

2020-12-09 Thread Michael S. Tsirkin
On Wed, Dec 09, 2020 at 07:48:24PM +0800, wangyunjian wrote: > From: Yunjian Wang > > Currently we break the loop and wake up the vhost_worker when > sendmsg fails. When the worker wakes up again, we'll meet the > same error. This will cause high CPU load. To fix this issue, > we can skip this de

Re: Howto listen to/handle gpio state changes ? Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-09 Thread Linus Walleij
On Wed, Dec 9, 2020 at 12:19 PM Arnd Bergmann wrote: > On Wed, Dec 9, 2020 at 9:51 AM Linus Walleij wrote: > > On Tue, Dec 8, 2020 at 3:07 PM Enrico Weigelt, metux IT consult > > wrote: > > > What we need to understand is if your new usecase is an outlier > > so it is simplest modeled by a "moc

Re: [PATCH v2 05/12] x86: rework arch_local_irq_restore() to not use popf

2020-12-09 Thread Mark Rutland
On Sun, Nov 22, 2020 at 01:44:53PM -0800, Andy Lutomirski wrote: > On Sat, Nov 21, 2020 at 10:55 PM Jürgen Groß wrote: > > > > On 20.11.20 12:59, Peter Zijlstra wrote: > > > On Fri, Nov 20, 2020 at 12:46:23PM +0100, Juergen Gross wrote: > > >> +static __always_inline void arch_local_irq_restore(un

Re: [PATCH v2 05/12] x86: rework arch_local_irq_restore() to not use popf

2020-12-09 Thread Mark Rutland
On Wed, Dec 09, 2020 at 01:27:10PM +, Mark Rutland wrote: > On Sun, Nov 22, 2020 at 01:44:53PM -0800, Andy Lutomirski wrote: > > On Sat, Nov 21, 2020 at 10:55 PM Jürgen Groß wrote: > > > On 20.11.20 12:59, Peter Zijlstra wrote: > > > > If someone were to write horrible code like: > > > > > > >

Re: [PATCH v2 05/12] x86: rework arch_local_irq_restore() to not use popf

2020-12-09 Thread Jürgen Groß via Virtualization
On 09.12.20 15:02, Mark Rutland wrote: On Wed, Dec 09, 2020 at 01:27:10PM +, Mark Rutland wrote: On Sun, Nov 22, 2020 at 01:44:53PM -0800, Andy Lutomirski wrote: On Sat, Nov 21, 2020 at 10:55 PM Jürgen Groß wrote: On 20.11.20 12:59, Peter Zijlstra wrote: If someone were to write horrible

[PATCH v3 1/8] drm/ast: Don't pin cursor source BO explicitly during update

2020-12-09 Thread Thomas Zimmermann
Vmapping the cursor source BO contains an implicit pin operation, so there's no need to do this manually. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ast/ast_cursor.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers

[PATCH v3 2/8] drm/ast: Only map cursor BOs during updates

2020-12-09 Thread Thomas Zimmermann
The HW cursor's BO used to be mapped permanently into the kernel's address space. GEM's vmap operation will be protected by locks, and we don't want to lock the BO's for an indefinate period of time. Change the cursor code to map the HW BOs only during updates. The vmap operation in VRAM helpers i

[PATCH v3 3/8] dma-buf: Add vmap_local and vnumap_local operations

2020-12-09 Thread Thomas Zimmermann
The existing dma-buf calls dma_buf_vmap() and dma_buf_vunmap() are allowed to pin the buffer or acquire the buffer's reservation object lock. This is a problem for callers that only require a short-term mapping of the buffer without the pinning, or callers that have special locking requirements. T

[PATCH v3 7/8] drm/vram-helper: Provide a vmap function for short-term mappings

2020-12-09 Thread Thomas Zimmermann
Implementations of the vmap/vunmap GEM callbacks may perform pinning of the BO and may acquire the associated reservation object's lock. It's somewhat inconvenient to callers that simply require a mapping of the contained memory; and also ipmplies a certain overhead. Therefore provide drm_gem_vram

[PATCH v3 4/8] drm/gem: Create infrastructure for GEM vmap_local

2020-12-09 Thread Thomas Zimmermann
This patch adds vmap_local and vunmap_local to struct drm_gem_object_funcs; including the PRIME helpers to connect with dma-buf's related interfaces. Besides the generic DRM core, this will become relevant for fbdev emulation with virtio, so we update it as well. Signed-off-by: Thomas Zimmermann

[PATCH v3 0/8] drm: Support short-term vmap via vmap_local

2020-12-09 Thread Thomas Zimmermann
(was: drm/vram-helper: Lock GEM BOs while they are mapped) GEM VRAM helpers used to pin the BO in their implementation of vmap, so that they could not be relocated. In recent discussions, [1][2] it became clear that this is incorrect for in-kernel use cases, such as fbdev emulation; which should r

[PATCH v3 6/8] drm/shmem-helper: Provide a vmap function for short-term mappings

2020-12-09 Thread Thomas Zimmermann
Implementations of the vmap/vunmap GEM callbacks may perform pinning of the BO and may acquire the associated reservation object's lock. Callers that only require a mapping of the contained memory can thus interfere with other tasks that require exact pinning, such as scanout. This is less of an is

[PATCH v3 8/8] drm/fb-helper: Move BO locking from DRM client to fbdev damage worker

2020-12-09 Thread Thomas Zimmermann
Fbdev emulation has to lock the BO into place while flushing the shadow buffer into the BO's memory. Remove any interference with pinning by using vmap_local functionality (instead of full vmap). This requires BO reservation locking in fbdev's damage worker. The new DRM client functions for lockin

[PATCH v3 5/8] drm/cma-helper: Provide a vmap function for short-term mappings

2020-12-09 Thread Thomas Zimmermann
Implementations of the vmap/vunmap GEM callbacks may perform pinning of the BO and may acquire the associated reservation object's lock. Callers that only require a mapping of the contained memory can thus interfere with other tasks that require exact pinning, such as scanout. This is less of an is

Re: [PATCH v3 3/8] dma-buf: Add vmap_local and vnumap_local operations

2020-12-09 Thread Thomas Zimmermann
Hi Am 09.12.20 um 15:25 schrieb Thomas Zimmermann: The existing dma-buf calls dma_buf_vmap() and dma_buf_vunmap() are allowed to pin the buffer or acquire the buffer's reservation object lock. This is a problem for callers that only require a short-term mapping of the buffer without the pinning

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-09 Thread Willem de Bruijn
On Wed, Dec 9, 2020 at 8:03 AM wangyunjian wrote: > > From: Yunjian Wang > > After setting callback for ubuf_info of skb, the callback > (vhost_net_zerocopy_callback) will be called to decrease > the refcount when freeing skb. But when an exception occurs With exception, you mean if tun_get_user

Re: [RFC PATCH 00/27] vDPA software assisted live migration

2020-12-09 Thread Stefan Hajnoczi
On Wed, Dec 09, 2020 at 04:26:50AM -0500, Jason Wang wrote: > - Original Message - > > On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote: > > > This series enable vDPA software assisted live migration for vhost-net > > > devices. This is a new method of vhost devices migration:

Re: [RFC PATCH 0/8] vhost: allow userspace to control vq cpu affinity

2020-12-09 Thread Stefano Garzarella
Hi Mike, sorry for the delay but there were holidays. On Fri, Dec 04, 2020 at 11:33:11AM -0600, Mike Christie wrote: On 12/4/20 11:10 AM, Mike Christie wrote: On 12/4/20 10:06 AM, Stefano Garzarella wrote: Hi Mike, On Fri, Dec 04, 2020 at 01:56:25AM -0600, Mike Christie wrote: These patches

Re: [RFC PATCH 04/27] vhost: add vhost_kernel_set_vring_enable

2020-12-09 Thread Stefan Hajnoczi
On Wed, Dec 09, 2020 at 01:00:19PM +0100, Eugenio Perez Martin wrote: > On Mon, Dec 7, 2020 at 5:43 PM Stefan Hajnoczi wrote: > > > > On Fri, Nov 20, 2020 at 07:50:42PM +0100, Eugenio Pérez wrote: > > > Signed-off-by: Eugenio Pérez > > > --- > > > hw/virtio/vhost-backend.c | 29 +

Re: [PATCH v2 13/20] drm/nouveau: Remove references to struct drm_device.pdev

2020-12-09 Thread Jeremy Cline
Hi, On Tue, Dec 01, 2020 at 11:35:35AM +0100, Thomas Zimmermann wrote: > Using struct drm_device.pdev is deprecated. Convert nouveau to struct > drm_device.dev. No functional changes. > > Signed-off-by: Thomas Zimmermann > Cc: Ben Skeggs > --- > drivers/gpu/drm/nouveau/dispnv04/arb.c | 12

Re: [PATCH v2 05/12] x86: rework arch_local_irq_restore() to not use popf

2020-12-09 Thread Mark Rutland
On Fri, Nov 20, 2020 at 12:59:43PM +0100, Peter Zijlstra wrote: > On Fri, Nov 20, 2020 at 12:46:23PM +0100, Juergen Gross wrote: > > +static __always_inline void arch_local_irq_restore(unsigned long flags) > > +{ > > + if (!arch_irqs_disabled_flags(flags)) > > + arch_local_irq_enable();

Re: [PATCH v2 05/12] x86: rework arch_local_irq_restore() to not use popf

2020-12-09 Thread Thomas Gleixner
On Wed, Dec 09 2020 at 18:15, Mark Rutland wrote: > In arch/x86/kernel/apic/io_apic.c's timer_irq_works() we do: > > local_irq_save(flags); > local_irq_enable(); > > [ trigger an IRQ here ] > > local_irq_restore(flags); > > ... and in check_timer() we call that a number of t

Re: [PATCH v2 03/12] x86/pv: switch SWAPGS to ALTERNATIVE

2020-12-09 Thread Thomas Gleixner
On Fri, Nov 20 2020 at 12:46, Juergen Gross wrote: > SWAPGS is used only for interrupts coming from user mode or for > returning to user mode. So there is no reason to use the PARAVIRT > framework, as it can easily be replaced by an ALTERNATIVE depending > on X86_FEATURE_XENPV. > > There are severa

Re: [PATCH v3 05/19] vdpa_sim: remove the limit of IOTLB entries

2020-12-09 Thread Jason Wang
On 2020/12/9 下午6:58, Stefano Garzarella wrote: On Mon, Dec 07, 2020 at 12:00:07PM +0800, Jason Wang wrote: On 2020/12/4 上午1:04, Stefano Garzarella wrote: The simulated devices can support multiple queues, so this limit should be defined according to the number of queues supported by the devic