Skip to contentSkip to conversation

drm/amdkfd: Add missing NULL check in svm_range_map_to_gpu

PATCH In review Philip Yang 6 participants 10 messages Apr 4, 2022 – Apr 5, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Add missing NULL check in svm_range_map_to_gpu

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device *pdd, struct svm_range *prange,
 					   last_start, prange->start + i,
 					   pte_flags,
 					   last_start - prange->start,
-					   bo_adev->vm_manager.vram_base_offset,
+					   bo_adev ? bo_adev->vm_manager.vram_base_offset : 0,
 					   NULL, dma_addr, &vm->last_update);
 
 		for (j = last_start - prange->start; j <= i; j++)
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 2022-04-04 um 17:42 schrieb Philip Yang:

Quoted 4 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)
Quoted 17 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device *pdd, struct svm_range *prange,
  					   last_start, prange->start + i,
  					   pte_flags,
  					   last_start - prange->start,
-					   bo_adev->vm_manager.vram_base_offset,
+					   bo_adev ? bo_adev->vm_manager.vram_base_offset : 0,
  					   NULL, dma_addr, &vm->last_update);
 
  		for (j = last_start - prange->start; j <= i; j++)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philip Yang

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 4 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)
Quoted 17 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device *pdd, struct svm_range *prange,
  					   last_start, prange->start + i,
  					   pte_flags,
  					   last_start - prange->start,
-					   bo_adev->vm_manager.vram_base_offset,
+					   bo_adev ? bo_adev->vm_manager.vram_base_offset : 0,
  					   NULL, dma_addr, &vm->last_update);
 
  		for (j = last_start - prange->start; j <= i; j++)
#3 lore raw
In reply to Philip Yang

Dear Philip,

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit? I do not see it in drm-next from agd5f git archive [email protected]:agd5f/linux.git.

    $ git log --oneline -1
    e45422695c19 (HEAD, agd5f/drm-next) drm/amdkfd: Create file 
descriptor after client is added to smi_clients list

Kind regards,

Paul

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device *pdd, struct svm_range *prange,
  					   last_start, prange->start + i,
  					   pte_flags,
  					   last_start - prange->start,
-					   bo_adev->vm_manager.vram_base_offset,
+					   bo_adev ? bo_adev->vm_manager.vram_base_offset : 0,
  					   NULL, dma_addr, &vm->last_update);
 
  		for (j = last_start - prange->start; j <= i; j++)
maintainer
#4 lore raw

Am 05.04.22 um 08:45 schrieb Paul Menzel:

Quoted 9 lines

Dear Philip,

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit?

Well that's expected, the development branch is not public.

Regards,
Christian.

Quoted 30 lines

I do not see it in drm-next from agd5f git archive [email protected]:agd5f/linux.git.

    $ git log --oneline -1
    e45422695c19 (HEAD, agd5f/drm-next) drm/amdkfd: Create file descriptor after client is added to smi_clients list

Kind regards,

Paul

Quoted 19 lines

---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device 
 *pdd, struct svm_range *prange,
                          last_start, prange->start + i,
                          pte_flags,
                          last_start - prange->start,
-                       bo_adev->vm_manager.vram_base_offset,
+                       bo_adev ? 
 bo_adev->vm_manager.vram_base_offset : 0,
                          NULL, dma_addr, &vm->last_update);

            for (j = last_start - prange->start; j <= i; j++)

#5 lore raw

Public patches but non-public development branch (Re: [PATCH 1/1] drm/amdkfd: Add missing NULL check in svm_range_map_to_gpu)

Dear Christian,

Am 05.04.22 um 08:54 schrieb Christian König:

Quoted 10 lines

Am 05.04.22 um 08:45 schrieb Paul Menzel:

Quoted 6 lines

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit?

Well that's expected, the development branch is not public.

Well obviously, it was unexpected for me. How should I have known? Where is that documented? If the patches are publicly posted to the mailing list, why is that development branch not public?

The current situation is really frustrating for non-AMD employees. How can the current situation be improved?

Kind regards,

