Skip to contentSkip to conversation

drm/ttm: Support 52-bit PAs in ttm_place

PATCH Superseded Felix Kuehling 2 participants 4 messages May 12 – May 13

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: Support 52-bit PAs in ttm_place

fpfn and lpfn in struct ttm_place are 32-bit page numbers. With 4KB page size this can support up to 44-bit physical addressing. Grow these to unsigned long to support larger physical addresses.

---
 include/drm/ttm/ttm_placement.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_placement.h +2 -2
index b510a4812609..3e88869c0f58 100644
@@ -81,8 +81,8 @@
  * Structure indicating a possible place to put an object.
  */
 struct ttm_place {
-	unsigned	fpfn;
-	unsigned	lpfn;
+	unsigned long	fpfn;
+	unsigned long	lpfn;
 	uint32_t	mem_type;
 	uint32_t	flags;
 };
Signature · 1 line
2.43.0
#1 lore raw
Quoted 14 lines · Felix Kuehling

fpfn and lpfn in struct ttm_place are 32-bit page numbers. With 4KB page size this can support up to 44-bit physical addressing. Grow these to unsigned long to support larger physical addresses.

---
 include/drm/ttm/ttm_placement.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_placement.h +0 -0
index b510a4812609..3e88869c0f58 100644

include/drm/ttm/ttm_placement.h line 85

Quoted 7 lines
include/drm/ttm/ttm_placement.h +2 -2
@@ -81,8 +81,8 @@
  * Structure indicating a possible place to put an object.
  */
 struct ttm_place {
-	unsigned	fpfn;
-	unsigned	lpfn;
+	unsigned long	fpfn;
+	unsigned long	lpfn;

That should be uint64_t instead, long is CPU architecture dependent and we clearly don't want that in TTM.

But apart from that looks reasonable to me.

Regards,
Christian.

Quoted 3 lines
include/drm/ttm/ttm_placement.h +0 -0
 	uint32_t	mem_type;
 	uint32_t	flags;
 };
#2 lore raw
Quoted 25 lines · Christian König
Quoted 14 lines · Felix Kuehling

fpfn and lpfn in struct ttm_place are 32-bit page numbers. With 4KB page size this can support up to 44-bit physical addressing. Grow these to unsigned long to support larger physical addresses.

---
  include/drm/ttm/ttm_placement.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_placement.h +0 -0
index b510a4812609..3e88869c0f58 100644

include/drm/ttm/ttm_placement.h line 85

Quoted 7 lines
include/drm/ttm/ttm_placement.h +2 -2
@@ -81,8 +81,8 @@
   * Structure indicating a possible place to put an object.
   */
  struct ttm_place {
-	unsigned	fpfn;
-	unsigned	lpfn;
+	unsigned long	fpfn;
+	unsigned long	lpfn;

That should be uint64_t instead, long is CPU architecture dependent and we clearly don't want that in TTM.

Quoted 1 line

But apart from that looks reasonable to me.

Thanks. I sent out v2. What's the best branch for getting this change upstream? We'll need it on our NPI branch in the interim.

Regards,
  Felix

Quoted 7 lines

Regards,
Christian.

Quoted 3 lines
include/drm/ttm/ttm_placement.h +0 -0
  	uint32_t	mem_type;
  	uint32_t	flags;
  };
#3 lore raw
Quoted 26 lines · Felix
Quoted 25 lines · Christian König
Quoted 14 lines · Felix Kuehling

fpfn and lpfn in struct ttm_place are 32-bit page numbers. With 4KB page size this can support up to 44-bit physical addressing. Grow these to unsigned long to support larger physical addresses.

---
  include/drm/ttm/ttm_placement.h | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_placement.h +0 -0
index b510a4812609..3e88869c0f58 100644

include/drm/ttm/ttm_placement.h line 85

Quoted 7 lines
include/drm/ttm/ttm_placement.h +2 -2
@@ -81,8 +81,8 @@
    * Structure indicating a possible place to put an object.
    */
   struct ttm_place {
-    unsigned    fpfn;
-    unsigned    lpfn;
+    unsigned long    fpfn;
+    unsigned long    lpfn;

That should be uint64_t instead, long is CPU architecture dependent and we clearly don't want that in TTM.

Quoted 3 lines
Quoted 1 line

But apart from that looks reasonable to me.

Thanks. I sent out v2. What's the best branch for getting this change upstream? We'll need it on our NPI branch in the interim.

Arun will push it to drm-misc-next, if you also need it in amd-staging-drm-next you need to sync up with Alex. But that shouldn't be much of a problem.

Regards,
Christian

Quoted 12 lines

Regards,
  Felix

Quoted 7 lines

Regards,
Christian.

Quoted 3 lines
include/drm/ttm/ttm_placement.h +0 -0
       uint32_t    mem_type;
       uint32_t    flags;
   };