drm/amdkfd: handle CPU fault on COW mapping
authorPhilip Yang <Philip.Yang@amd.com>
Wed, 7 Sep 2022 16:30:12 +0000 (12:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:58:13 +0000 (09:58 +0100)
commitb1f852277171ad87a37bf42835839c306b7f05dd
treeed0ae8d7a3419cd9d22bd7c4cf8200c1ae788fac
parent36770c045aba4b6db370c57162f94af5496ae131
drm/amdkfd: handle CPU fault on COW mapping

[ Upstream commit e1f84eef313f4820cca068a238c645d0a38c6a9b ]

If CPU page fault in a page with zone_device_data svm_bo from another
process, that means it is COW mapping in the child process and the
range is migrated to VRAM by parent process. Migrate the parent
process range back to system memory to recover the CPU page fault.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 5b994354af3c ("drm/amdkfd: Fix NULL pointer dereference in svm_migrate_to_ram()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c