From: Sasha Levin Date: Mon, 24 Jan 2022 22:49:36 +0000 (-0500) Subject: Drop drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch X-Git-Tag: v4.4.300~13^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b269b8e6445855d6d018eff97a47b3ce4cb34b9;p=thirdparty%2Fkernel%2Fstable-queue.git Drop drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch b/queue-5.15/drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch deleted file mode 100644 index 34edb454494..00000000000 --- a/queue-5.15/drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 66a84f68a911b9865e0158ffe332a998aa377b73 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 26 Nov 2021 15:15:04 -0500 -Subject: drm/amdgpu: Don't inherit GEM object VMAs in child process -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Rajneesh Bhardwaj - -[ Upstream commit fbcdbfde87509d523132b59f661a355c731139d0 ] - -When an application having open file access to a node forks, its shared -mappings also get reflected in the address space of child process even -though it cannot access them with the object permissions applied. With the -existing permission checks on the gem objects, it might be reasonable to -also create the VMAs with VM_DONTCOPY flag so a user space application -doesn't need to explicitly call the madvise(addr, len, MADV_DONTFORK) -system call to prevent the pages in the mapped range to appear in the -address space of the child process. It also prevents the memory leaks -due to additional reference counts on the mapped BOs in the child -process that prevented freeing the memory in the parent for which we had -worked around earlier in the user space inside the thunk library. - -Additionally, we faced this issue when using CRIU to checkpoint restore -an application that had such inherited mappings in the child which -confuse CRIU when it mmaps on restore. Having this flag set for the -render node VMAs helps. VMAs mapped via KFD already take care of this so -this is needed only for the render nodes. - -To limit the impact of the change to user space consumers such as OpenGL -etc, limit it to KFD BOs only. - -Acked-by: Felix Kuehling -Reviewed-by: Christian König -Signed-off-by: David Yat Sin -Signed-off-by: Rajneesh Bhardwaj -Signed-off-by: Alex Deucher -Signed-off-by: Sasha Levin ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c -index a1e63ba4c54a5..630dc99e49086 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c -@@ -264,6 +264,9 @@ static int amdgpu_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_str - !(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC))) - vma->vm_flags &= ~VM_MAYWRITE; - -+ if (bo->kfd_bo) -+ vma->vm_flags |= VM_DONTCOPY; -+ - return drm_gem_ttm_mmap(obj, vma); - } - --- -2.34.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 9c310516144..726653baae2 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -592,7 +592,6 @@ acpica-executer-fix-the-refclass_refof-case-in-acpi_.patch acpica-fix-wrong-interpretation-of-pcc-address.patch acpica-hardware-do-not-flush-cpu-cache-when-entering.patch mmc-mtk-sd-use-readl_poll_timeout-instead-of-open-co.patch -drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch drm-amdgpu-fixup-bad-vram-size-on-gmc-v8.patch amdgpu-pm-make-sysfs-pm-attributes-as-read-only-for-.patch acpi-battery-add-the-thinkpad-not-charging-quirk.patch diff --git a/queue-5.16/drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch b/queue-5.16/drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch deleted file mode 100644 index b8501045d83..00000000000 --- a/queue-5.16/drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch +++ /dev/null @@ -1,60 +0,0 @@ -From e022b5582796dff89fcb542f0507dd93307d494c Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 26 Nov 2021 15:15:04 -0500 -Subject: drm/amdgpu: Don't inherit GEM object VMAs in child process -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Rajneesh Bhardwaj - -[ Upstream commit fbcdbfde87509d523132b59f661a355c731139d0 ] - -When an application having open file access to a node forks, its shared -mappings also get reflected in the address space of child process even -though it cannot access them with the object permissions applied. With the -existing permission checks on the gem objects, it might be reasonable to -also create the VMAs with VM_DONTCOPY flag so a user space application -doesn't need to explicitly call the madvise(addr, len, MADV_DONTFORK) -system call to prevent the pages in the mapped range to appear in the -address space of the child process. It also prevents the memory leaks -due to additional reference counts on the mapped BOs in the child -process that prevented freeing the memory in the parent for which we had -worked around earlier in the user space inside the thunk library. - -Additionally, we faced this issue when using CRIU to checkpoint restore -an application that had such inherited mappings in the child which -confuse CRIU when it mmaps on restore. Having this flag set for the -render node VMAs helps. VMAs mapped via KFD already take care of this so -this is needed only for the render nodes. - -To limit the impact of the change to user space consumers such as OpenGL -etc, limit it to KFD BOs only. - -Acked-by: Felix Kuehling -Reviewed-by: Christian König -Signed-off-by: David Yat Sin -Signed-off-by: Rajneesh Bhardwaj -Signed-off-by: Alex Deucher -Signed-off-by: Sasha Levin ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c -index a1e63ba4c54a5..630dc99e49086 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c -@@ -264,6 +264,9 @@ static int amdgpu_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_str - !(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC))) - vma->vm_flags &= ~VM_MAYWRITE; - -+ if (bo->kfd_bo) -+ vma->vm_flags |= VM_DONTCOPY; -+ - return drm_gem_ttm_mmap(obj, vma); - } - --- -2.34.1 - diff --git a/queue-5.16/series b/queue-5.16/series index bde10b82378..359a00e7b2a 100644 --- a/queue-5.16/series +++ b/queue-5.16/series @@ -699,7 +699,6 @@ acpica-executer-fix-the-refclass_refof-case-in-acpi_.patch acpica-fix-wrong-interpretation-of-pcc-address.patch acpica-hardware-do-not-flush-cpu-cache-when-entering.patch mmc-mtk-sd-use-readl_poll_timeout-instead-of-open-co.patch -drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-pr.patch drm-amdgpu-fixup-bad-vram-size-on-gmc-v8.patch mfd-intel_soc_pmic-use-cpu-id-check-instead-of-_hrv-.patch amdgpu-pm-make-sysfs-pm-attributes-as-read-only-for-.patch