Paul

Quoted 30 lines
Quoted 30 lines

I do not see it in drm-next from agd5f git archive [email protected]:agd5f/linux.git.

    $ git log --oneline -1
    e45422695c19 (HEAD, agd5f/drm-next) drm/amdkfd: Create file descriptor after client is added to smi_clients list

Kind regards,

Paul

Quoted 19 lines

---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device 
 *pdd, struct svm_range *prange,
                          last_start, prange->start + i,
                          pte_flags,
                          last_start - prange->start,
-                       bo_adev->vm_manager.vram_base_offset,
+                       bo_adev ? 
 bo_adev->vm_manager.vram_base_offset : 0,
                          NULL, dma_addr, &vm->last_update);

            for (j = last_start - prange->start; j <= i; j++)

#6 lore raw

Re: Public patches but non-public development branch (Re: [PATCH 1/1] drm/amdkfd: Add missing NULL check in svm_range_map_to_gpu)

Quoted 14 lines · Paul Menzel

Dear Christian,

Am 05.04.22 um 08:54 schrieb Christian König:

Quoted 9 lines

Am 05.04.22 um 08:45 schrieb Paul Menzel:

Quoted 6 lines

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit?

Quoted 8 lines
Quoted 1 line

Well that's expected, the development branch is not public.

Well obviously, it was unexpected for me. How should I have known? Where is that documented? If the patches are publicly posted to the mailing list, why is that development branch not public?

The current situation is really frustrating for non-AMD employees. How can the current situation be improved?

