Re: [PATCH] drm/ttm: WIP limit the TTM pool to 32bit CPUs

2025-08-07 Thread Thomas Hellström
On Thu, 2025-08-07 at 11:53 +0200, Christian König wrote: > On 06.08.25 19:43, Thomas Hellström wrote: > > Hi, Christian > > > > On Wed, 2025-08-06 at 15:28 +0200, Christian König wrote: > > > On some old x86 systems we had the problem that changing the > > &

Re: [PATCH] drm/ttm: WIP limit the TTM pool to 32bit CPUs

2025-08-06 Thread Thomas Hellström
Hi, Christian On Wed, 2025-08-06 at 15:28 +0200, Christian König wrote: > On some old x86 systems we had the problem that changing the caching > flags > of system memory requires changing the global MTRR/PAT tables. > > But on any modern x86 system (CPUs introduced rughly after 2004) we > actuall

Re: [PATCH v4] Mark xe driver as BROKEN if kernel page size is not 4kB

2025-08-04 Thread Thomas Hellström
On Sat, 2025-08-02 at 11:40 +0900, Simon Richter wrote: > This driver, for the time being, assumes that the kernel page size is > 4kB, > so it fails on loong64 and aarch64 with 16kB pages, and ppc64el with > 64kB > pages. > > Signed-off-by: Simon Richter > Cc: sta...@vger.kernel.org > --- >  driv

Re: [PATCH v3] Mark xe driver as BROKEN if kernel page size is not 4kB

2025-08-01 Thread Thomas Hellström
On Fri, 2025-08-01 at 16:39 +0200, Thomas Hellström wrote: > On Fri, 2025-08-01 at 19:19 +0900, Simon Richter wrote: > > This driver, for the time being, assumes that the kernel page size > > is > > 4kB, > > so it fails on loong64 and aarch64 with 16kB pages, an

Re: [PATCH v3] Mark xe driver as BROKEN if kernel page size is not 4kB

2025-08-01 Thread Thomas Hellström
.kernel.org Reviewed-by: Thomas Hellström I will add a Fixes: tag and push this. Thanks, Thomas > --- >  drivers/gpu/drm/xe/Kconfig | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig > index 2bb2bc0

Re: [PATCH v2 1/1] Mark xe driver as BROKEN if kernel page size is not 4kB

2025-08-01 Thread Thomas Hellström
On Sun, 2025-07-27 at 16:04 +0900, Simon Richter wrote: > This driver, for the time being, assumes that the kernel page size is > 4kB, > so it fails on loong64 and aarch64 with 16kB pages, and ppc64el with > 64kB > pages. > > Signed-off-by: Simon Richter > Cc: sta...@vger.kernel.org This looks r

Re: Switching over to GEM refcounts and a bunch of cleanups

2025-07-22 Thread Thomas Hellström
Hi, Christian, On Wed, 2025-07-16 at 18:04 +0200, Christian König wrote: > Hi guys, > > so I hope Thomas is back from vacation while I will be on vacation > for > the next two weeks. > > Here is the patch set which cleans up TTM and XE in preperation of > switching to drm_exec. > > Please take

Re: [PATCH v3 3/8] drm/xe: Fix typo "notifer"

2025-07-22 Thread Thomas Hellström
On Tue, 2025-07-22 at 15:34 +0800, WangYuli wrote: > There is a spelling mistake of 'notifer' in the comment which > should be 'notifier'. > > Signed-off-by: WangYuli Reviewed-by: Thomas Hellström > --- >  drivers/gpu/drm/xe/xe_vm_types.h | 2 +- >  1

Re: [bug report] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration

