Re: [PATCH 1/1] amdgpu fix for gfx1103 queue evict/restore crash

2024-11-29 Thread Felix Kuehling
gpu: kgd2kfd_quiesce_mm called by svm_range_evict [ 1062.937907] amdgpu: evict_process_queues_cpsch started On Wed, Nov 27, 2024 at 3:50 PM Felix Kuehling wrote: On 2024-11-27 06:51, Christian König wrote: > Am 27.11.24 um 12:46 schrieb Mika Laitio: >> AMD gfx1103 / M780 iGPU will cra

Re: [PATCH v6.1] drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer

2024-11-27 Thread Felix Kuehling
local variable, the original pointer not set to NULL, this could cause use-after-free bug. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin Signed-off-by: Vamsi Krishna Brahmajosyula ---   drivers/gpu/drm

Re: [PATCH 1/1] amdgpu fix for gfx1103 queue evict/restore crash

2024-11-27 Thread Felix Kuehling
On 2024-11-27 06:51, Christian König wrote: Am 27.11.24 um 12:46 schrieb Mika Laitio: AMD gfx1103 / M780 iGPU will crash eventually when used for pytorch ML/AI operations on rocm sdk stack. After kernel error the application exits on error and linux desktop can itself sometimes either freeze o

Re: [PATCH] drm/amdkfd: Fix wrong usage of INIT_WORK()

2024-11-06 Thread Felix Kuehling
ack SDMA utilization per process") > Signed-off-by: Yuan Can Thank you. The patch is Reviewed-by: Felix Kuehling I am submitting it to amd-staging-drm-next. Regards, Felix > --- > drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 d

Re: [PATCH 0/5] drm: Introduce DRM client library

2024-09-27 Thread Felix Kuehling
On 2024-09-27 10:37, Thomas Zimmermann wrote: With the next DRM client coming soon (drm_log) and most of DRM's fbdev emulation consolidated in a few places, it's time to provide a single place for the clients. The new module drm_client_lib.ko stores most of the common client code. It's designe

Re: [PATCH 1/1] mm/migrate: Trylock device page in do_swap_page

2024-09-24 Thread Felix Kuehling
On 2024-09-24 12:42, Matthew Brost wrote: > On Tue, Sep 24, 2024 at 01:48:29PM +0200, Simona Vetter wrote: >> On Fri, Sep 20, 2024 at 09:59:51PM +, Matthew Brost wrote: >>> On Fri, Sep 20, 2024 at 05:50:10PM -0400, Felix Kuehling wrote: >>>> >>>>

Re: [PATCH 1/1] mm/migrate: Trylock device page in do_swap_page

2024-09-20 Thread Felix Kuehling
On 2024-09-20 17:23, Matthew Brost wrote: On Fri, Sep 20, 2024 at 04:26:50PM -0400, Felix Kuehling wrote: On 2024-09-18 11:10, Alistair Popple wrote: Matthew Brost writes: On Wed, Sep 11, 2024 at 02:53:31PM +1000, Alistair Popple wrote: Matthew Brost writes: I haven't seen the sa

Re: [PATCH 1/1] mm/migrate: Trylock device page in do_swap_page

2024-09-20 Thread Felix Kuehling
Cc: Philip Yang Cc: Felix Kuehling Cc: Christian König Cc: Andrew Morton Suggessted-by: Simona Vetter Signed-off-by: Matthew Brost --- mm/memory.c | 13 +++--- mm/migrate_device.c | 60 +++-- 2 files changed, 50 insertions(+), 23 deleti

Re: [PATCH 2/4] amdgpu: fix a race in kfd_mem_export_dmabuf()

2024-08-14 Thread Felix Kuehling
d the descriptor table while we'd been going through that song and dance. Switch kfd_mem_export_dmabuf() to using drm_gem_prime_handle_to_dmabuf() and leave the descriptor table alone... Signed-off-by: Al Viro This patch is Reviewed-by: Felix Kuehling --- drivers/gpu/drm/

Re: va range based memory management discussion (was: 回复:回复:Re:Proposal to add CRIU support to DRM render nodes)

2024-07-10 Thread Felix Kuehling
On 2024-07-09 22:38, 周春明(日月) wrote: -- 发件人:Felix Kuehling 发送时间:2024年7月10日(星期三) 01:07 收件人:周春明(日月) ; Tvrtko Ursulin ; dri-devel@lists.freedesktop.org ; amd-...@lists.freedesktop.org ; Dave Airlie ; Daniel Vetter ; criu 抄 送

Re: 回复:Re:Proposal to add CRIU support to DRM render nodes

2024-07-09 Thread Felix Kuehling
On 2024-07-09 5:30, 周春明(日月) wrote: > > > > > > > -- > 发件人:Felix Kuehling > 发送时间:2024年7月9日(星期二) 06:40 > 收件人:周春明(日月) ; Tvrtko Ursulin > ; dri-devel@lists.freedesktop.org > ; amd-...@li

Re: Re:Proposal to add CRIU support to DRM render nodes

