Re: [PATCH 05/10] s390/cio: introduce DMA pools to cio

2019-05-08 Thread Halil Pasic
On Wed, 8 May 2019 15:18:10 +0200 (CEST) Sebastian Ott wrote: > > +void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size) > > +{ > > + if (!cpu_addr) > > + return; > > + memset(cpu_addr, 0, size); > > Hm, normally I'd do the memset during alloc not during free

Re: [PATCH 06/10] s390/cio: add basic protected virtualization support

2019-05-08 Thread Halil Pasic
On Wed, 8 May 2019 15:46:42 +0200 (CEST) Sebastian Ott wrote: > > On Fri, 26 Apr 2019, Halil Pasic wrote: > > static struct ccw_device * io_subchannel_allocate_dev(struct subchannel > > *sch) > > { > [..] > > + cdev->private = kzalloc(sizeof(struct ccw_device_private), > > +

Re: [PATCH 01/10] virtio/s390: use vring_create_virtqueue

2019-05-08 Thread Halil Pasic
On Tue, 7 May 2019 15:58:12 +0200 Christian Borntraeger wrote: > > > On 05.05.19 13:15, Cornelia Huck wrote: > > On Sat, 4 May 2019 16:03:40 +0200 > > Halil Pasic wrote: > > > >> On Fri, 3 May 2019 16:04:48 -0400 > >> "Michael S. Tsirkin" wrote: > >> > >>> On Fri, May 03, 2019 at 11:17:24AM

Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver

2019-05-08 Thread Pankaj Gupta
> > > > > +int virtio_pmem_flush(struct nd_region *nd_region) > > > +{ > > > +int err; > > > +unsigned long flags; > > > +struct scatterlist *sgs[2], sg, ret; > > > +struct virtio_device *vdev = nd_region->provider_data; > > > +struct virtio_pmem *vpmem =

Re: [PATCH 07/10] s390/airq: use DMA memory for adapter interrupts

2019-05-08 Thread Sebastian Ott
On Fri, 26 Apr 2019, Halil Pasic wrote: > @@ -182,6 +190,8 @@ void airq_iv_release(struct airq_iv *iv) > kfree(iv->ptr); > kfree(iv->bitlock); > kfree(iv->vector); - kfree(iv->vector); > + dma_free_coherent(cio_get_dma_css_dev(), iv_size(iv->bits), > +

Re: [PATCH 06/10] s390/cio: add basic protected virtualization support

2019-05-08 Thread Christoph Hellwig
On Wed, May 08, 2019 at 03:46:42PM +0200, Sebastian Ott wrote: > > + io_priv->dma_area = dma_alloc_coherent(&sch->dev, > > + sizeof(*io_priv->dma_area), > > + &io_priv->dma_area_dma, GFP_KERNEL); > > This needs GFP_DMA. > You use a genpool for

Re: [PATCH 06/10] s390/cio: add basic protected virtualization support

2019-05-08 Thread Sebastian Ott
On Fri, 26 Apr 2019, Halil Pasic wrote: > static struct ccw_device * io_subchannel_allocate_dev(struct subchannel *sch) > { [..] > + cdev->private = kzalloc(sizeof(struct ccw_device_private), > + GFP_KERNEL | GFP_DMA); Do we still need GFP_DMA here (since we now

Re: [PATCH 05/10] s390/cio: introduce DMA pools to cio

2019-05-08 Thread Sebastian Ott
On Fri, 26 Apr 2019, Halil Pasic wrote: > @@ -224,6 +228,9 @@ struct subchannel *css_alloc_subchannel(struct > subchannel_id schid, > INIT_WORK(&sch->todo_work, css_sch_todo); > sch->dev.release = &css_subchannel_release; > device_initialize(&sch->dev); > + sch->dma_mask =

Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver

2019-05-08 Thread Pankaj Gupta
> > On 4/25/19 10:00 PM, Pankaj Gupta wrote: > > > +void host_ack(struct virtqueue *vq) > > +{ > > + unsigned int len; > > + unsigned long flags; > > + struct virtio_pmem_request *req, *req_buf; > > + struct virtio_pmem *vpmem = vq->vdev->priv; > > + > > + spin_lock_irqsave(&vpmem->pm

Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver

2019-05-08 Thread Pankaj Gupta
Hi Dan, Thank you for the review. Please see my reply inline. > > Hi Pankaj, > > Some minor file placement comments below. Sure. > > On Thu, Apr 25, 2019 at 10:02 PM Pankaj Gupta wrote: > > > > This patch adds virtio-pmem driver for KVM guest. > > > > Guest reads the persistent memory ran

[PATCH v5 17/20] drm/vboxvideo: Convert vboxvideo driver to |struct drm_gem_vram_object|

2019-05-08 Thread Thomas Zimmermann
This patch replaces |struct vbox_bo| and its helpers with the generic implementation of |struct drm_gem_vram_object|. The only change in semantics is that &ttm_bo_driver.verify_access() now does the actual verification. v4: * select config option DRM_VRAM_HELPER v3: * remove forwar

[PATCH v5 20/20] drm/hisilicon: Convert hibmc-drm driver to VRAM MM

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_vram_mm| and its helpers replace hibmc's TTM-based memory manager. It's the same implementation; except for the type names. v5: * set .llseek via DRM_VRAM_MM_FILE_OPERATIONS v4: * don't select DRM_TTM or DRM_VRAM_MM_HELPER v3: * use drm_gem_vr

[PATCH v5 18/20] drm/vboxvideo: Convert vboxvideo driver to VRAM MM

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_vram_mm| and its helpers replace vboxvideo's TTM-based memory manager. It's the same implementation; except for the type names. v4: * don't select DRM_TTM or DRM_VRAM_MM_HELPER v3: * use drm_gem_vram_mm_funcs * convert driver to drm_device-bas

[PATCH v5 14/20] drm/mgag200: Convert mgag200 driver to |struct drm_gem_vram_object|

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_gem_vram_object| and its helpers replace |struct mgag200_bo|. It's the same implementation; except for the type names. v4: * cleanups from checkpatch.pl * select config option DRM_VRAM_HELPER Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/mga

[PATCH v5 19/20] drm/hisilicon: Convert hibmc-drm driver to |struct drm_gem_vram_object|

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_gem_vram_object| and its helpers replace |struct hibmc_bo|. It's the same implementation; except for the type names. v4: * select config option DRM_VRAM_HELPER Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/hisilicon/hibmc/Kconfig | 1 + .../

[PATCH v5 16/20] drm/mgag200: Replace mapping code with drm_gem_vram_{kmap/kunmap}()

2019-05-08 Thread Thomas Zimmermann
The mgag200 driver establishes several memory mappings for frame buffers and cursors. This patch converts the driver to use the equivalent drm_gem_vram_kmap() functions. It removes the dependencies on TTM and cleans up the code. v4: * cleanups from checkpatch.pl Signed-off-by: Thomas Zimm

[PATCH v5 12/20] drm/bochs: Convert bochs driver to |struct drm_gem_vram_object|

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_gem_vram_object| and its helpers replace |struct bochs_bo|. It's the same implementation; except for the type names. v5: * use PRIME helpers from GEM VRAM v4: * cleanups from checkpatch.pl * select config option DRM_VRAM_HELPER Signed-off-by:

[PATCH v5 13/20] drm/bochs: Convert bochs driver to VRAM MM

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_vram_mm| and its helpers replace bochs' TTM-based memory manager. It's the same implementation; except for the type names. v5: * set .llseek via DRM_VRAM_MM_FILE_OPERATIONS v4: * don't select DRM_TTM or DRM_VRAM_MM_HELPER v3: * use drm_gem_vra

[PATCH v5 15/20] drm/mgag200: Convert mgag200 driver to VRAM MM

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_vram_mm| and its helpers replace mgag200's TTM-based memory manager. It's the same implementation; except for the type names. v4: * don't select DRM_TTM or DRM_VRAM_MM_HELPER v3: * use drm_gem_vram_mm_funcs * convert driver to drm_device-based

[PATCH v5 10/20] drm/ast: Convert AST driver to VRAM MM

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_vram_mm| and its helpers replace ast's TTM-based memory manager. It's the same implementation; except for the type names. v4: * don't select DRM_TTM or DRM_VRAM_MM_HELPER v3: * use drm_gem_vram_mm_funcs * convert driver to drm_device-based ins

[PATCH v5 09/20] drm/ast: Convert AST driver to |struct drm_gem_vram_object|

2019-05-08 Thread Thomas Zimmermann
The data structure |struct drm_gem_vram_object| and its helpers replace |struct ast_bo|. It's the same implementation; except for the type names. v4: * cleanups from checkpatch.pl Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ast/Kconfig| 2 +- drivers/gpu/drm/ast/ast_drv.c

[PATCH v5 08/20] drm: Integrate VRAM MM into struct drm_device

2019-05-08 Thread Thomas Zimmermann
There's now a pointer to struct drm_vram_mm stored in struct drm_device. DRM drivers that use VRAM MM should use this field to refer to their instance of the data structure. Appropriate helpers are now provided as well. Adding struct drm_vram_mm to struct drm_device further avoids wrappers and boi

[PATCH v5 11/20] drm/ast: Replace mapping code with drm_gem_vram_{kmap/kunmap}()

2019-05-08 Thread Thomas Zimmermann
The AST driver establishes several memory mappings for frame buffers and cursors. This patch converts the driver to use the equivalent drm_gem_vram_kmap() functions. It removes the dependencies on TTM and cleans up the code. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ast/ast_drv.h |

[PATCH v5 06/20] drm: Add VRAM MM, a simple memory manager for dedicated VRAM

2019-05-08 Thread Thomas Zimmermann
The VRAM MM memory manager is a helper library that manages dedicated video memory of simple framebuffer devices. It is supported to be used with struct drm_gem_vram_object, but does not depend on it. The implementation is based on the respective code from ast, bochs, and mgag200. These drivers sh

[PATCH v5 05/20] drm: Add simple PRIME helpers for GEM VRAM

2019-05-08 Thread Thomas Zimmermann
These basic helper functions for GEM VRAM allow for pinning and mapping GEM VRAM objects via the PRIME interfaces. It's not a full implementation, but complete enough for generic fbcon. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_vram_helper.c | 98 +++ i

[PATCH v5 04/20] drm: Add drm_gem_vram_fill_create_dumb() to create dumb buffers

2019-05-08 Thread Thomas Zimmermann
The helper function drm_gem_vram_fill_create_dumb() implements most of struct drm_driver.dumb_create() for GEM-VRAM buffer objects. It's not a full implementation of the callback, as several driver-specific parameters are still required. v4: * cleanups from checkpatch.pl v2: * docu

[PATCH v5 02/20] drm: Add |struct drm_gem_vram_object| callbacks for |struct ttm_bo_driver|

2019-05-08 Thread Thomas Zimmermann
The provided helpers can be used for the respective callback functions in |struct ttm_bo_driver|. v2: * drm_is_gem_vram() is now a private function * documentation fixes Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_vram_helper.c | 50 +++

[PATCH v5 07/20] drm: Add default instance for VRAM MM callback functions

2019-05-08 Thread Thomas Zimmermann
VRAM MM is most likely be used with GEM VRAM. The latter now provides the required instance of struct drm_vram_mm_funcs for drivers to use. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_vram_helper.c | 14 ++ include/drm/drm_gem_vram_helper.h | 3 +++ 2 files chan

[PATCH v5 01/20] drm: Add |struct drm_gem_vram_object| and helpers

2019-05-08 Thread Thomas Zimmermann
The type |struct drm_gem_vram_object| implements a GEM object for simple framebuffer devices with dedicated video memory. The BO is either located in VRAM or system memory. The implementation has been created from the respective code in ast, bochs and mgag200. These drivers copy their implementati

[PATCH v5 03/20] drm: Add |struct drm_gem_vram_object| callbacks for |struct drm_driver|

2019-05-08 Thread Thomas Zimmermann
The provided helpers can be used for the respective callback functions in |struct drm_driver|. v4: * cleanups from checkpatch.pl v2: * documentation fixes Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_vram_helper.c | 49 +++ include/drm/drm

[PATCH v5 00/20] Share TTM code among DRM framebuffer drivers

2019-05-08 Thread Thomas Zimmermann
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It fu