Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-05 Thread Christian König
Am 02.10.23 um 20:22 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: Am 02.10.23 um 20:08 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König via Virtualization
Am 02.10.23 um 20:08 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: Am 29.09.23 um 21:33 schrieb

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: Am 29.09.23 um 21:33 schrieb Kees Cook: On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: This is a batch of patches touching drm

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 29.09.23 um 21:33 schrieb Kees Cook: On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: This is a batch of patches touching drm for preparing for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-25 Thread Christian König via Virtualization
Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Xiaojian Du Cc: Huang Rui Cc: Kevin Wang Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Acked-by: Alex Deucher

Re: [PATCH v15 17/23] drm/shmem-helper: Add and use drm_gem_shmem_resv_assert_held() helper

2023-08-29 Thread Christian König via Virtualization
Am 29.08.23 um 09:29 schrieb Boris Brezillon: On Tue, 29 Aug 2023 05:34:23 +0300 Dmitry Osipenko wrote: On 8/28/23 13:12, Boris Brezillon wrote: On Sun, 27 Aug 2023 20:54:43 +0300 Dmitry Osipenko wrote: In a preparation of adding drm-shmem memory shrinker, move all reservation locking

Re: [PATCH v15 11/23] dma-resv: Add kref_put_dma_resv()

2023-08-28 Thread Christian König via Virtualization
Am 27.08.23 um 19:54 schrieb Dmitry Osipenko: Add simple kref_put_dma_resv() helper that wraps around kref_put_ww_mutex() for drivers that needs to lock dma-resv on kref_put(). It's not possible to easily add this helper to kref.h because of the headers inclusion dependency, hence add it to

Re: [PATCH -next 1/7] drm/amdkfd: Remove unnecessary NULL values

2023-08-09 Thread Christian König via Virtualization
Am 09.08.23 um 05:44 schrieb Ruan Jinjie: The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie Reviewed-by: Christian

Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-12 Thread Christian König via Virtualization
Am 12.07.23 um 15:38 schrieb Uwe Kleine-König: Hello Maxime, On Wed, Jul 12, 2023 at 02:52:38PM +0200, Maxime Ripard wrote: On Wed, Jul 12, 2023 at 01:02:53PM +0200, Uwe Kleine-König wrote: Background is that this makes merge conflicts easier to handle and detect. Really? FWIW, I agree with

[PATCH 2/7] drm/qxl: switch to using drm_exec

2023-07-12 Thread Christian König
Just a straightforward conversion without any optimization. Only compile tested for now. Signed-off-by: Christian König Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: spice-de...@lists.freedesktop.org --- drivers/gpu/drm/qxl/Kconfig | 1 + drivers

[PATCH 4/7] drm/virtgpu: switch to using drm_exec

2023-07-12 Thread Christian König
Just a straightforward conversion without any optimization. Only compile tested for now. Signed-off-by: Christian König Cc: David Airlie Cc: Gerd Hoffmann Cc: Gurchetan Singh Cc: Chia-I Wu Cc: virtualization@lists.linux-foundation.org --- drivers/gpu/drm/virtio/Kconfig | 1

Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-12 Thread Christian König via Virtualization
Am 12.07.23 um 11:46 schrieb Uwe Kleine-König: Hello, while I debugged an issue in the imx-lcdc driver I was constantly irritated about struct drm_device pointer variables being named "dev" because with that name I usually expect a struct device pointer. I think there is a big benefit when

Re: [PATCH] drm: Remove unnecessary (void*) conversions

2023-05-26 Thread Christian König via Virtualization
Am 26.05.23 um 05:32 schrieb Su Hui: Pointer variables of (void*) type do not require type cast. Please split that up by subsystem/driver. Taking it through the misc tree might just cause merge conflicts. Christian. Signed-off-by: Su Hui ---

Re: [PATCH v13 01/10] drm/shmem-helper: Switch to reservation lock

2023-03-26 Thread Christian König
Am 25.03.23 um 15:58 schrieb Dmitry Osipenko: On 3/15/23 16:46, Dmitry Osipenko wrote: On 3/14/23 05:26, Dmitry Osipenko wrote: @@ -633,7 +605,10 @@ int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct return ret; } +

Re: [PATCH] drm/gem: Expose the buffer object handle to userspace last