2024-07-08 Thread Felix Kuehling
oduction for that? Hi David, This refers to the SVM API that has been in the upstream driver for a while now: https://elixir.bootlin.com/linux/v6.9.8/source/include/uapi/linux/kfd_ioctl.h#L732 Regards, Felix > > Thanks, > -David > > ---

Re: [PATCH 1/2][RFC] amdgpu: fix a race in kfd_mem_export_dmabuf()

2024-06-06 Thread Felix Kuehling
On 2024-06-05 05:14, Christian König wrote: Am 04.06.24 um 20:08 schrieb Felix Kuehling: On 2024-06-03 22:13, Al Viro wrote: Using drm_gem_prime_handle_to_fd() to set dmabuf up and insert it into descriptor table, only to have it looked up by file descriptor and remove it from descriptor

Re: [PATCH] Revert "drm/amdgpu: init iommu after amdkfd device init"

2024-06-04 Thread Felix Kuehling
i Jul 28 12:20:12 2023 -0400     drm/amdkfd: drop IOMMUv2 support     Now that we use the dGPU path for all APUs, drop the     IOMMUv2 support.     v2: drop the now unused queue manager functions for gfx7/8 APUs     Reviewed-by: Felix Kuehling     Acked-by: Christian König     Tested-by:

Re: [PATCH 1/2][RFC] amdgpu: fix a race in kfd_mem_export_dmabuf()

2024-06-04 Thread Felix Kuehling
elper and leave the descriptor table alone. Signed-off-by: Al Viro This patch looks good to me on the amdgpu side. For the DRM side I'm adding dri-devel. Acked-by: Felix Kuehling --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_

Re: [PATCH 11/11] drm/tegra: Use fbdev client helpers

2024-05-07 Thread Felix Kuehling
On 2024-05-07 07:58, Thomas Zimmermann wrote: Implement struct drm_client_funcs with the respective helpers and remove the custom code from the emulation. The generic helpers are equivalent in functionality. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/radeon_fbdev.c | 66 ++-

Re: Proposal to add CRIU support to DRM render nodes

2024-05-03 Thread Felix Kuehling
On 2024-04-16 10:04, Tvrtko Ursulin wrote: > > On 01/04/2024 18:58, Felix Kuehling wrote: >> >> On 2024-04-01 12:56, Tvrtko Ursulin wrote: >>> >>> On 01/04/2024 17:37, Felix Kuehling wrote: >>>> On 2024-04-01 11:09, Tvrtko Ursulin wrote: >&

Re: [PATCH] drm/amdkfd: fix NULL pointer dereference

2024-04-15 Thread Felix Kuehling
oid calling dma_fence_signal and dma_fence_put with zero fences to rely on checking parameters in DMA API. Cc: Alex Deucher Cc: Christian Koenig Cc: Xiaogang Chen Cc: Felix Kuehling Signed-off-by: Vitaly Prosyak --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 10 ++ 1 file changed, 6 inser

Re: [PATCH] drm/ttm: stop pooling cached NUMA pages v2

2024-04-15 Thread Felix Kuehling
On 2024-04-15 10:08, Christian König wrote: Am 15.04.24 um 15:53 schrieb Felix Kuehling: On 2024-04-15 9:48, Christian König wrote: From: Christian König We only pool write combined and uncached allocations because they require extra overhead on allocation and release. If we also pool

Re: [PATCH] drm/ttm: stop pooling cached NUMA pages v2

2024-04-15 Thread Felix Kuehling
On 2024-04-15 9:48, Christian König wrote: From: Christian König We only pool write combined and uncached allocations because they require extra overhead on allocation and release. If we also pool cached NUMA it not only means some extra unnecessary overhead, but also that under memory pressur

Re: Proposal to add CRIU support to DRM render nodes

2024-04-01 Thread Felix Kuehling
On 2024-04-01 12:56, Tvrtko Ursulin wrote: On 01/04/2024 17:37, Felix Kuehling wrote: On 2024-04-01 11:09, Tvrtko Ursulin wrote: On 28/03/2024 20:42, Felix Kuehling wrote: On 2024-03-28 12:03, Tvrtko Ursulin wrote: Hi Felix, I had one more thought while browsing around the amdgpu CRIU

Re: Proposal to add CRIU support to DRM render nodes

2024-04-01 Thread Felix Kuehling
On 2024-04-01 11:09, Tvrtko Ursulin wrote: On 28/03/2024 20:42, Felix Kuehling wrote: On 2024-03-28 12:03, Tvrtko Ursulin wrote: Hi Felix, I had one more thought while browsing around the amdgpu CRIU plugin. It appears it relies on the KFD support being compiled in and /dev/kfd present

Re: Proposal to add CRIU support to DRM render nodes

2024-03-28 Thread Felix Kuehling
ably going to be at least a few weeks. Regards,   Felix Regards, Tvrtko On 15/03/2024 18:36, Tvrtko Ursulin wrote: On 15/03/2024 02:33, Felix Kuehling wrote: On 2024-03-12 5:45, Tvrtko Ursulin wrote: On 11/03/2024 14:48, Tvrtko Ursulin wrote: Hi Felix, On 06/12/2023 21:23, Felix

Re: [PATCH 05/10] drivers: use new capable_any functionality