Our development branch
(https://gitlab.freedesktop.org/agd5f/linux/-/commits/amd-staging-drm-next)
is available publicly. There can be a day or so of lag depending on when it gets mirrored (e.g., over the weekend).

Alex

Quoted 40 lines

Kind regards,

Paul

Quoted 33 lines
Quoted 33 lines

I do not see it in drm-next from agd5f git archive [email protected]:agd5f/linux.git.

    $ git log --oneline -1
    e45422695c19 (HEAD, agd5f/drm-next) drm/amdkfd: Create file
descriptor after client is added to smi_clients list

Kind regards,

Paul

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -1
index 907b02045824..d3fb2d0b5a25 100644
@@ -1281,7 +1281,7 @@ svm_range_map_to_gpu(struct kfd_process_device
 *pdd, struct svm_range *prange,
                         last_start, prange->start + i,
                         pte_flags,
                         last_start - prange->start,
-                       bo_adev->vm_manager.vram_base_offset,
+                       bo_adev ?
 bo_adev->vm_manager.vram_base_offset : 0,
                         NULL, dma_addr, &vm->last_update);
            for (j = last_start - prange->start; j <= i; j++)
#7 lore raw

Re: Public patches but non-public development branch

Dear Alex,

Am 05.04.22 um 15:14 schrieb Alex Deucher:

Quoted 18 lines · Paul Menzel
Quoted 17 lines

Am 05.04.22 um 08:54 schrieb Christian König:

Quoted 10 lines

Am 05.04.22 um 08:45 schrieb Paul Menzel:

Quoted 6 lines

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit?

Well that's expected, the development branch is not public.

Well obviously, it was unexpected for me. How should I have known? Where is that documented? If the patches are publicly posted to the mailing list, why is that development branch not public?

Quoted 7 lines
Quoted 2 lines

The current situation is really frustrating for non-AMD employees. How can the current situation be improved?

Our development branch
(https://gitlab.freedesktop.org/agd5f/linux/-/commits/amd-staging-drm-next)
is available publicly. There can be a day or so of lag depending on when it gets mirrored (e.g., over the weekend).

Thank you for the clarification. As can be seen at hand, it still causes confusion though.

    commit 05fe8eeca927e29b81f3f2a799e9b9b88b0989a9
    Author:     Christian König <[email protected]>
    AuthorDate: Wed Mar 30 10:53:15 2022 +0200
    Commit:     Christian König <[email protected]>
    CommitDate: Fri Apr 1 11:05:51 2022 +0200

Today is Tuesday, so it wasn’t mirrored yesterday, on Monday.

To avoid this friction in the future, is there an automated way to mirror the branches? git hooks should allow that to be done on every push for example.

Kind regards,

Paul

#8 lore raw

Re: Public patches but non-public development branch

Quoted 40 lines · Paul Menzel

Dear Alex,

Am 05.04.22 um 15:14 schrieb Alex Deucher:

Quoted 18 lines · Paul Menzel
Quoted 17 lines

Am 05.04.22 um 08:54 schrieb Christian König:

Quoted 10 lines

Am 05.04.22 um 08:45 schrieb Paul Menzel:

Quoted 6 lines

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit?

Well that's expected, the development branch is not public.

Well obviously, it was unexpected for me. How should I have known? Where is that documented? If the patches are publicly posted to the mailing list, why is that development branch not public?

Quoted 7 lines
Quoted 2 lines

The current situation is really frustrating for non-AMD employees. How can the current situation be improved?

Our development branch
(https://gitlab.freedesktop.org/agd5f/linux/-/commits/amd-staging-drm-next)
is available publicly. There can be a day or so of lag depending on when it gets mirrored (e.g., over the weekend).

Thank you for the clarification. As can be seen at hand, it still causes confusion though.

     commit 05fe8eeca927e29b81f3f2a799e9b9b88b0989a9
     Author:     Christian König <[email protected]>
     AuthorDate: Wed Mar 30 10:53:15 2022 +0200
     Commit:     Christian König <[email protected]>
     CommitDate: Fri Apr 1 11:05:51 2022 +0200
Quoted 5 lines

Today is Tuesday, so it wasn’t mirrored yesterday, on Monday.

To avoid this friction in the future, is there an automated way to mirror the branches? git hooks should allow that to be done on every push for example.

It's a bit more complicated than that since we have various CI systems and IT security policies involved, but we can look into it.

Alex

#9 lore raw

Re: Public patches but non-public development branch

Dear Alex,

Am 05.04.22 um 16:13 schrieb Alex Deucher:

Quoted 38 lines · Paul Menzel
Quoted 37 lines

Am 05.04.22 um 15:14 schrieb Alex Deucher:

Quoted 18 lines · Paul Menzel
Quoted 17 lines

Am 05.04.22 um 08:54 schrieb Christian König:

Quoted 10 lines

Am 05.04.22 um 08:45 schrieb Paul Menzel:

Quoted 6 lines

Am 04.04.22 um 23:42 schrieb Philip Yang:

Quoted 3 lines

bo_adev is NULL for system memory mapping to GPU.

Fixes 05fe8eeca92 (drm/amdgpu: fix TLB flushing during eviction)

Sorry, where can I find that commit?

Well that's expected, the development branch is not public.

Well obviously, it was unexpected for me. How should I have known? Where is that documented? If the patches are publicly posted to the mailing list, why is that development branch not public?

Quoted 7 lines
Quoted 2 lines

The current situation is really frustrating for non-AMD employees. How can the current situation be improved?

Our development branch
(https://gitlab.freedesktop.org/agd5f/linux/-/commits/amd-staging-drm-next)
is available publicly. There can be a day or so of lag depending on when it gets mirrored (e.g., over the weekend).

Thank you for the clarification. As can be seen at hand, it still causes confusion though.

      commit 05fe8eeca927e29b81f3f2a799e9b9b88b0989a9
      Author:     Christian König <[email protected]>
      AuthorDate: Wed Mar 30 10:53:15 2022 +0200
      Commit:     Christian König <[email protected]>
      CommitDate: Fri Apr 1 11:05:51 2022 +0200
Quoted 8 lines
Quoted 5 lines

Today is Tuesday, so it wasn’t mirrored yesterday, on Monday.

To avoid this friction in the future, is there an automated way to mirror the branches? git hooks should allow that to be done on every push for example.

It's a bit more complicated than that since we have various CI systems and IT security policies involved, but we can look into it.

That’d be awesome. Thank you!

Kind regards,

Paul