2023-02-23 Thread Christian König via Virtualization
Am 20.02.23 um 11:23 schrieb Tvrtko Ursulin: On 20/02/2023 10:01, Christian König wrote: Am 20.02.23 um 10:55 schrieb Tvrtko Ursulin: Hi, On 14/02/2023 13:59, Christian König wrote: Am 14.02.23 um 13:50 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Currently drm_gem_handle_create_tail

Re: [PATCH] drm/gem: Expose the buffer object handle to userspace last

2023-02-20 Thread Christian König
Am 20.02.23 um 10:55 schrieb Tvrtko Ursulin: Hi, On 14/02/2023 13:59, Christian König wrote: Am 14.02.23 um 13:50 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Currently drm_gem_handle_create_tail exposes the handle to userspace before the buffer object constructions is complete

Re: [PATCH] drm/gem: Expose the buffer object handle to userspace last

2023-02-14 Thread Christian König via Virtualization
Am 14.02.23 um 13:50 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Currently drm_gem_handle_create_tail exposes the handle to userspace before the buffer object constructions is complete. This allowing of working against a partially constructed object, which may also be in the process of having

Re: [drm-misc:drm-misc-next] [drm/ttm] 1802537820: WARNING:at_drivers/gpu/drm/drm_gem_vram_helper.c:#drm_gem_vram_offset

2023-02-08 Thread Christian König via Virtualization
Am 08.02.23 um 10:38 schrieb Matthew Auld: On Wed, 8 Feb 2023 at 08:32, Christian König wrote: Hey guys, I'm pretty sure this is a bug in bochs which happens to surface because of a recent TTM change, we have seen similar problems in the past with this driver. What happens is that userspace

Re: [drm-misc:drm-misc-next] [drm/ttm] 1802537820: WARNING:at_drivers/gpu/drm/drm_gem_vram_helper.c:#drm_gem_vram_offset

2023-02-08 Thread Christian König via Virtualization
Hey guys, I'm pretty sure this is a bug in bochs which happens to surface because of a recent TTM change, we have seen similar problems in the past with this driver. What happens is that userspace tries to bind a BO to a CRTC before the BO has even a backing store. Any idea how to fix

Re: [PATCH 01/21] drm/amdgpu: Don't set struct drm_driver.lastclose

2022-10-20 Thread Christian König via Virtualization
Am 20.10.22 um 12:37 schrieb Thomas Zimmermann: Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose().

Re: [PATCH v7 00/21] Move all drivers to a common dma-buf locking convention

2022-10-18 Thread Christian König via Virtualization
h like was suggested by Michael Ruhl. The scope of reservation locking is smaller now. v4: - Added dma_buf_mmap() to the "locking convention" documentation, which was missed by accident in v3. - Added acks from Christian König, Tomasz Figa and Hans Verkuil that

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-09-07 Thread Christian König via Virtualization
Am 06.09.22 um 22:05 schrieb Daniel Vetter: On Tue, Sep 06, 2022 at 10:01:47PM +0200, Daniel Vetter wrote: On Mon, Aug 15, 2022 at 12:05:19PM +0200, Christian König wrote: Am 15.08.22 um 11:54 schrieb Dmitry Osipenko: Higher order pages allocated using alloc_pages() aren't refcounted

Re: [PATCH v4 00/21] Move all drivers to a common dma-buf locking convention

2022-09-01 Thread Christian König via Virtualization
. Changelog: v4: - Added dma_buf_mmap() to the "locking convention" documentation, which was missed by accident in v3. - Added acks from Christian König, Tomasz Figa and Hans Verkuil that they gave to couple v3 patches. - Dropped the "_unlocked" postfix

Re: [PATCH v4 21/21] dma-buf: Remove obsoleted internal lock

2022-09-01 Thread Christian König via Virtualization
internal lock. Acked-by: Christian König Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers

Re: [PATCH v4 20/21] media: videobuf2: Stop using internal dma-buf lock

2022-09-01 Thread Christian König via Virtualization
locking from the videobuf2 memory allocators. Acked-by: Tomasz Figa Acked-by: Hans Verkuil Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +-- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11

Re: [PATCH v4 19/21] dma-buf: Document dynamic locking convention

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Add documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- Documentation/driver-api