2024-03-15 Thread Felix Kuehling
On 2024-03-15 7:37, Christian Göttsche wrote: Use the new added capable_any function in appropriate cases, where a task is required to have any of two capabilities. Reorder CAP_SYS_ADMIN last. Signed-off-by: Christian Göttsche Acked-by: Alexander Gordeev (s390 portion) Acked-by: Felix

Re: Proposal to add CRIU support to DRM render nodes

2024-03-14 Thread Felix Kuehling
On 2024-03-12 5:45, Tvrtko Ursulin wrote: On 11/03/2024 14:48, Tvrtko Ursulin wrote: Hi Felix, On 06/12/2023 21:23, Felix Kuehling wrote: Executive Summary: We need to add CRIU support to DRM render nodes in order to maintain CRIU support for ROCm application once they start relying on

Re: [PATCH AUTOSEL 5.15 3/5] drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series

2024-03-13 Thread Felix Kuehling
On 2024-03-11 11:14, Sasha Levin wrote: From: Prike Liang [ Upstream commit c671ec01311b4744b377f98b0b4c6d033fe569b3 ] Currently, GPU resets can now be performed successfully on the Raven series. While GPU reset is required for the S3 suspend abort case. So now can enable gpu reset for S3 abor

Re: [PATCH] drm/amdkfd: make kfd_class constant

2024-03-05 Thread Felix Kuehling
nly memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere The patch looks good to me. Do you want me to apply this to Alex's amd-staging-drm-next? Reviewed-by: Felix Kuehling --

Re: Making drm_gpuvm work across gpu devices

2024-01-29 Thread Felix Kuehling
On 2024-01-29 14:03, Christian König wrote: Am 29.01.24 um 18:52 schrieb Felix Kuehling: On 2024-01-29 11:28, Christian König wrote: Am 29.01.24 um 17:24 schrieb Felix Kuehling: On 2024-01-29 10:33, Christian König wrote: Am 29.01.24 um 16:03 schrieb Felix Kuehling: On 2024-01-25 13:32

Re: Making drm_gpuvm work across gpu devices

2024-01-29 Thread Felix Kuehling
On 2024-01-29 11:28, Christian König wrote: Am 29.01.24 um 17:24 schrieb Felix Kuehling: On 2024-01-29 10:33, Christian König wrote: Am 29.01.24 um 16:03 schrieb Felix Kuehling: On 2024-01-25 13:32, Daniel Vetter wrote: On Wed, Jan 24, 2024 at 09:33:12AM +0100, Christian König wrote: Am

Re: Making drm_gpuvm work across gpu devices

2024-01-29 Thread Felix Kuehling
On 2024-01-29 10:33, Christian König wrote: Am 29.01.24 um 16:03 schrieb Felix Kuehling: On 2024-01-25 13:32, Daniel Vetter wrote: On Wed, Jan 24, 2024 at 09:33:12AM +0100, Christian König wrote: Am 23.01.24 um 20:37 schrieb Zeng, Oak: [SNIP] Yes most API are per device based. One

Re: Making drm_gpuvm work across gpu devices

2024-01-29 Thread Felix Kuehling
On 2024-01-25 13:32, Daniel Vetter wrote: On Wed, Jan 24, 2024 at 09:33:12AM +0100, Christian König wrote: Am 23.01.24 um 20:37 schrieb Zeng, Oak: [SNIP] Yes most API are per device based. One exception I know is actually the kfd SVM API. If you look at the svm_ioctl function, it is per-proce

Re: Making drm_gpuvm work across gpu devices

2024-01-25 Thread Felix Kuehling
h in reality all those gpuvm shares a same virtual address space. See one more comment inline *From:*Christian König *Sent:* Wednesday, January 24, 2024 3:33 AM *To:* Zeng, Oak ; Danilo Krummrich ; Dave Airlie ; Daniel Vetter ; Felix Kuehling *Cc:* Welty, Brian ; dri-devel@lists.freedeskto

Re: [bug report] drm/amdkfd: Export DMABufs from KFD using GEM handles

2024-01-23 Thread Felix Kuehling
On 2024-01-23 5:21, Dan Carpenter wrote: Hello Felix Kuehling, The patch 1819200166ce: "drm/amdkfd: Export DMABufs from KFD using GEM handles" from Aug 24, 2023 (linux-next), leads to the following Smatch static checker warning: drivers/dma-buf/dma-buf.c:729 dma_buf_get()

Re: Making drm_gpuvm work across gpu devices

2024-01-23 Thread Felix Kuehling
On 2024-01-23 14:37, Zeng, Oak wrote: Thanks Christian. I have some comment inline below. Danilo, can you also take a look and give your feedback? Thanks. Sorry, just catching up with this thread now. I'm also not familiar with drm_gpuvm. Some general observations based on my experience wit

Re: [pull] amdgpu, amdkfd drm-fixes-6.8

2024-01-15 Thread Felix Kuehling
ection via ras_ctrl debugfs Charlene Liu (1): drm/amd/display: Update z8 latency Dafna Hirschfeld (1): drm/amdkfd: fixes for HMM mem allocation Daniel Miess (1): Revert "drm/amd/display: Fix conversions between bytes and KB" Felix Kuehling (4): drm/amdkfd:

