* [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place
@ 2026-05-13 14:12 Felix Kuehling
2026-05-13 14:19 ` Christian König
2026-05-13 14:50 ` Tvrtko Ursulin
0 siblings, 2 replies; 6+ messages in thread
From: Felix Kuehling @ 2026-05-13 14:12 UTC (permalink / raw)
To: amd-gfx, dri-devel; +Cc: christian.koenig
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.
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
---
include/drm/ttm/ttm_placement.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index b510a4812609..ab2639e42c54 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -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;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place
2026-05-13 14:12 [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place Felix Kuehling
@ 2026-05-13 14:19 ` Christian König
2026-05-13 14:27 ` Kuehling, Felix
2026-05-13 14:50 ` Tvrtko Ursulin
1 sibling, 1 reply; 6+ messages in thread
From: Christian König @ 2026-05-13 14:19 UTC (permalink / raw)
To: Felix Kuehling, amd-gfx, dri-devel, Paneer Selvam, Arunpravin
On 5/13/26 16:12, Felix Kuehling wrote:
> 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.
>
> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
@Arun can you pick that one up and push it to drm-misc-next?
Thanks,
Christian.
> ---
> include/drm/ttm/ttm_placement.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
> index b510a4812609..ab2639e42c54 100644
> --- a/include/drm/ttm/ttm_placement.h
> +++ b/include/drm/ttm/ttm_placement.h
> @@ -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;
> };
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place
2026-05-13 14:19 ` Christian König
@ 2026-05-13 14:27 ` Kuehling, Felix
2026-05-13 14:50 ` Arunpravin Paneer Selvam
0 siblings, 1 reply; 6+ messages in thread
From: Kuehling, Felix @ 2026-05-13 14:27 UTC (permalink / raw)
To: Christian König, amd-gfx, dri-devel,
Paneer Selvam, Arunpravin
On 2026-05-13 09:19, Christian König wrote:
> On 5/13/26 16:12, Felix Kuehling wrote:
>> 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.
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
>>
>> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> @Arun can you pick that one up and push it to drm-misc-next?
>
> Thanks,
> Christian.
>
>> ---
>> include/drm/ttm/ttm_placement.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
>> index b510a4812609..ab2639e42c54 100644
>> --- a/include/drm/ttm/ttm_placement.h
>> +++ b/include/drm/ttm/ttm_placement.h
>> @@ -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;
>> };
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place
2026-05-13 14:12 [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place Felix Kuehling
2026-05-13 14:19 ` Christian König
@ 2026-05-13 14:50 ` Tvrtko Ursulin
2026-05-13 15:32 ` Christian König
1 sibling, 1 reply; 6+ messages in thread
From: Tvrtko Ursulin @ 2026-05-13 14:50 UTC (permalink / raw)
To: Felix Kuehling, amd-gfx, dri-devel; +Cc: christian.koenig
On 13/05/2026 15:12, Felix Kuehling wrote:
> 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.
>
> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
> ---
> include/drm/ttm/ttm_placement.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
> index b510a4812609..ab2639e42c54 100644
> --- a/include/drm/ttm/ttm_placement.h
> +++ b/include/drm/ttm/ttm_placement.h
> @@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place
2026-05-13 14:27 ` Kuehling, Felix
@ 2026-05-13 14:50 ` Arunpravin Paneer Selvam
0 siblings, 0 replies; 6+ messages in thread
From: Arunpravin Paneer Selvam @ 2026-05-13 14:50 UTC (permalink / raw)
To: Kuehling, Felix, Christian König, amd-gfx, dri-devel
I modified the commit message and pushed into drm-misc-next.
Regards,
Arun.
On 5/13/2026 7:57 PM, Kuehling, Felix wrote:
> On 2026-05-13 09:19, Christian König wrote:
>> On 5/13/26 16:12, Felix Kuehling wrote:
>>> 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.
>
> 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
>
>
>>>
>>> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>> @Arun can you pick that one up and push it to drm-misc-next?
>>
>> Thanks,
>> Christian.
>>
>>> ---
>>> include/drm/ttm/ttm_placement.h | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/drm/ttm/ttm_placement.h
>>> b/include/drm/ttm/ttm_placement.h
>>> index b510a4812609..ab2639e42c54 100644
>>> --- a/include/drm/ttm/ttm_placement.h
>>> +++ b/include/drm/ttm/ttm_placement.h
>>> @@ -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;
>>> };
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place
2026-05-13 14:50 ` Tvrtko Ursulin
@ 2026-05-13 15:32 ` Christian König
0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2026-05-13 15:32 UTC (permalink / raw)
To: Tvrtko Ursulin, Felix Kuehling, amd-gfx, dri-devel
On 5/13/26 16:50, Tvrtko Ursulin wrote:
> On 13/05/2026 15:12, Felix Kuehling wrote:
>> 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.
>>
>> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
>> ---
>> include/drm/ttm/ttm_placement.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
>> index b510a4812609..ab2639e42c54 100644
>> --- a/include/drm/ttm/ttm_placement.h
>> +++ b/include/drm/ttm/ttm_placement.h
>> @@ -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.
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.
>
> Regards,
>
> Tvrtko
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-13 15:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 14:12 [PATCH v2] drm/ttm: Support 52-bit PAs in ttm_place Felix Kuehling
2026-05-13 14:19 ` Christian König
2026-05-13 14:27 ` Kuehling, Felix
2026-05-13 14:50 ` Arunpravin Paneer Selvam
2026-05-13 14:50 ` Tvrtko Ursulin
2026-05-13 15:32 ` Christian König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.