drm/ttm: Support 52-bit PAs in ttm_place
Subsystems (2)
PATCH v2 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
@@ -81,8 +81,8 @@* Structure indicating a possible place to put an object. */ struct ttm_place { -unsigned fpfn; -unsigned lpfn; +uint64_t fpfn; +uint64_t lpfn;uint32_t mem_type;uint32_t flags; };
Signature · 1 line
2.43.0
Quoted 5 lines · Felix Kuehling
fpfn and lpfn in struct
ttm_placeare 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.Signed-off-by Felix Kuehling <[email protected]>
@Arun can you pick that one up and push it to drm-misc-next?
Thanks,
Christian.
Quoted 19 lines
--- include/drm/ttm/ttm_placement.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)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; +uint64_t fpfn; +uint64_t lpfn;uint32_t mem_type;uint32_t flags; };
Quoted 4 lines · Christian König
Quoted 3 lines · Felix Kuehling
fpfn and lpfn in struct
ttm_placeare 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.
I forgot to update the commit message. It still says unsigned long. @Arun, can you update that before you push it to drm-misc-next?
Thanks,
Felix
Quoted 28 lines
Quoted 2 lines
Signed-off-by Felix Kuehling <[email protected]>Reviewed-by Christian König <[email protected]>@Arun can you pick that one up and push it to drm-misc-next?
Thanks,
Christian.Quoted 19 lines
--- include/drm/ttm/ttm_placement.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)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; +uint64_t fpfn; +uint64_t lpfn;uint32_t mem_type;uint32_t flags; };
Arunpravin Paneer Selvam
maintainerI modified the commit message and pushed into drm-misc-next.
Regards,
Arun.
Quoted 41 lines · Felix
Quoted 4 lines · Christian König
Quoted 3 lines · Felix Kuehling
fpfn and lpfn in struct
ttm_placeare 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.I forgot to update the commit message. It still says unsigned long. @Arun, can you update that before you push it to drm-misc-next?
Thanks,
FelixQuoted 28 lines
Quoted 2 lines
Signed-off-by Felix Kuehling <[email protected]>Reviewed-by Christian König <[email protected]>@Arun can you pick that one up and push it to drm-misc-next?
Thanks,
Christian.Quoted 19 lines
---
include/drm/ttm/ttm_placement.h| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)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; + uint64_t fpfn; + uint64_t lpfn; uint32_t mem_type; uint32_t flags; };
Quoted 14 lines · Felix Kuehling
fpfn and lpfn in struct
ttm_placeare 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.Signed-off-by Felix Kuehling <[email protected]>--- include/drm/ttm/ttm_placement.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/drm/ttm/ttm_placement.h +0
-0
include/drm/ttm/ttm_placement.h line 88
Quoted 10 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; +uint64_t fpfn; +uint64_t lpfn;uint32_t mem_type;uint32_t flags; };
Maybe audit of usage sites is required to make sure no compiler warnings on 32-bit builds if nothing else. Things like:
amdgpu_vram_mgr_intersects()
...
if (place->fpfn < lpfn && (!place->lpfn || place->lpfn > fpfn)) return true;
Etc. Probably are all best adjusted to match the new type.
There is also:
struct ttm_resource {
unsigned long start;Which also may need aligning. I know no one cares about 32-bit builds but some automated systems will probably test it and send reports.
Regards,
Tvrtko
Quoted 34 lines · Tvrtko Ursulin
Quoted 14 lines · Felix Kuehling
fpfn and lpfn in struct
ttm_placeare 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.Signed-off-by Felix Kuehling <[email protected]>---
include/drm/ttm/ttm_placement.h| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)include/drm/ttm/ttm_placement.h +0
-0include/drm/ttm/ttm_placement.h line 88
Quoted 10 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; + uint64_t fpfn; + uint64_t lpfn; uint32_t mem_type; uint32_t flags; };Maybe audit of usage sites is required to make sure no compiler warnings on 32-bit builds if nothing else. Things like:
amdgpu_vram_mgr_intersects()
...
if (place->fpfn< lpfn &&
(!place->lpfn ||place->lpfn> fpfn))
return true;
Quoted 8 lines
Etc. Probably are all best adjusted to match the new type.
There is also:
struct
ttm_resource{
unsigned long start;Which also may need aligning. I know no one cares about 32-bit builds but some automated systems will probably test it and send reports.
Yeah I have been trying to remove ttm_resource.start exactly for that reason for a very very long time now.
Drivers shouldn't use that and instead rely on their own backends to give the actual placement.
Regards,
Christian.
Quoted 5 lines
Regards,
Tvrtko