Re: Proposal to add CRIU support to DRM render nodes

2024-01-15 Thread Felix Kuehling
t could be generalized later if there is interest then. Regards,   Felix On 2023-12-06 16:23, Felix Kuehling wrote: Executive Summary: We need to add CRIU support to DRM render nodes in order to maintain CRIU support for ROCm application once they start relying on render nodes for more GPU memory

Re: [PATCH v2] drm/amdkfd: fixes for HMM mem allocation

2024-01-08 Thread Felix Kuehling
On 2024-01-07 08:07, Dafna Hirschfeld wrote: Fix err return value and reset pgmap->type after checking it. Fixes: c83dee9b6394 ("drm/amdkfd: add SPM support for SVM") Reviewed-by: Felix Kuehling Signed-off-by: Dafna Hirschfeld --- v2: remove unrelated DOC fix and add 'F

Re: [PATCH] drm/amdkfd: fixes for HMM mem allocation

2024-01-02 Thread Felix Kuehling
/* Disable SVM support capability */ + pgmap->type = 0; Ooff, thanks for catching that. For the KFD driver changes you can add Fixes: c83dee9b6394 ("drm/amdkfd: add SPM support for SVM") Reviewed-by: Felix Kuehling return PTR_ERR(r);

Re: [PATCH v3 2/2] drm/amdgpu: Enable clear page functionality

2023-12-14 Thread Felix Kuehling
ng to set the DRM_BUDDY_CLEARED flag. - Remove ! from amdgpu_res_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu

Re: [PATCH 1/2] drm: update drm_show_memory_stats() for dma-bufs

2023-12-13 Thread Felix Kuehling
On 2023-12-07 13:02, Alex Deucher wrote: Show buffers as shared if they are shared via dma-buf as well (e.g., shared with v4l or some other subsystem). You can add KFD to that list. With the in-progress CUDA11 VM changes and improved interop between KFD and render nodes, sharing DMABufs betwee

Re: [PATCH 2/2] drm/amdgpu: Enable clear page functionality

2023-12-13 Thread Felix Kuehling
On 2023-12-13 9:20, Christian König wrote: Am 12.12.23 um 00:32 schrieb Felix Kuehling: On 2023-12-11 04:50, Christian König wrote: Am 08.12.23 um 20:53 schrieb Alex Deucher: [SNIP] You also need a functionality which resets all cleared blocks to uncleared after suspend/resume. No idea how

Re: [PATCH 2/2] drm/amdgpu: Enable clear page functionality

2023-12-11 Thread Felix Kuehling
On 2023-12-11 04:50, Christian König wrote: Am 08.12.23 um 20:53 schrieb Alex Deucher: [SNIP] You also need a functionality which resets all cleared blocks to uncleared after suspend/resume. No idea how to do this, maybe Alex knows of hand. Since the buffers are cleared on creation, is ther

Proposal to add CRIU support to DRM render nodes

2023-12-06 Thread Felix Kuehling
Executive Summary: We need to add CRIU support to DRM render nodes in order to maintain CRIU support for ROCm application once they start relying on render nodes for more GPU memory management. In this email I'm providing some background why we are doing this, and outlining some of the problems

Re: [PATCH 1/6] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-12-04 Thread Felix Kuehling
to 6.6. Cheers,   Felix Alex Thanks, Felix On 2023-12-01 18:34, Felix Kuehling wrote: This reverts commit 71a7974ac7019afeec105a54447ae1dc7216cbb3. These helper functions are needed for KFD to export and import DMABufs the right way without duplicating the tracking of DMABufs associated w

Re: [PATCH 1/6] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-12-01 Thread Felix Kuehling
Felix On 2023-12-01 18:34, Felix Kuehling wrote: This reverts commit 71a7974ac7019afeec105a54447ae1dc7216cbb3. These helper functions are needed for KFD to export and import DMABufs the right way without duplicating the tracking of DMABufs associated with GEM objects while ensuring that move not

[PATCH 3/6] drm/amdkfd: Import DMABufs for interop through DRM

2023-12-01 Thread Felix Kuehling
Use drm_gem_prime_fd_to_handle to import DMABufs for interop. This ensures that a GEM handle is created on import and that obj->dma_buf will be set and remain set as long as the object is imported into KFD. Signed-off-by: Felix Kuehling Reviewed-by: Ramesh Errabolu Reviewed-by: Xiaogang.C

[PATCH 2/6] drm/amdkfd: Export DMABufs from KFD using GEM handles

2023-12-01 Thread Felix Kuehling
Create GEM handles for exporting DMABufs using GEM-Prime APIs. The GEM handles are created in a drm_client_dev context to avoid exposing them in user mode contexts through a DMABuf import. Signed-off-by: Felix Kuehling Reviewed-by: Ramesh Errabolu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

[PATCH 5/6] drm/amdgpu: Auto-validate DMABuf imports in compute VMs

2023-12-01 Thread Felix Kuehling
VM. Revalidation after evictions is handled in the VM code. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 3 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 45 --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_bu

[PATCH 6/6] drm/amdkfd: Bump KFD ioctl version

