diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3702-drm-amdgpu-Disable-page-faults-while-reading-user-wp.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3702-drm-amdgpu-Disable-page-faults-while-reading-user-wp.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3702-drm-amdgpu-Disable-page-faults-while-reading-user-wp.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3702-drm-amdgpu-Disable-page-faults-while-reading-user-wp.patch new file mode 100644 index 00000000..ccd2aabc --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3702-drm-amdgpu-Disable-page-faults-while-reading-user-wp.patch @@ -0,0 +1,50 @@ +From 34d07e97a265ad0617f503129c3a0ac705a80018 Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Fri, 30 Aug 2019 00:10:34 -0400 +Subject: [PATCH 3702/4256] drm/amdgpu: Disable page faults while reading user + wptrs + +These wptrs must be pinned and GPU accessible when this is called +from hqd_load functions. So they should never fault. This resolves +a circular lock dependency issue involving four locks including the +DQM lock and mmap_sem. + +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +Reviewed-by: Oak Zeng <Oak.Zeng@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +index 2e66505744ef..938952563a62 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +@@ -184,10 +184,17 @@ uint64_t amdgpu_amdkfd_get_mmio_remap_phys_addr(struct kgd_dev *kgd); + uint32_t amdgpu_amdkfd_get_num_gws(struct kgd_dev *kgd); + uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *src); + ++/* Read user wptr from a specified user address space with page fault ++ * disabled. The memory must be pinned and mapped to the hardware when ++ * this is called in hqd_load functions, so it should never fault in ++ * the first place. This resolves a circular lock dependency involving ++ * four locks, including the DQM lock and mmap_sem. ++ */ + #define read_user_wptr(mmptr, wptr, dst) \ + ({ \ + bool valid = false; \ + if ((mmptr) && (wptr)) { \ ++ pagefault_disable(); \ + if ((mmptr) == current->mm) { \ + valid = !get_user((dst), (wptr)); \ + } else if (current->mm == NULL) { \ +@@ -195,6 +202,7 @@ uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *s + valid = !get_user((dst), (wptr)); \ + unuse_mm(mmptr); \ + } \ ++ pagefault_enable(); \ + } \ + valid; \ + }) +-- +2.17.1 + |