Re: [PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted

2019-10-16 Thread Jason Wang
On 2019/10/15 下午3:35, Christoph Hellwig wrote: On Fri, Oct 11, 2019 at 06:25:19PM -0700, Ram Pai wrote: From: Thiago Jung Bauermann Normally, virtio enables DMA API with VIRTIO_F_IOMMU_PLATFORM, which must be set by both device and guest driver. However, as a hack, when DMA API returns

Re: read_barrier_depends() usage in vhost.c

2019-10-16 Thread Jason Wang
On 2019/10/17 上午7:33, Will Deacon wrote: Hi all, In an attempt to remove the remaining traces of [smp_]read_barrier_depends() following my previous patches to strengthen READ_ONCE() for Alpha [1], I ended up trying to decipher the read_barrier_depends() usage in the vhost driver: --->8 //

Re: [PATCH V3 0/7] mdev based hardware virtio offloading support

2019-10-16 Thread Jason Wang
On 2019/10/15 下午10:37, Stefan Hajnoczi wrote: On Tue, Oct 15, 2019 at 11:37:17AM +0800, Jason Wang wrote: On 2019/10/15 上午1:49, Stefan Hajnoczi wrote: On Fri, Oct 11, 2019 at 04:15:50PM +0800, Jason Wang wrote: There are hardware that can do virtio datapath offloading while having its own

Re: read_barrier_depends() usage in vhost.c

2019-10-16 Thread Will Deacon
[Bah: I typoed the LKML address, so I've fixed it for this one] On Thu, Oct 17, 2019 at 12:33:40AM +0100, Will Deacon wrote: > Hi all, > > In an attempt to remove the remaining traces of [smp_]read_barrier_depends() > following my previous patches to strengthen READ_ONCE() for Alpha [1], I >

read_barrier_depends() usage in vhost.c

2019-10-16 Thread Will Deacon
Hi all, In an attempt to remove the remaining traces of [smp_]read_barrier_depends() following my previous patches to strengthen READ_ONCE() for Alpha [1], I ended up trying to decipher the read_barrier_depends() usage in the vhost driver: --->8 // drivers/vhost/vhost.c static int

Re: [PATCH V3 4/7] mdev: introduce device specific ops

2019-10-16 Thread Alex Williamson
On Wed, 16 Oct 2019 20:48:06 + Parav Pandit wrote: > > From: Alex Williamson > > On Wed, 16 Oct 2019 15:31:25 + > > Parav Pandit wrote: > > > > From: Cornelia Huck > > > > Parav Pandit wrote: > > > > > > From: Alex Williamson > > > > > > On Tue, 15 Oct 2019 20:17:01 +0800 Jason Wang

Re: [PATCH V3 4/7] mdev: introduce device specific ops

2019-10-16 Thread Alex Williamson
On Wed, 16 Oct 2019 15:31:25 + Parav Pandit wrote: > > -Original Message- > > From: Cornelia Huck > > Sent: Wednesday, October 16, 2019 3:53 AM > > To: Parav Pandit > > Cc: Alex Williamson ; Jason Wang > > ; k...@vger.kernel.org; linux-s...@vger.kernel.org; > >

Re: [PATCH] vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt'

2019-10-16 Thread Stefan Hajnoczi
On Tue, Oct 15, 2019 at 05:00:51PM +0200, Stefano Garzarella wrote: > The 'work' field was introduced with commit 06a8fc78367d0 > ("VSOCK: Introduce virtio_vsock_common.ko") > but it is never used in the code, so we can remove it to save > memory allocated in the per-packet 'struct

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 16:09, Michal Hocko wrote: On Wed 16-10-19 15:55:00, David Hildenbrand wrote: On 16.10.19 15:45, Michal Hocko wrote: [...] There is state stored in the struct page. In other words this shouldn't be really different from HWPoison pages. I cannot find the code that is doing that and

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 16:03, Michal Hocko wrote: On Wed 16-10-19 15:45:06, David Hildenbrand wrote: On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 15:55:00, David Hildenbrand wrote: > On 16.10.19 15:45, Michal Hocko wrote: [...] > > There is state stored in the struct page. In other words this shouldn't > > be really different from HWPoison pages. I cannot find the code that is > > doing that and maybe we don't handle that.

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 15:45:06, David Hildenbrand wrote: > On 16.10.19 13:43, Michal Hocko wrote: > > On Thu 19-09-19 16:22:25, David Hildenbrand wrote: > > > virtio-mem wants to allow to offline memory blocks of which some parts > > > were unplugged, especially, to later offline and remove completely >

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 15:45, Michal Hocko wrote: On Wed 16-10-19 14:50:30, David Hildenbrand wrote: On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 15:45, Michal Hocko wrote: On Wed 16-10-19 14:50:30, David Hildenbrand wrote: On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 14:50:30, David Hildenbrand wrote: > On 16.10.19 13:43, Michal Hocko wrote: > > On Thu 19-09-19 16:22:25, David Hildenbrand wrote: > > > virtio-mem wants to allow to offline memory blocks of which some parts > > > were unplugged, especially, to later offline and remove completely >

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later offline and remove completely unplugged memory blocks. The important part is that PageOffline()

Re: [PATCH RFC v3 8/9] mm/memory_hotplug: Introduce offline_and_remove_memory()

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:47, Michal Hocko wrote: On Thu 19-09-19 16:22:27, 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

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later offline and remove completely unplugged memory blocks. The important part is that PageOffline()

Re: [PATCH 1/5] iommu: Implement iommu_put_resv_regions_simple()

2019-10-16 Thread Thierry Reding
On Wed, Sep 18, 2019 at 04:37:38PM +0100, Will Deacon wrote: > On Thu, Aug 29, 2019 at 01:17:48PM +0200, Thierry Reding wrote: > > From: Thierry Reding > > > > Implement a generic function for removing reserved regions. This can be > > used by drivers that don't do anything fancy with these

Re: [PATCH RFC v3 4/9] mm: Export alloc_contig_range() / free_contig_range()

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:20, Michal Hocko wrote: On Thu 19-09-19 16:22:23, David Hildenbrand wrote: A virtio-mem device wants to allocate memory from the memory region it manages in order to unplug it in the hypervisor - similar to a balloon driver. Also, it might want to plug previously unplugged

[PATCH v4 02/11] drm/shmem: switch shmem helper to _gem_object_funcs.mmap

2019-10-16 Thread Gerd Hoffmann
Switch gem shmem helper to the new mmap() workflow, from _driver.fops.mmap to _gem_object_funcs.mmap. v2: Fix vm_flags and vm_page_prot handling. Signed-off-by: Gerd Hoffmann Reviewed-by: Steven Price --- include/drm/drm_gem_shmem_helper.h | 6 ++

[PATCH v4 11/11] drm/vram: drop DRM_VRAM_MM_FILE_OPERATIONS

2019-10-16 Thread Gerd Hoffmann
Not needed any more because we don't have vram specific fops any more. DEFINE_DRM_GEM_FOPS() can be used instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Thomas Zimmermann --- include/drm/drm_gem_vram_helper.h | 18 -- drivers/gpu/drm/ast/ast_drv.c

[PATCH v4 05/11] drm/shmem: drop DEFINE_DRM_GEM_SHMEM_FOPS

2019-10-16 Thread Gerd Hoffmann
DEFINE_DRM_GEM_SHMEM_FOPS is identical to DEFINE_DRM_GEM_FOPS now, drop it. Signed-off-by: Gerd Hoffmann Acked-by: Rob Herring --- include/drm/drm_gem_shmem_helper.h | 26 - drivers/gpu/drm/cirrus/cirrus.c | 2 +- drivers/gpu/drm/panfrost/panfrost_drv.c |

Re: [PATCH RFC v3 8/9] mm/memory_hotplug: Introduce offline_and_remove_memory()

2019-10-16 Thread Michal Hocko
On Thu 19-09-19 16:22:27, 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 unplugged

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Thu 19-09-19 16:22:25, David Hildenbrand wrote: > virtio-mem wants to allow to offline memory blocks of which some parts > were unplugged, especially, to later offline and remove completely > unplugged memory blocks. The important part is that PageOffline() has > to remain set until the section

Re: [PATCH RFC v3 4/9] mm: Export alloc_contig_range() / free_contig_range()

2019-10-16 Thread Michal Hocko
On Thu 19-09-19 16:22:23, David Hildenbrand wrote: > A virtio-mem device wants to allocate memory from the memory region it > manages in order to unplug it in the hypervisor - similar to > a balloon driver. Also, it might want to plug previously unplugged > (allocated) memory and give it back to

Re: [PATCH V3 1/7] mdev: class id support

2019-10-16 Thread Jason Wang
On 2019/10/16 下午12:57, Parav Pandit wrote: -Original Message- From: Jason Wang Sent: Friday, October 11, 2019 3:16 AM To: k...@vger.kernel.org; linux-s...@vger.kernel.org; linux- ker...@vger.kernel.org; dri-de...@lists.freedesktop.org; intel- g...@lists.freedesktop.org;

Re: [RFC 2/2] vhost: IFC VF vdpa layer

2019-10-16 Thread Jason Wang
On 2019/10/16 上午9:30, Zhu Lingshan wrote: This commit introduced IFC VF operations for vdpa, which complys to vhost_mdev interfaces, handles IFC VF initialization, configuration and removal. Signed-off-by: Zhu Lingshan --- drivers/vhost/ifcvf/ifcvf_main.c | 541

Re: [RFC PATCH] drm/virtio: Export resource handles via DMA-buf API

2019-10-16 Thread Daniel Vetter
On Wed, Oct 16, 2019 at 12:19:02PM +0900, Tomasz Figa wrote: > On Wed, Oct 9, 2019 at 12:04 AM Daniel Vetter wrote: > > > > On Tue, Oct 08, 2019 at 07:49:39PM +0900, Tomasz Figa wrote: > > > On Tue, Oct 8, 2019 at 7:03 PM Daniel Vetter wrote: > > > > > > > > On Sat, Oct 05, 2019 at 02:41:54PM

Re: [PATCH V3 4/7] mdev: introduce device specific ops

2019-10-16 Thread Cornelia Huck
On Wed, 16 Oct 2019 05:50:08 + Parav Pandit wrote: > Hi Alex, > > > -Original Message- > > From: Alex Williamson > > Sent: Tuesday, October 15, 2019 12:27 PM > > To: Jason Wang > > Cc: Cornelia Huck ; k...@vger.kernel.org; linux- > > s...@vger.kernel.org;

Re: [RFC 1/2] vhost: IFC VF hardware operation layer

2019-10-16 Thread Jason Wang
On 2019/10/16 上午9:30, Zhu Lingshan wrote: + */ +#define IFCVF_TRANSPORT_F_START 28 +#define IFCVF_TRANSPORT_F_END 34 + +#define IFC_SUPPORTED_FEATURES \ + ((1ULL << VIRTIO_NET_F_MAC) | \ +(1ULL << VIRTIO_F_ANY_LAYOUT)| \

Re: [RFC 1/2] vhost: IFC VF hardware operation layer

2019-10-16 Thread Jason Wang
On 2019/10/16 上午9:30, Zhu Lingshan wrote: This commit introduced ifcvf_base layer, which handles IFC VF NIC hardware operations and configurations. It's better to describe the difference between ifc vf and virtio in the commit log or is there a open doc for this? Signed-off-by: Zhu

Re: [RFC 0/2] Intel IFC VF driver for vdpa

2019-10-16 Thread Jason Wang
On 2019/10/16 上午9:36, Zhu Lingshan wrote: failed to send to kvm list, resend, sorry for the inconvenience. THanks, BR Zhu Lingshan On 10/16/2019 9:30 AM, Zhu Lingshan wrote: Hi all:   This series intends to introduce Intel IFC VF NIC driver for Vhost Data Plane Acceleration.   Here comes two

Re: [PATCH RFC v3 0/9] virtio-mem: paravirtualized memory

2019-10-16 Thread David Hildenbrand
On 19.09.19 16:22, David Hildenbrand wrote: Long time no RFC! I finally had time to get the next version of the Linux driver side of virtio-mem into shape, incorporating ideas and feedback from previous discussions. This RFC is based on the series currently on the mm list: - [PATCH 0/3] Remove

RE: [PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted

2019-10-16 Thread Ram Pai
On Tue, Oct 15, 2019 at 09:35:01AM +0200, Christoph Hellwig wrote: > On Fri, Oct 11, 2019 at 06:25:19PM -0700, Ram Pai wrote: > > From: Thiago Jung Bauermann > > > > Normally, virtio enables DMA API with VIRTIO_F_IOMMU_PLATFORM, which must > > be set by both device and guest driver. However, as

Re: [RFC PATCH] drm/virtio: Export resource handles via DMA-buf API

2019-10-16 Thread Gerd Hoffmann
Hi, > up later when given a buffer index. But we would still need to make > the DMA-buf itself importable. For virtio-gpu I guess that would mean > returning an sg_table backed by the shadow buffer pages. The virtio-gpu driver in drm-misc-next supports dma-buf exports. cheers, Gerd