2023-12-01 Thread Felix Kuehling
This is not strictly a change in the IOCTL API. This version bump is meant to indicate to user mode the presence of a number of changes and fixes that enable the management of VA mappings in compute VMs using the GEM_VA ioctl for DMABufs exported from KFD. Signed-off-by: Felix Kuehling

[PATCH 4/6] drm/amdgpu: New VM state for evicted user BOs

2023-12-01 Thread Felix Kuehling
Create a new VM state to track user BOs that are in the system domain. In the next patch this will be used do conditionally re-validate them in amdgpu_vm_handle_moved. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 + drivers/gpu/drm/amd/amdgpu

[PATCH 1/6] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-12-01 Thread Felix Kuehling
: Christian König Acked-by: Thomas Zimmermann Acked-by: Daniel Vetter Signed-off-by: Felix Kuehling --- drivers/gpu/drm/drm_prime.c | 33 ++--- include/drm/drm_prime.h | 7 +++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm

Re: [PATCH 1/3] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-11-28 Thread Felix Kuehling
On 2023-11-28 12:22, Alex Deucher wrote: On Thu, Nov 23, 2023 at 6:12 PM Felix Kuehling wrote: [+Alex] On 2023-11-17 16:44, Felix Kuehling wrote: This reverts commit 71a7974ac7019afeec105a54447ae1dc7216cbb3. These helper functions are needed for KFD to export and import DMABufs the right

Re: [PATCH 1/3] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-11-23 Thread Felix Kuehling
[+Alex] On 2023-11-17 16:44, Felix Kuehling wrote: This reverts commit 71a7974ac7019afeec105a54447ae1dc7216cbb3. These helper functions are needed for KFD to export and import DMABufs the right way without duplicating the tracking of DMABufs associated with GEM objects while ensuring that

Re: [PATCH v2 2/4] drm/prime: Helper to export dmabuf without fd

2023-11-22 Thread Felix Kuehling
R simply go back to v1 of this patch set, which was consistent at least. I think I'd prefer that because I don't really understand what you're trying to achieve. Thanks,   Felix Best regards Thomas Am 22.11.23 um 00:11 schrieb Felix Kuehling: Change drm_gem_prime_handle_to_fd

[PATCH v2 4/4] drm/amdkfd: Import DMABufs for interop through DRM

2023-11-21 Thread Felix Kuehling
Use drm_gem_prime_fd_to_handle to import DMABufs for interop. This ensures that a GEM handle is created on import and that obj->dma_buf will be set and remain set as long as the object is imported into KFD. Signed-off-by: Felix Kuehling Reviewed-by: Ramesh Errabolu Reviewed-by: Xiaogang.C

[PATCH v2 1/4] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-11-21 Thread Felix Kuehling
: Christian König CC: Thomas Zimmermann Signed-off-by: Felix Kuehling --- drivers/gpu/drm/drm_prime.c | 33 ++--- include/drm/drm_prime.h | 7 +++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm

[PATCH v2 3/4] drm/amdkfd: Export DMABufs from KFD using GEM handles

2023-11-21 Thread Felix Kuehling
Create GEM handles for exporting DMABufs using GEM-Prime APIs. The GEM handles are created in a drm_client_dev context to avoid exposing them in user mode contexts through a DMABuf import. Signed-off-by: Felix Kuehling Reviewed-by: Ramesh Errabolu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

[PATCH v2 2/4] drm/prime: Helper to export dmabuf without fd

2023-11-21 Thread Felix Kuehling
Change drm_gem_prime_handle_to_fd to drm_gem_prime_handle_to_dmabuf to export a dmabuf without creating an FD as a user mode handle. This is more useful for users in kernel mode. Suggested-by: Thomas Zimmermann Signed-off-by: Felix Kuehling --- drivers/gpu/drm/drm_prime.c | 63

Re: [Bug 218168] New: amdgpu: kfd_topology.c warning: the frame size of 1408 bytes is larger than 1024 bytes

2023-11-21 Thread Felix Kuehling
the stack when inlining which can blow up the stack. Cc: Arnd Bergmann Acked-by: Arnd Bergmann Reviewed-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Alex Deucher commit 1f3b515578a1d73926993629a06a7f3b60535b59 Author: Alex Deucher Date: Thu Sep 21

Re: [PATCH 1/3] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-11-20 Thread Felix Kuehling
On 2023-11-20 11:02, Thomas Zimmermann wrote: Hi Christian Am 20.11.23 um 16:22 schrieb Christian König: Am 20.11.23 um 16:18 schrieb Thomas Zimmermann: Hi Am 20.11.23 um 16:06 schrieb Felix Kuehling: On 2023-11-20 6:54, Thomas Zimmermann wrote: Hi Am 17.11.23 um 22:44 schrieb Felix

Re: [PATCH 1/3] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-11-20 Thread Felix Kuehling
On 2023-11-20 6:54, Thomas Zimmermann wrote: Hi Am 17.11.23 um 22:44 schrieb Felix Kuehling: This reverts commit 71a7974ac7019afeec105a54447ae1dc7216cbb3. These helper functions are needed for KFD to export and import DMABufs the right way without duplicating the tracking of DMABufs

[PATCH 3/3] drm/amdkfd: Import DMABufs for interop through DRM