Re: [PATCH v4 17/21] dma-buf: Move dma_buf_map_attachment() to dynamic locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Move dma-buf attachment mapping functions to the dynamic locking specification by asserting that the reservation lock is held. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/dma-buf/dma-buf.c | 10 ++ 1 file

Re: [PATCH v4 16/21] dma-buf: Move dma_buf_attach() to dynamic locking specification

2022-09-01 Thread Christian König via Virtualization
-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/dma-buf/dma-buf.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index ceea4839c641..073942bf5ae9 100644 --- a/drivers/dma-buf/dma-buf.c

Re: [PATCH v4 14/21] media: tegra-vde: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/media/platform/nvidia

Re: [PATCH v4 13/21] media: videobuf2: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Tomasz Figa Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers

Re: [PATCH v4 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/xen/gntdev-dmabuf.c | 8

Re: [PATCH v4 11/21] misc: fastrpc: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/misc/fastrpc.c | 6 +++--- 1 file

Re: [PATCH v4 10/21] RDMA/umem: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare InfiniBand drivers to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/infiniband/core/umem_dmabuf.c

Re: [PATCH v4 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
-by: Christian König --- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c index 3fa2da149639..7031db145a77 100644 --- a/drivers/gpu/drm/etnaviv

Re: [PATCH v4 08/21] drm/tegra: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare Tegra DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/gpu/drm/tegra/gem.c | 17

Re: [Linaro-mm-sig] [PATCH v4 07/21] drm/omapdrm: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare OMAP DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/gpu/drm/omapdrm

Re: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
-by: Christian König , but it's probably best if somebody from the Intel guys take a look as well. --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 .../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 16

Re: [PATCH v4 05/21] drm/armada: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare Armada driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Christian König --- drivers/gpu/drm/armada/armada_gem.c | 8

Re: [PATCH v4 04/21] drm/prime: Prepare to dynamic dma-buf locking specification

2022-09-01 Thread Christian König via Virtualization
Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: Prepare DRM prime core to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/gpu/drm/drm_prime.c | 6

Re: [Linaro-mm-sig] [PATCH v3 6/9] dma-buf: Move dma-buf attachment to dynamic locking specification

2022-08-24 Thread Christian König via Virtualization
Am 24.08.22 um 17:49 schrieb Dmitry Osipenko: On 8/24/22 18:24, Christian König wrote: Am 24.08.22 um 12:22 schrieb Dmitry Osipenko: Move dma-buf attachment API functions to the dynamic locking specification. The strict locking convention prevents deadlock situations for dma-buf importers

Re: [Linaro-mm-sig] [PATCH v3 6/9] dma-buf: Move dma-buf attachment to dynamic locking specification

2022-08-24 Thread Christian König
Am 24.08.22 um 12:22 schrieb Dmitry Osipenko: Move dma-buf attachment API functions to the dynamic locking specification. The strict locking convention prevents deadlock situations for dma-buf importers and exporters. Previously, the "unlocked" versions of the attachment API functions weren't

Re: [PATCH v3 6/9] dma-buf: Move dma-buf attachment to dynamic locking specification

2022-08-24 Thread Christian König via Virtualization
Am 24.08.22 um 17:03 schrieb Dmitry Osipenko: On 8/24/22 17:08, Christian König wrote: Am 24.08.22 um 12:22 schrieb Dmitry Osipenko: Move dma-buf attachment API functions to the dynamic locking specification. The strict locking convention prevents deadlock situations for dma-buf importers

Re: [PATCH v3 0/9] Move all drivers to a common dma-buf locking convention

2022-08-24 Thread Christian König
Reviewed-by: Christian König to patches #2-#4 Am 24.08.22 um 12:22 schrieb Dmitry Osipenko: Hello, This series moves all drivers to a dynamic dma-buf locking specification. From now on all dma-buf importers are made responsible for holding dma-buf's reservation lock around all operations

Re: [PATCH v3 9/9] dma-buf: Remove internal lock

2022-08-24 Thread Christian König via Virtualization
internal lock. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index

Re: [PATCH v3 9/9] dma-buf: Remove internal lock

2022-08-24 Thread Christian König via Virtualization
internal lock. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index

Re: [PATCH v3 9/9] dma-buf: Remove internal lock

2022-08-24 Thread Christian König
internal lock. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index

Re: [PATCH v3 6/9] dma-buf: Move dma-buf attachment to dynamic locking specification

2022-08-24 Thread Christian König via Virtualization
Am 24.08.22 um 12:22 schrieb Dmitry Osipenko: Move dma-buf attachment API functions to the dynamic locking specification. The strict locking convention prevents deadlock situations for dma-buf importers and exporters. Previously, the "unlocked" versions of the attachment API functions weren't

Re: [PATCH v3 5/9] dma-buf: Move dma_buf_mmap_unlocked() to dynamic locking specification

2022-08-24 Thread Christian König via Virtualization
This should work, but I'm really wondering if this makes a difference for somebody. Anyway the approach is fine with me: Acked-by: Christian König Regards, Christian. Am 24.08.22 um 12:22 schrieb Dmitry Osipenko: Move dma_buf_mmap_unlocked() function to the dynamic locking specification

Re: [PATCH v8 2/2] drm/gem: Don't map imported GEMs

2022-08-23 Thread Christian König
Am 22.08.22 um 19:26 schrieb Dmitry Osipenko: On 8/16/22 22:55, Dmitry Osipenko wrote: On 8/16/22 15:03, Christian König wrote: Am 16.08.22 um 13:44 schrieb Dmitry Osipenko: [SNIP] The other complication I noticed is that we don't seem to keep around the fd after importing to a GEM handle

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-18 Thread Christian König via Virtualization
Am 18.08.22 um 01:13 schrieb Dmitry Osipenko: On 8/18/22 01:57, Dmitry Osipenko wrote: On 8/15/22 18:54, Dmitry Osipenko wrote: On 8/15/22 17:57, Dmitry Osipenko wrote: On 8/15/22 16:53, Christian König wrote: Am 15.08.22 um 15:45 schrieb Dmitry Osipenko: [SNIP] Well that comment sounds

Re: [PATCH v8 2/2] drm/gem: Don't map imported GEMs

2022-08-16 Thread Christian König
Am 16.08.22 um 13:44 schrieb Dmitry Osipenko: [SNIP] The other complication I noticed is that we don't seem to keep around the fd after importing to a GEM handle. And I could imagine that doing so could cause issues with too many fd's. So I guess the best thing is to keep the status quo and

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 15:45 schrieb Dmitry Osipenko: [SNIP] Well that comment sounds like KVM is doing the right thing, so I'm wondering what exactly is going on here. KVM actually doesn't hold the page reference, it takes the temporal reference during page fault and then drops the reference once

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 13:50 schrieb Dmitry Osipenko: On 8/15/22 14:28, Christian König wrote: Maybe it was discussed privately? In this case I will be happy to get more info from you about the root of the problem so I could start to look at how to fix it properly. It's not apparent where the problem

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 13:19 schrieb Dmitry Osipenko: [SNIP] I'll try to dig out the older discussions, thank you for the quick reply! Are you sure it was really discussed in public previously? All I can find is yours two answers to a similar patches where you're saying that this it's a wrong solution

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 12:47 schrieb Dmitry Osipenko: On 8/15/22 13:18, Dmitry Osipenko wrote: On 8/15/22 13:14, Christian König wrote: Am 15.08.22 um 12:11 schrieb Christian König: Am 15.08.22 um 12:09 schrieb Dmitry Osipenko: On 8/15/22 13:05, Christian König wrote: Am 15.08.22 um 11:54 schrieb

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 12:18 schrieb Dmitry Osipenko: On 8/15/22 13:14, Christian König wrote: Am 15.08.22 um 12:11 schrieb Christian König: Am 15.08.22 um 12:09 schrieb Dmitry Osipenko: On 8/15/22 13:05, Christian König wrote: Am 15.08.22 um 11:54 schrieb Dmitry Osipenko: Higher order pages

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 12:11 schrieb Christian König: Am 15.08.22 um 12:09 schrieb Dmitry Osipenko: On 8/15/22 13:05, Christian König wrote: Am 15.08.22 um 11:54 schrieb Dmitry Osipenko: Higher order pages allocated using alloc_pages() aren't refcounted and they need to be refcounted, otherwise it's

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 12:09 schrieb Dmitry Osipenko: On 8/15/22 13:05, Christian König wrote: Am 15.08.22 um 11:54 schrieb Dmitry Osipenko: Higher order pages allocated using alloc_pages() aren't refcounted and they need to be refcounted, otherwise it's impossible to map them by KVM. This patch sets

Re: [PATCH v1] drm/ttm: Refcount allocated tail pages

2022-08-15 Thread Christian König via Virtualization
Am 15.08.22 um 11:54 schrieb Dmitry Osipenko: Higher order pages allocated using alloc_pages() aren't refcounted and they need to be refcounted, otherwise it's impossible to map them by KVM. This patch sets the refcount of the tail pages and fixes the KVM memory mapping faults. Without this

Re: [Linaro-mm-sig] [PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification

2022-08-12 Thread Christian König
Am 10.08.22 um 20:53 schrieb Dmitry Osipenko: On 8/10/22 21:25, Christian König wrote: Am 10.08.22 um 19:49 schrieb Dmitry Osipenko: On 8/10/22 14:30, Christian König wrote: Am 25.07.22 um 17:18 schrieb Dmitry Osipenko: This patch moves the non-dynamic dma-buf users over to the dynamic

Re: [Linaro-mm-sig] [PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification

2022-08-10 Thread Christian König via Virtualization
Am 10.08.22 um 19:49 schrieb Dmitry Osipenko: On 8/10/22 14:30, Christian König wrote: Am 25.07.22 um 17:18 schrieb Dmitry Osipenko: This patch moves the non-dynamic dma-buf users over to the dynamic locking specification. The strict locking convention prevents deadlock situation for dma-buf

Re: [Linaro-mm-sig] [PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification

2022-08-10 Thread Christian König
Am 25.07.22 um 17:18 schrieb Dmitry Osipenko: This patch moves the non-dynamic dma-buf users over to the dynamic locking specification. The strict locking convention prevents deadlock situation for dma-buf importers and exporters. Previously the "unlocked" versions of the dma-buf API functions

Re: [PATCH v8 1/2] drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error

2022-08-10 Thread Christian König via Virtualization
Am 10.08.22 um 10:33 schrieb Daniel Vetter: On Wed, 10 Aug 2022 at 08:52, Christian König wrote: Am 09.08.22 um 18:44 schrieb Daniel Vetter: On Tue, Jul 05, 2022 at 01:33:51PM +0200, Christian König wrote: Am 01.07.22 um 11:02 schrieb Dmitry Osipenko: Use ww_acquire_fini() in the error code

Re: [PATCH v8 1/2] drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error

2022-08-10 Thread Christian König via Virtualization
Am 09.08.22 um 18:44 schrieb Daniel Vetter: On Tue, Jul 05, 2022 at 01:33:51PM +0200, Christian König wrote: Am 01.07.22 um 11:02 schrieb Dmitry Osipenko: Use ww_acquire_fini() in the error code paths. Otherwise lockdep thinks that lock is held when lock's memory is freed after

Re: [Linaro-mm-sig] [PATCH v2 2/5] drm/gem: Take reservation lock for vmap/vunmap operations

2022-08-09 Thread Christian König
functions for the case where DRM core now holds the lock. This patch prepares DRM core and drivers to transition to the common dma-buf locking convention where vmapping of exported GEMs will be done under the held reservation lock. Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König

Re: [Linaro-mm-sig] [PATCH v2 1/5] dma-buf: Add _unlocked postfix to function names

2022-08-09 Thread Christian König
on we will make the "unlocked" functions to take the reservation lock. Suggested-by: Christian König Signed-off-by: Dmitry Osipenko Could be that we later say we will remove the prefix again because some functions should stay unlocked, but for now it makes it much clearer what ha

Re: [PATCH v1 4/6] dma-buf: Acquire wait-wound context on attachment

2022-07-20 Thread Christian König via Virtualization
Am 19.07.22 um 22:05 schrieb Dmitry Osipenko: On 7/15/22 09:59, Dmitry Osipenko wrote: On 7/15/22 09:50, Christian König wrote: Am 15.07.22 um 02:52 schrieb Dmitry Osipenko: Intel i915 GPU driver uses wait-wound mutex to lock multiple GEMs on the attachment to the i915 dma-buf. In order

Re: [PATCH v1 1/6] dma-buf: Add _unlocked postfix to function names

2022-07-15 Thread Christian König via Virtualization
Am 15.07.22 um 11:31 schrieb Dmitry Osipenko: On 7/15/22 10:19, Christian König wrote: -struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, -    enum dma_data_direction direction) +struct sg_table * +dma_buf_map_attachment_unlocked(struct

Re: [PATCH v1 2/6] drm/gem: Take reservation lock for vmap/vunmap operations

2022-07-15 Thread Christian König via Virtualization
Am 15.07.22 um 02:52 schrieb Dmitry Osipenko: The new common dma-buf locking convention will require buffer importers to hold the reservation lock around mapping operations. Make DRM GEM core to take the lock around the vmapping operations and update QXL and i915 drivers to use the locked

Re: [PATCH v1 1/6] dma-buf: Add _unlocked postfix to function names

2022-07-15 Thread Christian König via Virtualization
on we will make the "unlocked" functions to take the reservation lock. Suggested-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 76 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 4 +- drivers/gpu/drm/

Re: [PATCH v1 4/6] dma-buf: Acquire wait-wound context on attachment

2022-07-15 Thread Christian König via Virtualization
Am 15.07.22 um 02:52 schrieb Dmitry Osipenko: Intel i915 GPU driver uses wait-wound mutex to lock multiple GEMs on the attachment to the i915 dma-buf. In order to let all drivers utilize shared wait-wound context during attachment in a general way, make dma-buf core to acquire the ww context

Re: [PATCH v8 2/2] drm/gem: Don't map imported GEMs

2022-07-05 Thread Christian König via Virtualization
. Let's prohibit the mapping for all DRM drivers for consistency. Suggested-by: Thomas Hellström Signed-off-by: Dmitry Osipenko I'm pretty sure that this is the right approach, but it's certainly more than possible that somebody abused this already. Anyway patch is Reviewed-by: Christian König

Re: [PATCH v8 1/2] drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error

2022-07-05 Thread Christian König via Virtualization
the noisy "WARNING: held lock freed!" splat of VirtIO-GPU driver with CONFIG_DEBUG_MUTEXES=y and enabled lockdep. Cc: sta...@vger.kernel.org Fixes: 7edc3e3b975b5 ("drm: Add helpers for locking an array of BO reservations.") Reviewed-by: Thomas Hellström Signed-off-by: Dmitry Osip

Re: [Linaro-mm-sig] Re: [PATCH v6 02/22] drm/gem: Move mapping of imported dma-bufs to drm_gem_mmap_obj()

2022-07-04 Thread Christian König via Virtualization
Am 30.06.22 um 01:06 schrieb Dmitry Osipenko: On 6/29/22 11:43, Thomas Hellström (Intel) wrote: On 6/29/22 10:22, Dmitry Osipenko wrote: On 6/29/22 09:40, Thomas Hellström (Intel) wrote: On 5/27/22 01:50, Dmitry Osipenko wrote: Drivers that use drm_gem_mmap() and drm_gem_mmap_obj() helpers

Re: [PATCH v6 17/22] drm/shmem-helper: Add generic memory shrinker

2022-06-06 Thread Christian König
Am 05.06.22 um 18:47 schrieb Daniel Vetter: On Fri, 27 May 2022 at 01:55, Dmitry Osipenko wrote: Introduce a common DRM SHMEM shrinker framework that allows to reduce code duplication among DRM drivers by replacing theirs custom shrinker implementations with the generic shrinker. In order to

Re: [PATCH v6 14/22] dma-buf: Introduce new locking convention

2022-05-30 Thread Christian König via Virtualization
Hi Dmitry, Am 30.05.22 um 15:26 schrieb Dmitry Osipenko: Hello Christian, On 5/30/22 09:50, Christian König wrote: Hi Dmitry, First of all please separate out this patch from the rest of the series, since this is a complex separate structural change. I assume all the patches will go via

Re: [PATCH v6 14/22] dma-buf: Introduce new locking convention

2022-05-30 Thread Christian König via Virtualization
Hi Dmitry, First of all please separate out this patch from the rest of the series, since this is a complex separate structural change. Am 27.05.22 um 01:50 schrieb Dmitry Osipenko: All dma-bufs have dma-reservation lock that allows drivers to perform exclusive operations over shared

Re: [PATCH v4 10/15] drm/shmem-helper: Take reservation lock instead of drm_gem_shmem locks

2022-05-12 Thread Christian König
Am 11.05.22 um 21:05 schrieb Daniel Vetter: [SNIP] It's unclear to me which driver may ever want to do the mapping under the dma_resv_lock. But if we will ever have such a driver that will need to map imported buffer under dma_resv_lock, then we could always add the dma_buf_vmap_locked()

Re: [PATCH v4 10/15] drm/shmem-helper: Take reservation lock instead of drm_gem_shmem locks

2022-05-11 Thread Christian König
Am 11.05.22 um 15:00 schrieb Daniel Vetter: On Tue, May 10, 2022 at 04:39:53PM +0300, Dmitry Osipenko wrote: [SNIP] Since vmapping implies implicit pinning, we can't use a separate lock in drm_gem_shmem_vmap() because we need to protect the drm_gem_shmem_get_pages(), which is invoked by

[PATCH 4/4] drm/qxl: add drm_gem_plane_helper_prepare_fb

2022-04-29 Thread Christian König
We could need to wait for the pin to complete here. Signed-off-by: Christian König Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: spice-de...@lists.freedesktop.org --- drivers/gpu/drm/qxl/qxl_display.c | 8 +++- 1 file changed, 7 insertions(+), 1

Re: [PATCH v2] drm/qxl: fix qxl can't use in arm64

2022-03-25 Thread Christian König via Virtualization
() replace it. Signed-off-by: Cong Liu Looks sane to me, but I'm really not involved enough to fully judge. Acked-by: Christian König --- drivers/gpu/drm/qxl/qxl_kms.c | 4 ++-- drivers/gpu/drm/qxl/qxl_ttm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu

Re: 回复: Re: 回复: Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-24 Thread Christian König via Virtualization
v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64 *日 期:*2022-03-23 18:17 *发件人:*Christian König *收件人:*liucong2@kylinos.cnairlied@redhat.comkraxel@redhat.comairlied@linux.iedaniel@ffwll.chray.huang@amd.comvirtualization@lists.linux-foundation.orgspice-devel@lists.freedesktop.orgdri-de

Re: 回复: Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
]          drm/qxl: replace ioremap by ioremap_cache on arm64 *日 期:*2022-03-23 15:15 *发件人:*Christian König *收件人:*CongLiuairlied@redhat.comkraxel@redhat.comairlied@linux.iedaniel@ffwll.chray.huang@amd.comvirtualization@lists.linux-foundation.orgspice-devel@lists.freedesktop.orgdri-de

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
Am 23.03.22 um 10:45 schrieb Robin Murphy: On 2022-03-23 07:15, Christian König wrote: Am 22.03.22 um 10:34 schrieb Cong Liu: qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as DEVICE_nGnRE, it can not support unaligned access. Well that some ARM

Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
ioremap by ioremap_cache on arm64 *日 期:*2022-03-23 15:15 *发件人:*Christian König *收件人:*Cong Liuairlied@redhat.comkraxel@redhat.comairlied@linux.iedaniel@ffwll.chray.huang@amd.comvirtualization@lists.linux-foundation.orgspice-devel@lists.freedesktop.orgdri-de...@lists.freedesktop.org Am

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Christian König via Virtualization
Am 22.03.22 um 10:34 schrieb Cong Liu: qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as DEVICE_nGnRE, it can not support unaligned access. Well that some ARM boards doesn't allow unaligned access to MMIO space is a well known bug of those ARM

[PATCH 3/4] drm/etnaviv: use dma_resv_describe

2021-11-03 Thread Christian König
Instead of dumping the fence info manually. Signed-off-by: Christian König Reviewed-by: Rob Clark --- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm

[PATCH 1/4] dma-buf: add dma_fence_describe and dma_resv_describe v2

2021-11-03 Thread Christian König
Add functions to dump dma_fence and dma_resv objects into a seq_file and use them for printing the debugfs information. v2: fix missing include reported by test robot. Signed-off-by: Christian König Reviewed-by: Rob Clark --- drivers/dma-buf/dma-buf.c | 11 +-- drivers/dma-buf/dma

DMA-buf debugfs cleanups

2021-11-03 Thread Christian König
Hi guys, second round for those four patches adding some simple yet useful DMA-buf helper functions for debugfs prints. Fixed some missing includes and typos in commit messages. Please review and/or comment, Christian. ___ Virtualization mailing

[PATCH 2/4] drm/msm: use the new dma_resv_describe

2021-11-03 Thread Christian König
Instead of hand rolling pretty much the same code. Signed-off-by: Christian König Reviewed-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c

[PATCH 4/4] drm/qxl: use iterator instead of dma_resv_shared_list

2021-11-03 Thread Christian König
I'm not sure why it is useful to know the number of fences in the reservation object, but we try to avoid exposing the dma_resv_shared_list() function. So use the iterator instead. If more information is desired we could use dma_resv_describe() as well. Signed-off-by: Christian König

[PATCH 4/4] drm/qxl: use iterator instead of dma_resv_shared_list

2021-10-28 Thread Christian König
I'm not sure why it is useful to know the number of fences in the reservation object, but we try to avoid exposing the dma_resv_shared_list() function. So use the iterator instead. If more information is desired we could use dma_resv_describe() as well. Signed-off-by: Christian König

[PATCH 3/4] drm/etnaviv: use dma_resv_describe

2021-10-28 Thread Christian König
Instead of dumping the fence info manually. Signed-off-by: Christian König Reviewed-by: Rob Clark --- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm

[PATCH 2/4] drm/msm: use the new dma_resv_describe

2021-10-28 Thread Christian König
Instead of hand rolling pretty much the same code. Signed-off-by: Christian König Reviewed-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c

[PATCH 1/4] dma-buf: add dma_fence_describe and dma_resv_describe

2021-10-28 Thread Christian König
Add functions to dump dma_fence and dma_resv objects into a seq_file and use them for printing the debugfs informations. Signed-off-by: Christian König Reviewed-by: Rob Clark --- drivers/dma-buf/dma-buf.c | 11 +-- drivers/dma-buf/dma-fence.c | 16 drivers/dma-buf

Re: [PATCH] drm/ttm: use dma_alloc_pages for the page pool

2021-05-11 Thread Christian König
Am 11.05.21 um 10:50 schrieb Christoph Hellwig: On Tue, May 11, 2021 at 09:35:20AM +0200, Christian König wrote: We certainly going to need the drm_need_swiotlb() for userptr support (unless we add some approach for drivers to opt out of swiotlb). swiotlb use is driven by three things: 1

Re: [PATCH] drm/ttm: use dma_alloc_pages for the page pool

2021-05-11 Thread Christian König
Am 11.05.21 um 08:05 schrieb Christoph Hellwig: Use the dma_alloc_pages allocator for the TTM pool allocator. This allocator is a front end to the page allocator which takes the DMA mask of the device into account, thus offering the best of both worlds of the two existing allocator versions.

Re: drm/ttm: switch to per device LRU lock

2021-03-25 Thread Christian König
a1f091f8ef2b680a5184db065527612247cb4cae Author: Christian König Date: Tue Oct 6 17:26:42 2020 +0200 drm/ttm: switch to per device LRU lock Instead of having a global lock for potentially less contention. The analysis is as follows: 617 int ttm_mem_evict_first(struct ttm_device *bdev, 618

Re: [patch 1/7] drm/ttm: Replace kmap_atomic() usage

2021-03-04 Thread Christian König
Am 03.03.21 um 14:20 schrieb Thomas Gleixner: From: Thomas Gleixner There is no reason to disable pagefaults and preemption as a side effect of kmap_atomic_prot(). Use kmap_local_page_prot() instead and document the reasoning for the mapping usage with the given pgprot. Remove the NULL

Re: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-12 Thread Christian König
Hi Vivek, Am 12.02.21 um 09:36 schrieb Kasireddy, Vivek: Hi Christian, Hi Vivek, [Kasireddy, Vivek] What if I do mmap() on the fd followed by mlock() or mmap() followed by get_user_pages()? If it still fails, would ioremapping the device memory and poking at the backing storage be an

  1   2   >