aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3320-drm-amdgpu-Mark-KFD-VRAM-allocations-for-wipe-on-rel.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3320-drm-amdgpu-Mark-KFD-VRAM-allocations-for-wipe-on-rel.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3320-drm-amdgpu-Mark-KFD-VRAM-allocations-for-wipe-on-rel.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3320-drm-amdgpu-Mark-KFD-VRAM-allocations-for-wipe-on-rel.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3320-drm-amdgpu-Mark-KFD-VRAM-allocations-for-wipe-on-rel.patch
new file mode 100644
index 00000000..96961069
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3320-drm-amdgpu-Mark-KFD-VRAM-allocations-for-wipe-on-rel.patch
@@ -0,0 +1,41 @@
+From 0954dece4cd9593544905479c8ec25f68c4c485e Mon Sep 17 00:00:00 2001
+From: Felix Kuehling <Felix.Kuehling@amd.com>
+Date: Mon, 8 Jul 2019 20:01:22 -0400
+Subject: [PATCH 3320/4256] drm/amdgpu: Mark KFD VRAM allocations for wipe on
+ release
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Memory used by KFD applications can contain sensitive information that
+should not be leaked to other processes. The current approach to prevent
+leaks is to clear VRAM at allocation time. This is not effective because
+memory can be reused in other ways without being cleared. Synchronously
+clearing memory on the allocation path also carries a significant
+performance penalty.
+
+Stop clearing memory at allocation time. Instead mark the memory for
+wipe on release.
+
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+index d144d04d7b0e..580f52eda694 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+@@ -1149,7 +1149,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
+ */
+ if (flags & ALLOC_MEM_FLAGS_VRAM) {
+ domain = alloc_domain = AMDGPU_GEM_DOMAIN_VRAM;
+- alloc_flags = AMDGPU_GEM_CREATE_VRAM_CLEARED;
++ alloc_flags = AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE;
+ alloc_flags |= (flags & ALLOC_MEM_FLAGS_PUBLIC) ?
+ AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED :
+ AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
+--
+2.17.1
+