2023-11-17 Thread Felix Kuehling
Use drm_gem_prime_fd_to_handle to import DMABufs for interop. This ensures that a GEM handle is created on import and that obj->dma_buf will be set and remain set as long as the object is imported into KFD. Signed-off-by: Felix Kuehling Reviewed-by: Ramesh Errabolu Reviewed-by: Xiaogang.C

[PATCH 2/3] drm/amdkfd: Export DMABufs from KFD using GEM handles

2023-11-17 Thread Felix Kuehling
Create GEM handles for exporting DMABufs using GEM-Prime APIs. The GEM handles are created in a drm_client_dev context to avoid exposing them in user mode contexts through a DMABuf import. Signed-off-by: Felix Kuehling Reviewed-by: Ramesh Errabolu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

[PATCH 1/3] Revert "drm/prime: Unexport helpers for fd/handle conversion"

2023-11-17 Thread Felix Kuehling
: Christian König CC: Thomas Zimmermann Signed-off-by: Felix Kuehling --- drivers/gpu/drm/drm_prime.c | 33 ++--- include/drm/drm_prime.h | 7 +++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm

Re: [PATCH 4/6] drm/amdkfd: Export DMABufs from KFD using GEM handles

2023-11-16 Thread Felix Kuehling
On 2023-11-07 11:58, Felix Kuehling wrote: Create GEM handles for exporting DMABufs using GEM-Prime APIs. The GEM handles are created in a drm_client_dev context to avoid exposing them in user mode contexts through a DMABuf import. This patch (and the next one) won't apply upstream be

Re: [Patch v2] drm/ttm: Schedule delayed_delete worker closer

2023-11-08 Thread Felix Kuehling
NUMA systems (dGPU) and AMD APU platforms such as GFXIP9.4.3. Acked-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Reviewed-by: Christian König Going to push this to drm-misc-next. Hold on. Rajneesh just pointed out a WARN regression from testing. I think the problem is that the bdev

Re: [PATCH] drm/ttm: Schedule delayed_delete worker closer

2023-11-07 Thread Felix Kuehling
across interconnect boundaries such as xGMI, PCIe etc. This change helps USWC GTT allocations on NUMA systems (dGPU) and AMD APU platforms such as GFXIP9.4.3. Signed-off-by: Rajneesh Bhardwaj Acked-by: Felix Kuehling --- drivers/gpu/drm/ttm/ttm_bo.c | 10 +- drivers/gpu/drm/ttm

Re: [PATCH 03/11] drm/amdkfd: Improve amdgpu_vm_handle_moved

2023-11-01 Thread Felix Kuehling
On 2023-10-17 17:13, Felix Kuehling wrote: Let amdgpu_vm_handle_moved update all BO VA mappings of BOs reserved by the caller. This will be useful for handling extra BO VA mappings in KFD VMs that are managed through the render node API. Signed-off-by: Felix Kuehling Reviewed-by: Christian

[PATCH 11/11] drm/amdkfd: Bump KFD ioctl version

2023-10-17 Thread Felix Kuehling
This is not strictly a change in the IOCTL API. This version bump is meant to indicate to user mode the presence of a number of changes and fixes that enable the management of VA mappings in compute VMs using the GEM_VA ioctl for DMABufs exported from KFD. Signed-off-by: Felix Kuehling

[PATCH 08/11] drm/amdgpu: Auto-validate DMABuf imports in compute VMs

2023-10-17 Thread Felix Kuehling
VM. Revalidation after evictions is handled in the VM code. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 3 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 15 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_bu

[PATCH 03/11] drm/amdkfd: Improve amdgpu_vm_handle_moved

2023-10-17 Thread Felix Kuehling
Let amdgpu_vm_handle_moved update all BO VA mappings of BOs reserved by the caller. This will be useful for handling extra BO VA mappings in KFD VMs that are managed through the render node API. Signed-off-by: Felix Kuehling Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu

[PATCH 10/11] drm/amdkfd: Import DMABufs for interop through DRM

2023-10-17 Thread Felix Kuehling
Use drm_gem_prime_fd_to_handle to import DMABufs for interop. This ensures that a GEM handle is created on import and that obj->dma_buf will be set and remain set as long as the object is imported into KFD. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h|

[PATCH 09/11] drm/amdkfd: Export DMABufs from KFD using GEM handles

2023-10-17 Thread Felix Kuehling
Create GEM handles for exporting DMABufs using GEM-Prime APIs. The GEM handles are created in a drm_client_dev context to avoid exposing them in user mode contexts through a DMABuf import. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 11 +++ drivers/gpu

[PATCH 07/11] drm/amdgpu: New VM state for evicted user BOs

2023-10-17 Thread Felix Kuehling
Create a new VM state to track user BOs that are in the system domain. In the next patch this will be used do conditionally re-validate them in amdgpu_vm_handle_moved. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 + drivers/gpu/drm/amd/amdgpu

[PATCH 06/11] drm/amdkfd: Move TLB flushing logic into amdgpu

2023-10-17 Thread Felix Kuehling
not a production use case. Signed-off-by: Felix Kuehling Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 29 -- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 5 --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 44 ++ drivers/gpu/drm/amd/a

