[PATCH] drm/amdkfd: Correct partial migration virtual addr

Chen, Xiaogang xiaogang.chen at amd.com
Tue Jan 16 00:02:46 UTC 2024


This patch is:

Reviewed-by Xiaogang Chen <Xiaogang.Chen at amd.com>

On 1/15/2024 4:00 PM, Philip Yang wrote:
> Partial migration to system memory should use migrate.addr, not
> prange->start as virtual address to allocate system memory page.
>
> Fixes: 18eb61bd5a6a ("drm/amdkfd: Use partial migrations/mapping for GPU/CPU page faults in SVM"
> Signed-off-by: Philip Yang <Philip.Yang at amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> index f856901055d3..bdc01ca9609a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> @@ -574,7 +574,7 @@ svm_migrate_copy_to_ram(struct amdgpu_device *adev, struct svm_range *prange,
>   	pr_debug("svms 0x%p [0x%lx 0x%lx]\n", prange->svms, prange->start,
>   		 prange->last);
>   
> -	addr = prange->start << PAGE_SHIFT;
> +	addr = migrate->start;
>   
>   	src = (uint64_t *)(scratch + npages);
>   	dst = scratch;


More information about the amd-gfx mailing list