2025-07-21 Thread Thomas Hellström
On Sat, 2025-06-28 at 22:51 -0500, Dan Carpenter wrote: > Hello Thomas Hellström, > > Commit bb8aa27eff6f ("drm/ttm, drm_xe, Implement > ttm_lru_walk_for_evict() using the guarded LRU iteration") from Jun > 23, 2025 (linux-next), leads to the following (unpublished

Re: [bug report] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration

2025-07-21 Thread Thomas Hellström
Hi! On Tue, 2025-07-01 at 12:49 -0500, Dan Carpenter wrote: > Hello Thomas Hellström, > > Commit bb8aa27eff6f ("drm/ttm, drm_xe, Implement > ttm_lru_walk_for_evict() using the guarded LRU iteration") from Jun > 23, 2025 (linux-next), leads to the following Smatch

Re: [PATCH v2 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration

2025-06-26 Thread Thomas Hellström
On Thu, 2025-06-26 at 13:06 +0200, Christian König wrote: > On 23.06.25 17:53, Thomas Hellström wrote: > > To avoid duplicating the tricky bo locking implementation, > > Implement ttm_lru_walk_for_evict() using the guarded bo LRU > > iteration. > > > > To facil

[PATCH v2 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration

2025-06-23 Thread Thomas Hellström
from ticketlocking in the loop by skipping to the next item. (Intel CI) Signed-off-by: Thomas Hellström --- drivers/gpu/drm/ttm/ttm_bo_util.c | 188 -- drivers/gpu/drm/xe/xe_shrinker.c | 7 +- include/drm/ttm/ttm_bo.h | 9 +- 3 files changed, 88

[PATCH v2 2/3] drm/ttm, drm/xe: Modify the struct ttm_bo_lru_walk_cursor initialization

2025-06-23 Thread Thomas Hellström
Instead of the struct ttm_operation_ctx, Pass a struct ttm_lru_walk_arg to enable us to easily extend the walk functionality, and to implement ttm_lru_walk_for_evict() using the guarded LRU iteration. Signed-off-by: Thomas Hellström Reviewed-by: Christian König --- drivers/gpu/drm/ttm

[PATCH v2 1/3] drm/ttm: Use a struct for the common part of struct ttm_lru_walk and struct ttm_bo_lru_cursor

2025-06-23 Thread Thomas Hellström
Let the locking functions take the new struct ttm_lru_walk_arg as argument in order for them to be easily used from both types of walk. v2: - Whitespace fix Signed-off-by: Thomas Hellström Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 24

[PATCH v2 0/3] drm/ttm, drm/xe: Consolidate the Buffer Object LRU walks

2025-06-23 Thread Thomas Hellström
t the ttm_lru_walk_for_evict() function in terms of the guarded iteration also exposed to drivers. This means that when we get to implement locking using drm_exec, we only need to do that in a single place. Add ticketlocking support to the guarded iteration and modify the iteration arguments. Thomas Hell

Re: [PATCH v5 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-23 Thread Thomas Hellström
Hi, Alistair, On Thu, 2025-06-19 at 12:07 +0200, Thomas Hellström wrote: > > Hi, Alistair, Thanks for having a look! That patch series is ready to be merged. Do you have any outstanding concerns? Thanks, Thomas > > On Thu, 2025-06-19 at 14:52 +1000, Alistair Popple wrote: >

[PATCH v6 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-19 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. v3: - Fix a kerneldoc failure (Matt Brost) - Revert the bo type change from device to kernel (Matt Brost) v4: - Add an assert in xe_svm_alloc_vram (Matt Brost) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost

[PATCH v6 2/3] drm/pagemap: Add a populate_mm op

2025-06-19 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Clarify how migration using it is intended to work. v3: - Kerneldoc fixes and updates (Matt Brost). v4: - More kerneldoc fixes. Rebase. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost --- drivers/gpu/drm

[PATCH v6 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-19 Thread Thomas Hellström
documentation about how the drm_pagemap migration should be interpreted until upcoming patches where the functionality is implemented. (Matt Brost) v4: - More kerneldoc fixes around timeslice_ms (Himal Ghimiray, Matt Brost) v6: - Fix an uninitialized pagemap pointer (CI) Co-developed-by: Thom

[PATCH v6 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-19 Thread Thomas Hellström
st (1): drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap Thomas Hellström (2): drm/pagemap: Add a populate_mm op drm/xe: Implement and use the drm_pagemap populate_mm op Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/drm/Makefile | 6 +- driver

Re: [PATCH v5 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-19 Thread Thomas Hellström
Hi, Alistair, Thanks for having a look! On Thu, 2025-06-19 at 14:52 +1000, Alistair Popple wrote: > On Wed, Jun 18, 2025 at 10:16:14PM +0200, Thomas Hellström wrote: > > This patchset modifies the migration part of drm_gpusvm to > > drm_pagemap and > > adds a populate_m

[PATCH v5 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-18 Thread Thomas Hellström
documentation about how the drm_pagemap migration should be interpreted until upcoming patches where the functionality is implemented. (Matt Brost) v4: - More kerneldoc fixes around timeslice_ms (Himal Ghimiray, Matt Brost) Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström

[PATCH v5 2/3] drm/pagemap: Add a populate_mm op

2025-06-18 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Clarify how migration using it is intended to work. v3: - Kerneldoc fixes and updates (Matt Brost). v4: - More kerneldoc fixes. Rebase. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost --- drivers/gpu/drm

[PATCH v5 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-18 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. v3: - Fix a kerneldoc failure (Matt Brost) - Revert the bo type change from device to kernel (Matt Brost) v4: - Add an assert in xe_svm_alloc_vram (Matt Brost) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost

[PATCH v5 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-18 Thread Thomas Hellström
Move migration functionality to drm_pagemap Thomas Hellström (2): drm/pagemap: Add a populate_mm op drm/xe: Implement and use the drm_pagemap populate_mm op Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/drm/Makefile | 6 +- drivers/gpu/drm/drm_gpusvm.c

Re: [PATCH v4 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-18 Thread Thomas Hellström
Hi, Matt, On Wed, 2025-06-18 at 08:26 -0700, Matthew Brost wrote: > On Wed, Jun 18, 2025 at 04:21:22PM +0530, Ghimiray, Himal Prasad > wrote: > > > > > > On 18-06-2025 14:56, Thomas Hellström wrote: > > > From: Matthew Brost > > > > > > T

[PATCH v4 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-18 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. v3: - Fix a kerneldoc failure (Matt Brost) - Revert the bo type change from device to kernel (Matt Brost) v4: - Add an assert in xe_svm_alloc_vram (Matt Brost) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost

[PATCH v4 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-18 Thread Thomas Hellström
gemap Thomas Hellström (2): drm/pagemap: Add a populate_mm op drm/xe: Implement and use the drm_pagemap populate_mm op Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/drm/Makefile | 6 +- drivers/gpu/drm/drm_gpusvm.c | 761 +--- drivers/gp

[PATCH v4 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-18 Thread Thomas Hellström
documentation about how the drm_pagemap migration should be interpreted until upcoming patches where the functionality is implemented. (Matt Brost) v4: - More kerneldoc fixes around timeslice_ms (Himal Ghimiray, Matt Brost) Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström

[PATCH v4 2/3] drm/pagemap: Add a populate_mm op

2025-06-18 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Clarify how migration using it is intended to work. v3: - Kerneldoc fixes and updates (Matt Brost). v4: - More kerneldoc fixes. Rebase. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost --- drivers/gpu/drm

Re: [PATCH v3 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-17 Thread Thomas Hellström
On Tue, 2025-06-17 at 10:04 -0700, Matthew Brost wrote: > On Tue, Jun 17, 2025 at 04:55:26PM +0200, Thomas Hellström wrote: > > On Tue, 2025-06-17 at 20:17 +0530, Ghimiray, Himal Prasad wrote: > > > > > > > > > On 17-06-2025 18:41, Thomas Hellström wrote:

Re: [PATCH v3 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-17 Thread Thomas Hellström
On Tue, 2025-06-17 at 10:09 -0700, Matthew Brost wrote: > On Fri, Jun 13, 2025 at 04:02:19PM +0200, Thomas Hellström wrote: > > Add runtime PM since we might call populate_mm on a foreign device. > > > > v3: > > - Fix a kerneldoc failure (Matt Brost) > > - Revert

Re: [PATCH v3 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-17 Thread Thomas Hellström
On Tue, 2025-06-17 at 20:17 +0530, Ghimiray, Himal Prasad wrote: > > > On 17-06-2025 18:41, Thomas Hellström wrote: > > On Tue, 2025-06-17 at 18:25 +0530, Ghimiray, Himal Prasad wrote: > > > > > > > > > On 13-06-2025 19:32, Thomas He

Re: [PATCH v3 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-17 Thread Thomas Hellström
On Tue, 2025-06-17 at 18:25 +0530, Ghimiray, Himal Prasad wrote: > > > On 13-06-2025 19:32, Thomas Hellström wrote: > > From: Matthew Brost > > > > The migration functionality and track-keeping of per-pagemap VRAM > > mapped to the CPU mm is not per GPU_vm, bu

Re: [PATCH 6/6] drm/ttm: replace TTMs refcount with the DRM refcount

2025-06-17 Thread Thomas Hellström
Hi, Christian, On Mon, 2025-06-16 at 15:07 +0200, Christian König wrote: > Instead of keeping a separate reference count for the TTM object also > use > the reference count for DRM GEM objects inside TTM. > > Apart from avoiding two reference counts for one object this approach > has > the clear

Re: [PATCH 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration

2025-06-16 Thread Thomas Hellström
On Mon, 2025-06-16 at 15:23 +0200, Christian König wrote: > On 6/13/25 17:18, Thomas Hellström wrote: > > To avoid duplicating the tricky bo locking implementation, > > Implement ttm_lru_walk_for_evict() using the guarded bo LRU > > iteration. > > > > To facil

[PATCH 1/3] drm/ttm: Use a struct for the common part of struct ttm_lru_walk and struct ttm_bo_lru_cursor.

2025-06-13 Thread Thomas Hellström
Let the locking functions take the new struct ttm_lru_walk_arg as argument in order for them to be easily used from both types of walk. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/ttm/ttm_bo.c | 24 ++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 26

[PATCH 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration

2025-06-13 Thread Thomas Hellström
To avoid duplicating the tricky bo locking implementation, Implement ttm_lru_walk_for_evict() using the guarded bo LRU iteration. To facilitate this, support ticketlocking from the guarded bo LRU iteration. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/ttm/ttm_bo_util.c | 166

[PATCH 2/3] drm/ttm, drm/xe: Modify the struct ttm_bo_lru_walk_cursor initialization

2025-06-13 Thread Thomas Hellström
Instead of the struct ttm_operation_ctx, Pass a struct ttm_lru_walk_arg to enable us to easily extend the walk functionality, and to implement ttm_lru_walk_for_evict() using the guarded LRU iteration. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/ttm/ttm_bo_util.c | 10 +- drivers

[PATCH 0/3] drm/ttm, drm/xe: Consolidate the Buffer Object LRU walks

2025-06-13 Thread Thomas Hellström
t the ttm_lru_walk_for_evict() function in terms of the guarded iteration also exposed to drivers. This means that when we get to implement locking using drm_exec, we only need to do that in a single place. Add ticketlocking support to the guarded iteration and modify the iteration arguments. Thomas Hell

[PATCH v3 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-13 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. v3: - Fix a kerneldoc failure (Matt Brost) - Revert the bo type change from device to kernel (Matt Brost) Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c | 1 + drivers/gpu/drm/xe/xe_svm.c | 101

[PATCH v3 2/3] drm/pagemap: Add a populate_mm op

2025-06-13 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Clarify how migration using it is intended to work. v3: - Kerneldoc fixes and updates (Matt Brost). Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost #v1 --- drivers/gpu/drm/drm_gpusvm.c | 7 ++-- drivers

[PATCH v3 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-13 Thread Thomas Hellström
: - Rebase. v3: - Documentation updates (CI, Matt Brost) - Don't change TTM buffer object type for VRAM allocations (Matt Brost) Matthew Brost (1): drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap Thomas Hellström (2): drm/pagemap: Add a populate_mm op drm/xe: Implement an

[PATCH v3 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-13 Thread Thomas Hellström
documentation about how the drm_pagemap migration should be interpreted until upcoming patches where the functionality is implemented. (Matt Brost) Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström --- Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/drm/Makefi

Re: [PATCH v2 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-13 Thread Thomas Hellström
On Thu, 2025-06-05 at 15:16 -0700, Matthew Brost wrote: > On Wed, Jun 04, 2025 at 11:35:36AM +0200, Thomas Hellström wrote: > > Add runtime PM since we might call populate_mm on a foreign device. > > Also create the VRAM bos as ttm_bo_type_kernel. This avoids the > > ini

Re: [PATCH v2 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-13 Thread Thomas Hellström
On Thu, 2025-06-05 at 15:44 -0700, Matthew Brost wrote: > On Wed, Jun 04, 2025 at 11:35:34AM +0200, Thomas Hellström wrote: > > From: Matthew Brost > > > > The migration functionality and track-keeping of per-pagemap VRAM > > mapped to the CPU mm is not per GPU

Re: [PATCH v2 2/3] drm/pagemap: Add a populate_mm op

2025-06-05 Thread Thomas Hellström
On Wed, 2025-06-04 at 15:05 -0700, Matthew Brost wrote: > On Wed, Jun 04, 2025 at 11:35:35AM +0200, Thomas Hellström wrote: > > Add an operation to populate a part of a drm_mm with device > > private memory. > > > > With the kernel doc fixed: > Reviewed-by: Matthe

Re: [PATCH v2 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-05 Thread Thomas Hellström
On Wed, 2025-06-04 at 08:04 -0700, Matthew Brost wrote: > On Wed, Jun 04, 2025 at 11:35:36AM +0200, Thomas Hellström wrote: > > Add runtime PM since we might call populate_mm on a foreign device. > > I think taking a runtime PM will fix hard to hit splat [1] too. &

Re: [PATCH v2] drm/ttm: Fix compile error when CONFIG_SHMEM is not set

2025-06-04 Thread Thomas Hellström
ig b/drivers/gpu/drm/Kconfig > index f094797f3b2b..ded28c71d89c 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -188,6 +188,7 @@ source "drivers/gpu/drm/display/Kconfig" >  config DRM_TTM >   tristate >   depends on DRM && MMU > + select SHMEM >   help >     GPU memory management subsystem for devices with multiple >     GPU memory types. Will be enabled automatically if a > device driver Reviewed-by: Thomas Hellström Thanks, Thomas

Re: [PATCH] mm: Fix compile error when CONFIG_SHMEM is not set

2025-06-04 Thread Thomas Hellström
On Wed, 2025-06-04 at 08:04 -0400, Steven Rostedt wrote: > On Wed, 4 Jun 2025 00:03:18 -0700 (PDT) > Hugh Dickins wrote: > > > I vote for the "select SHMEM", but Thomas and dri-devel and Linus > > should decide. > > I only tried "depends on SHMEM" which did not work, but it looks like > "select

Re: [PATCH v2 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-04 Thread Thomas Hellström
hanks, > Christian. Sure, Felix was CC'd and I'll make sure Philip will be CC'd on the next revision. Thanks, Thomas > > On 6/4/25 11:35, Thomas Hellström wrote: > > This patchset modifies the migration part of drm_gpusvm to > > drm_pagemap and > > ad

[PATCH v2 2/3] drm/pagemap: Add a populate_mm op

2025-06-04 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_gpusvm.c | 7 ++- drivers/gpu/drm/drm_pagemap.c | 34 ++ include/drm/drm_pagemap.h | 34

[PATCH v2 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-06-04 Thread Thomas Hellström
listed as author of this commit since he wrote most of the code, and it makes sense to retain his git authorship. Thomas mostly moved the code around. Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström --- Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/dr

[PATCH v2 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-06-04 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. Also create the VRAM bos as ttm_bo_type_kernel. This avoids the initial clearing and the creation of an mmap handle. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c | 1 + drivers/gpu/drm/xe/xe_svm.c | 104

[PATCH v2 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-06-04 Thread Thomas Hellström
: - Rebase. Matthew Brost (1): drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap Thomas Hellström (2): drm/pagemap: Add a populate_mm op drm/xe: Implement and use the drm_pagemap populate_mm op Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/drm/Makefile

Re: [Linaro-mm-sig] Re: Sharing dma-bufs using a driver-private interconnect

2025-05-16 Thread Thomas Hellström
On Fri, 2025-05-16 at 10:44 +0200, Christian König wrote: > Hi Thomas, > > On 5/16/25 10:33, Thomas Hellström wrote: > > Hi! > > > > I previously discussed this with Simona on IRC but would like to > > get > > some feedback also from a wider audience: &g

Sharing dma-bufs using a driver-private interconnect

2025-05-16 Thread Thomas Hellström
Hi! I previously discussed this with Simona on IRC but would like to get some feedback also from a wider audience: We're planning to share dma-bufs using a fast interconnect in a way similar to pcie-p2p: The rough plan is to identify dma-bufs capable of sharing this way by looking at the address

[PATCH] drm/ttm: Remove the struct ttm_backup abstraction

2025-05-02 Thread Thomas Hellström
/#mb153ab9216cb813b92bdeb36f391ad4808c2ba29 Suggested-by: Christian König Fixes: 70d645deac98 ("drm/ttm: Add helpers for shrinking") Signed-off-by: Thomas Hellström --- drivers/gpu/drm/ttm/ttm_backup.c | 42 +--- drivers/gpu/drm/ttm/ttm_pool.c | 6 ++--- drivers/gpu/drm/ttm/ttm_tt.

[PATCH] drm/ttm: Fix ttm_backup kerneldoc

2025-05-02 Thread Thomas Hellström
The docs were not properly updated from an earlier version of the code. Fixes: e7b5d23e5d47 ("drm/ttm: Provide a shmem backup implementation") Cc: Christian König Cc: Matthew Brost Cc: Matthew Auld Cc: dri-devel@lists.freedesktop.org Signed-off-by: Thomas Hellström --- drivers/g

Re: [PATCH v2] drm/ttm: Silence randstruct warning about casting struct file

2025-05-02 Thread Thomas Hellström
On Fri, 2025-05-02 at 09:49 +0200, Christian König wrote: > On 5/2/25 07:33, Al Viro wrote: > > On Thu, May 01, 2025 at 09:52:08PM -0700, Matthew Brost wrote: > > > On Fri, May 02, 2025 at 05:31:49AM +0100, Al Viro wrote: > > > > On Thu, May 01, 2025 at 09:26:25PM -0700, Matthew Brost wrote: > > >

Re: [PULL] drm-xe-next

2025-04-28 Thread Thomas Hellström
    drm/xe: Update xe_ttm_access_memory to use GPU for non-visible > access >   drm/print: Add drm_coredump_printer_is_full >   drm/xe: Abort printing coredump in VM printer output if full >   drm/xe: Drop force_alloc from xe_bo_evict in selftests > > Michal Wajdeczko (2)

Re: [PATCH v4 2/5] drm/xe: Strict migration policy for atomic SVM faults

2025-04-25 Thread Thomas Hellström
On Fri, 2025-04-25 at 00:39 -0700, Matthew Brost wrote: > On Fri, Apr 25, 2025 at 09:18:19AM +0200, Thomas Hellström wrote: > > On Thu, 2025-04-24 at 11:03 -0700, Matthew Brost wrote: > > > On Thu, Apr 24, 2025 at 04:39:21PM +0200, Thomas Hellström wrote: > > > > On

Re: [PATCH v4 2/5] drm/xe: Strict migration policy for atomic SVM faults

2025-04-25 Thread Thomas Hellström
On Thu, 2025-04-24 at 11:03 -0700, Matthew Brost wrote: > On Thu, Apr 24, 2025 at 04:39:21PM +0200, Thomas Hellström wrote: > > On Tue, 2025-04-22 at 10:04 -0700, Matthew Brost wrote: > > > Mixing GPU and CPU atomics does not work unless a strict > > > migration > >

Re: [PATCH v4 2/5] drm/xe: Strict migration policy for atomic SVM faults

2025-04-24 Thread Thomas Hellström
On Tue, 2025-04-22 at 10:04 -0700, Matthew Brost wrote: > Mixing GPU and CPU atomics does not work unless a strict migration > policy of GPU atomics must be device memory. Enforce a policy of must > be > in VRAM with a retry loop of 2 attempts, if retry loop fails abort > fault. > > v2: >  - Only

[PATCH 2/3] drm/pagemap: Add a populate_mm op

2025-04-17 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_gpusvm.c | 7 ++- drivers/gpu/drm/drm_pagemap.c | 32 include/drm/drm_pagemap.h | 32 3

[PATCH 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

2025-04-17 Thread Thomas Hellström
Brost (1): drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap Thomas Hellström (2): drm/pagemap: Add a populate_mm op drm/xe: Implement and use the drm_pagemap populate_mm op Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/drm/Makefile | 6

[PATCH 3/3] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-04-17 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. Also create the VRAM bos as ttm_bo_type_kernel. This avoids the initial clearing and the creation of an mmap handle. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c | 4 +- drivers/gpu/drm/xe/xe_svm.c | 80

[PATCH 1/3] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-04-17 Thread Thomas Hellström
listed as author of this commit since he wrote most of the code, and it makes sense to retain his git authorship. Thomas mostly moved the code around. Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström --- Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/dr

Re: [PATCH 10/11] drm/xe: Test for imported buffers with drm_gem_is_imported()

2025-04-15 Thread Thomas Hellström
e import_attach optional. > > Signed-off-by: Thomas Zimmermann > Cc: Lucas De Marchi > Cc: "Thomas Hellström" > Cc: Rodrigo Vivi > Cc: intel...@lists.freedesktop.org > Cc: dri-devel@lists.freedesktop.org Reviewed-by: Thomas Hellström > --- >  drivers/

Re: [PATCH 3/7] drm/gpusvm: mark pages as dirty

2025-04-05 Thread Thomas Hellström
On Thu, 2025-03-20 at 17:30 +, Matthew Auld wrote: > If the memory is going to be accessed by the device, make sure we > mark > the pages accordingly such that the kernel knows this. This aligns > with > the xe-userptr code. > > Signed-off-by: Matthew Auld > Cc

Re: [PATCH 1/7] drm/gpusvm: fix hmm_pfn_to_map_order() usage

2025-03-20 Thread Thomas Hellström
apped by the mm. Fix is based on the xe userptr code, which in > a > future patch will directly use gpusvm, so needs alignment here. > > Reported-by: Thomas Hellström > Signed-off-by: Matthew Auld > Cc: Matthew Brost > --- >  drivers/gpu/drm/drm_gpusvm.c | 25

Re: [PATCH 2/7] drm/gpusvm: use more selective dma dir in get_pages()

2025-03-20 Thread Thomas Hellström
> good idea. > > Signed-off-by: Matthew Auld > Cc: Thomas Hellström > Cc: Matthew Brost Reviewed-by: Thomas Hellström > --- >  drivers/gpu/drm/drm_gpusvm.c | 8 +--- >  1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gpusvm.

Re: [RFC PATCH 00/19] drm, drm/xe: Multi-device GPUSVM

2025-03-17 Thread Thomas Hellström
On Thu, 2025-03-13 at 13:57 +0100, Christian König wrote: > Am 13.03.25 um 13:50 schrieb Thomas Hellström: > > Hi, Christian > > > > On Thu, 2025-03-13 at 11:19 +0100, Christian König wrote: > > > Am 12.03.25 um 22:03 schrieb Thomas Hellström: > > > > Thi

Re: [RFC PATCH 08/19] drm/xe/bo: Add a bo remove callback

2025-03-14 Thread Thomas Hellström
On Wed, 2025-03-12 at 22:04 +0100, Thomas Hellström wrote: > On device unbind, migrate exported bos, including pagemap bos to > system. This allows importers to take proper action without > disruption. In particular, SVM clients on remote devices may > continue as if nothing happe

[RFC PATCH 06/19] drm/pagemap, drm/xe: Add refcounting to struct drm_pagemap and manage lifetime

2025-03-13 Thread Thomas Hellström
Remove the xe embedded drm_pagemap, and instead allocate and reference count. This is a step towards adding drm_pagemaps on demand. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c| 58 +++- drivers/gpu/drm/xe/xe_device_types.h | 2 +- drivers

Re: [RFC PATCH 00/19] drm, drm/xe: Multi-device GPUSVM

2025-03-13 Thread Thomas Hellström
On Thu, 2025-03-13 at 13:57 +0100, Christian König wrote: > Am 13.03.25 um 13:50 schrieb Thomas Hellström: > > Hi, Christian > > > > On Thu, 2025-03-13 at 11:19 +0100, Christian König wrote: > > > Am 12.03.25 um 22:03 schrieb Thomas Hellström: > > > > Thi

Re: [RFC PATCH 00/19] drm, drm/xe: Multi-device GPUSVM

2025-03-13 Thread Thomas Hellström
Hi, Christian On Thu, 2025-03-13 at 11:19 +0100, Christian König wrote: > Am 12.03.25 um 22:03 schrieb Thomas Hellström: > > This RFC implements and requests comments for a way to handle SVM > > with multi-device, > > typically with fast interconnects. It adds generic code a

[RFC PATCH 12/19] drm/xe: Make the PT code handle placement per PTE rather than per vma / range

2025-03-12 Thread Thomas Hellström
With SVM, ranges forwarded to the PT code for binding can, mostly due to races when migrating, point to both VRAM and system / foreign device memory. Make the PT code able to handle that by checking, for each PTE set up, whether it points to local VRAM or to system memory. Signed-off-by: Thomas

[RFC PATCH 13/19] drm/gpusvm: Allow mixed mappings

2025-03-12 Thread Thomas Hellström
mapping of mixed ranges. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_gpusvm.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c index 8d836248f5fe..5d502ca091ee 100644 --- a/drivers/gpu/drm

[RFC PATCH 00/19] drm, drm/xe: Multi-device GPUSVM

2025-03-12 Thread Thomas Hellström
air. Patch 18: - (Only for POC) Add an GPU madvise prefer_devmem IOCTL. Patch 19: - (Only for POC) Implement pcie p2p DMA as a fast interconnect and test. Matthew Brost (1): drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap Thomas Hellström (18): drm/xe: Introduce CONFI

[RFC PATCH 11/19] drm/xe: Use the drm_pagemap_util helper to get a svm pagemap owner

2025-03-12 Thread Thomas Hellström
Register a driver-wide owner list, provide a callback to identify fast interconnects and use the drm_pagemap_util helper to allocate or reuse a suitable owner struct. For now we consider pagemaps on different tiles on the same device as having fast interconnect. Signed-off-by: Thomas Hellström

[RFC PATCH 04/19] drm/pagemap: Add a populate_mm op

2025-03-12 Thread Thomas Hellström
Add an operation to populate a part of a drm_mm with device private memory. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_gpusvm.c | 7 ++- drivers/gpu/drm/drm_pagemap.c | 32 include/drm/drm_pagemap.h | 32 3

[RFC PATCH 02/19] drm/xe/svm: Fix a potential bo UAF

2025-03-12 Thread Thomas Hellström
to protect the UAF. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_svm.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index c305d4c351d7..1a8e17a0005d 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b

[RFC PATCH 19/19] drm/xe: HAX: Use pcie p2p dma to test fast interconnect

2025-03-12 Thread Thomas Hellström
. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_svm.c | 50 ++--- drivers/gpu/drm/xe/xe_svm.h | 1 + 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index 56c2c731be27..0b562b411fa4

[RFC PATCH 18/19] drm/xe/uapi: HAX: Add the xe_madvise_prefer_devmem IOCTL

2025-03-12 Thread Thomas Hellström
-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_device.c | 2 + drivers/gpu/drm/xe/xe_svm.c| 72 ++ drivers/gpu/drm/xe/xe_svm.h| 9 + include/uapi/drm/xe_drm.h | 10 + 4 files changed, 93 insertions(+) diff --git a/drivers/gpu/drm/xe

[RFC PATCH 17/19] drm/xe/uapi: Add the devmem_open ioctl

2025-03-12 Thread Thomas Hellström
Add an IOCTL to get a file descriptor referencing a memory region for SVM. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_device.c | 1 + drivers/gpu/drm/xe/xe_svm.c| 50 ++ drivers/gpu/drm/xe/xe_svm.h| 8 ++ include/uapi/drm/xe_drm.h

[RFC PATCH 14/19] drm/xe: Add a preferred dpagemap

2025-03-12 Thread Thomas Hellström
Introduce a preferred dpagemap, that can override the default. The default is still the local tile vram dpagemap. The preferred pagemap is intended to be set from user-space. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_svm.c | 18 +- drivers/gpu/drm/xe

[RFC PATCH 16/19] drm/xe/migrate: Allow xe_migrate_vram() also on non-pagefault capable devices

2025-03-12 Thread Thomas Hellström
fault capable gpu. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_migrate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 3894efe7ba60..23c258b775a0 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c

[RFC PATCH 15/19] drm/pagemap/util: Add file descriptors pointing to struct drm_pagemap

2025-03-12 Thread Thomas Hellström
Falicitate implementing uapi representing a struct drm_pagemap as a file descriptor. A drm_pagemap file descriptor holds, while open, a reference to the struct drm_pagemap and to the drm_pagemap_helper module. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap_util.c | 78

[RFC PATCH 09/19] drm/pagemap_util: Add a utility to assign an owner to a set of interconnected gpus

2025-03-12 Thread Thomas Hellström
isit. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/drm_pagemap_util.c | 125 + include/drm/drm_pagemap_util.h | 55 + 3 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/dr

[RFC PATCH 10/19] drm/gpusvm, drm/xe: Move the device private owner to the drm_gpusvm_ctx

2025-03-12 Thread Thomas Hellström
It may not be known at drm_gpusvm_init time. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_gpusvm.c | 21 - drivers/gpu/drm/xe/xe_svm.c | 5 +++-- include/drm/drm_gpusvm.h | 7 --- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers

[RFC PATCH 08/19] drm/xe/bo: Add a bo remove callback

2025-03-12 Thread Thomas Hellström
such a way that bos that aren't exported are purged. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c| 113 ++-- drivers/gpu/drm/xe/xe_bo.c | 53 +++- drivers/gpu/drm/xe/xe_bo.h | 2 + drivers/gpu/drm/xe/xe_device.c | 5 + driver

[RFC PATCH 03/19] drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

2025-03-12 Thread Thomas Hellström
listed as author of this commit since he wrote most of the code, and it makes sense to retain his git authorship. Thomas mostly moved the code around. Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström --- Documentation/gpu/rfc/gpusvm.rst | 12 +- drivers/gpu/dr

[RFC PATCH 07/19] drm/pagemap: Get rid of the struct drm_pagemap_zdd::device_private_page_owner field

2025-03-12 Thread Thomas Hellström
Now that there is always a valid page pointer, we can deduce the owner from the page. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm

[RFC PATCH 05/19] drm/xe: Implement and use the drm_pagemap populate_mm op

2025-03-12 Thread Thomas Hellström
Add runtime PM since we might call populate_mm on a foreign device. Also create the VRAM bos as ttm_bo_type_kernel. This avoids the initial clearing and the creation of an mmap handle. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_pagemap.c | 4 +- drivers/gpu/drm/xe/xe_svm.c | 80

[RFC PATCH 01/19] drm/xe: Introduce CONFIG_DRM_XE_GPUSVM

2025-03-12 Thread Thomas Hellström
Don't rely on CONFIG_DRM_GPUSVM because other drivers may enable it causing us to compile in SVM support unintentionally. Also take the opportunity to leave more code out of compilation if !CONFIG_DRM_XE_GPUSVM and !CONFIG_DRM_XE_DEVMEM_MIRROR Signed-off-by: Thomas Hellström --- driver

Re: RESEND Re: [PATCH v16 2/7] drm/ttm/pool, drm/ttm/tt: Provide a helper to shrink pages

2025-03-11 Thread Thomas Hellström
hem: > > Acked-by: Dave Airlie > > > > Dave. > > > > On Tue, 25 Feb 2025 at 18:44, Thomas Hellström > > wrote: > > > Hi, Christian, > > > > > > Ping? I'd really want to get this in before -rc6 > > > > > > T

Re: RESEND Re: [PATCH v16 2/7] drm/ttm/pool, drm/ttm/tt: Provide a helper to shrink pages

2025-03-06 Thread Thomas Hellström
to drm-misc-next yesterday. /Thomas > > On Tue, 25 Feb 2025 at 18:44, Thomas Hellström > wrote: > > > > Hi, Christian, > > > > Ping? I'd really want to get this in before -rc6 > > > > Thanks, > > Thomas > > > > > >

Re: [PATCH v6 17/32] drm/xe: Do not allow CPU address mirror VMA unbind if the GPU has bindings

2025-02-27 Thread Thomas Hellström
doc (Thomas) >  - Newline between function defs (Thomas) > v5: >  - Kernel doc (Thomas) > v6: >  - Only compile if CONFIG_DRM_GPUSVM selected (CI, Lucas) > > Signed-off-by: Matthew Brost > Reviewed-by: Himal Prasad Ghimiray Reviewed-by: Thomas Hellström > --- >  dr

Re: [PATCH v6 14/32] drm/xe: Add (re)bind to SVM page fault handler

2025-02-26 Thread Thomas Hellström
_GPUVA_OP_DRIVER (Thomas) > v5: >  - Kernel doc (Thomas) > v6: >  - Only compile if CONFIG_DRM_GPUSVM selected (CI, Lucas) > > Signed-off-by: Thomas Hellström > Signed-off-by: Matthew Brost This LGTM but since I'm a co-author to some of the code, we'd need an ad

  1   2   3   4   5   6   7   8   9   10   >