[PATCH 05/11] drm/amdgpu: update mappings not managed by KFD

2023-10-17 Thread Felix Kuehling
When restoring after an eviction, use amdgpu_vm_handle_moved to update BO VA mappings in KFD VMs that are not managed through the KFD API. This should allow using the render node API to create more flexible memory mappings in KFD VMs. Signed-off-by: Felix Kuehling Acked-by: Christian König

[PATCH 02/11] drm/amdgpu: Reserve fences for VM update

2023-10-17 Thread Felix Kuehling
In amdgpu_dma_buf_move_notify reserve fences for the page table updates in amdgpu_vm_clear_freed and amdgpu_vm_handle_moved. This fixes a BUG_ON in dma_resv_add_fence when using SDMA for page table updates. Signed-off-by: Felix Kuehling Reviewed-by: Christian König --- drivers/gpu/drm/amd

[PATCH 04/11] drm/amdgpu: Attach eviction fence on alloc

2023-10-17 Thread Felix Kuehling
Instead of attaching the eviction fence when a KFD BO is first mapped, attach it when it is allocated or imported. This in preparation to allow KFD BOs to be mapped using the render node API. Signed-off-by: Felix Kuehling Acked-by: Christian König --- .../gpu/drm/amd/amdgpu

[PATCH 01/11] drm/amdgpu: Fix possible null pointer dereference

2023-10-17 Thread Felix Kuehling
abo->tbo.resource may be NULL in amdgpu_vm_bo_update. Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 00/11] Enable integration of KFD with DRM GEM_VA ioctl

2023-10-17 Thread Felix Kuehling
ROCm user mode, better interoperability between compute and graphics, as well as sharing of memory between processes using DMABufs. Felix Kuehling (11): drm/amdgpu: Fix possible null pointer dereference drm/amdgpu: Reserve fences for VM update drm/amdkfd: Improve amdgpu_vm_handle_moved drm

Re: [PATCH] drm/amdkfd: clean up some inconsistent indenting

2023-10-17 Thread Felix Kuehling
The patch is Reviewed-by: Felix Kuehling Applied to amd-staging-drm-next. Thanks,   Felix --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c index

Re: [PATCH v4 1/1] drm/amdkfd: get doorbell's absolute offset based on the db_size

2023-10-05 Thread Felix Kuehling
_size as parameter to get db absolute offset. v4: Squash the two patches into one. Cc: Christian Koenig Cc: Alex Deucher Signed-off-by: Shashank Sharma Signed-off-by: Arvind Yadav Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h| 5 +++-- driver

Re: [PATCH v3 2/2] drm/amdkfd: get doorbell's absolute offset based on the db size

2023-10-04 Thread Felix Kuehling
On 2023-10-04 12:16, Arvind Yadav wrote: This patch is to align the absolute doorbell offset based on the doorbell's size. So that doorbell offset will be aligned for both 32 bit and 64 bit. v2: - Addressed the review comment from Felix. v3: - Adding doorbell_size as parameter to get db absolu

Re: [PATCH v2 1/1] drm/amdkfd: Fix unaligned doorbell absolute offset for gfx8

2023-09-28 Thread Felix Kuehling
On 2023-09-28 11:38, Shashank Sharma wrote: Hello Felix, Mukul, On 28/09/2023 17:30, Felix Kuehling wrote: On 2023-09-28 10:30, Joshi, Mukul wrote: [AMD Official Use Only - General] -Original Message- From: Yadav, Arvind Sent: Thursday, September 28, 2023 5:54 AM To: Koenig

Re: [PATCH v2 1/1] drm/amdkfd: Fix unaligned doorbell absolute offset for gfx8

2023-09-28 Thread Felix Kuehling
On 2023-09-28 10:30, Joshi, Mukul wrote: [AMD Official Use Only - General] -Original Message- From: Yadav, Arvind Sent: Thursday, September 28, 2023 5:54 AM To: Koenig, Christian ; Deucher, Alexander ; Sharma, Shashank ; Kuehling, Felix ; Joshi, Mukul ; Pan, Xinhui ; airl...@gmail.com;

Re: [PATCH 1/1] drm/amdkfd: Fix unaligned doorbell absolute offset for gfx8

2023-09-27 Thread Felix Kuehling
[+Mukul] On 2023-09-27 12:16, Arvind Yadav wrote: This patch is to adjust the absolute doorbell offset against the doorbell id considering the doorbell size of 32/64 bit. Cc: Christian Koenig Cc: Alex Deucher Signed-off-by: Shashank Sharma Signed-off-by: Arvind Yadav --- drivers/gpu/drm/amd/a

Re: [PATCH v2 1/2] drm/amdgpu: Merge debug module parameters

2023-08-31 Thread Felix Kuehling
ee the last value written by user mode. With your changes, this is no longer writable, and driver code is now looking at adev->debug_vm, which cannot be updated through sysfs. As long as everyone is OK with that change, I have no objections. Just pointing it out. Regardless

Re: [PATCH] drm/prime: Support page array >= 4GB

2023-08-28 Thread Felix Kuehling
#x27;t have authority to approve it. But FWIW, Acked-by: Felix Kuehling Can anyone give a Reviewed-by? Thanks,   Felix --- drivers/gpu/drm/drm_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index f

Re: [PATCH AUTOSEL 5.15 6/6] drm/amdkfd: ignore crat by default

2023-08-23 Thread Felix Kuehling
no need to enable this. It's often buggy on consumer platforms anyway. This is not needed for stable. I agree. I was about to comment in the 5.10 patch as well. Regards,   Felix Alex Reviewed-by: Felix Kuehling Acked-by: Christian König Tested-by: Mike Lothian Signed-off-by:

Re: [PATCH] drm/prime: Support page array >= 4GB

2023-08-23 Thread Felix Kuehling
On 2023-08-23 01:49, Christian König wrote: Am 22.08.23 um 20:27 schrieb Philip Yang: On 2023-08-22 05:43, Christian König wrote: Am 21.08.23 um 22:02 schrieb Philip Yang: Without unsigned long typecast, the size is passed in as zero if page array size >= 4GB, nr_pages >= 0x10, then sg

Re: Implement svm without BO concept in xe driver

2023-08-21 Thread Felix Kuehling
On 2023-08-21 15:41, Zeng, Oak wrote: I have thought about emulating BO allocation APIs on top of system SVM. This was in the context of KFD where memory management is not tied into command submissions APIs, which would add a whole other layer of complexity. The main unsolved (unsolvable?) prob

Re: Implement svm without BO concept in xe driver

2023-08-21 Thread Felix Kuehling
On 2023-08-21 11:10, Zeng, Oak wrote: Accidently deleted Brian. Add back. Thanks, Oak -Original Message- From: Zeng, Oak Sent: August 21, 2023 11:07 AM To: Dave Airlie Cc: Brost, Matthew ; Thomas Hellström ; Philip Yang ; Felix Kuehling ; dri-devel@lists.freedesktop.org; intel- x

Re: Implement svm without BO concept in xe driver

2023-08-18 Thread Felix Kuehling
should call the new drm_vram_manager for eviction/accounting I will come back with some RFC proof of concept codes later. Cheers, Oak -Original Message- From: Thomas Hellström Sent: August 18, 2023 3:36 AM To: Zeng, Oak ; Dave Airlie ; Felix Kuehling Cc: Christian König ; Brost, Matthew

Re: Implement svm without BO concept in xe driver

2023-08-16 Thread Felix Kuehling
23 2:06 AM To: Zeng, Oak ; Felix Kuehling ; Thomas Hellström ; Brost, Matthew ; Vishwanathapura, Niranjana ; Welty, Brian ; Philip Yang ; intel...@lists.freedesktop.org; dri- de...@lists.freedesktop.org Subject: Re: Implement svm without BO concept in xe driver Hi Oak, yeah, I completely agree wi

Re: Implement svm without BO concept in xe driver

2023-08-15 Thread Felix Kuehling
Intel-xe *On Behalf Of *Zeng, Oak *Sent:* August 14, 2023 11:38 PM *To:* Thomas Hellström ; Brost, Matthew ; Vishwanathapura, Niranjana ; Welty, Brian ; Felix Kuehling ; Philip Yang ; intel...@lists.freedesktop.org; dri-devel@lists.freedesktop.org *Subject:* [Intel-xe] Implement svm with

Re: [PATCH] drm/amdkfd: fix build failure without CONFIG_DYNAMIC_DEBUG

2023-08-04 Thread Felix Kuehling
d: avoid svm dump when dynamic debug disabled") Signed-off-by: Arnd Bergmann The patch is Reviewed-by: Felix Kuehling I'm applying it to amd-staging-drm-next. Thanks,   Felix --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu

Re: [PATCH v2 2/4] drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Felix Kuehling
Am 2023-07-19 um 03:51 schrieb Kefeng Wang: Use the helpers to simplify code. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Kefeng Wang Reviewed-by: Felix Kuehling --- driver

Re: [PATCH 3/5] drm/amdkfd: use vma_is_stack() and vma_is_heap()

2023-07-14 Thread Felix Kuehling
Am 2023-07-14 um 10:26 schrieb Vlastimil Babka: On 7/12/23 18:24, Felix Kuehling wrote: Allocations in the heap and stack tend to be small, with several allocations sharing the same page. Sharing the same page for different allocations with different access patterns leads to thrashing when we

Re: [PATCH 3/5] drm/amdkfd: use vma_is_stack() and vma_is_heap()

2023-07-12 Thread Felix Kuehling
Allocations in the heap and stack tend to be small, with several allocations sharing the same page. Sharing the same page for different allocations with different access patterns leads to thrashing when we migrate data back and forth on GPU and CPU access. To avoid this we disable HMM migration

Re: [PATCH] drm/amdkfd: Switch over to memdup_user()

2023-06-14 Thread Felix Kuehling
Am 2023-06-13 um 22:04 schrieb Jiapeng Chong: Use memdup_user() rather than duplicating its implementation. This is a little bit restricted to reduce false positives. ./drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c:2813:13-20: WARNING opportunity for memdup_user. Reported-by: Abaci R

  1   2   3   4   5   6   7   8   9   >