[PATCH v3 2/4] drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-28 Thread Kefeng Wang
Use the helpers to simplify code. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Reviewed-by: David Hildenbrand Reviewed-by: Felix Kuehling Signed-off-by: Kefeng Wang --- drivers/gpu/drm/amd/amdkfd/kf

[PATCH v3 4/4] perf/core: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-28 Thread Kefeng Wang
Use the helpers to simplify code, also kill unneeded goto cpy_name. Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Reviewed-by: David Hildenbrand Signed-off-by: Kefeng Wang --- kernel/events/core.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions

[PATCH v3 1/4] mm: factor out VMA stack and heap checks

2023-07-28 Thread Kefeng Wang
Factor out VMA stack and heap checks and name them vma_is_initial_stack() and vma_is_initial_heap() for general use. Cc: Christian Göttsche Cc: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Kefeng Wang --- fs/proc/task_mmu.c | 24 fs/proc

[PATCH v3 0/4] mm: convert to vma_is_initial_heap/stack()

2023-07-28 Thread Kefeng Wang
Add vma_is_initial_stack() and vma_is_initial_heap() helper and use them to simplify code. v2: - add comment for heap helper and remove one more goto cpy_name, per David Hildenbrand - add RB v2: - address comments per David Hildenbrand and Christian Göttsche - fix selinux build Kefeng Wang (4

[PATCH v3 3/4] selinux: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-28 Thread Kefeng Wang
Use the helpers to simplify code. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Acked-by: Paul Moore Reviewed-by: David Hildenbrand Signed-off-by: Kefeng Wang --- security/selinux/hooks.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/security/selinux

Re: [PATCH v2 3/4] selinux: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-20 Thread Kefeng Wang
On 2023/7/19 23:25, Paul Moore wrote: On Wed, Jul 19, 2023 at 6:23 AM Kefeng Wang wrote: On 2023/7/19 17:02, Christian Göttsche wrote: On Wed, 19 Jul 2023 at 09:40, Kefeng Wang wrote: Use the helpers to simplify code. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Acked-by: Paul

[PATCH v2 2/4] drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Kefeng Wang
Use the helpers to simplify code. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Kefeng Wang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 + 1 file changed, 1 insertion(+), 4 dele

Re: [PATCH v2 4/4] perf/core: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Kefeng Wang
On 2023/7/19 17:29, Peter Zijlstra wrote: On Wed, Jul 19, 2023 at 03:51:14PM +0800, Kefeng Wang wrote: Use the helpers to simplify code, also kill unneeded goto cpy_name. Grrr.. why am I only getting 4/4 ? I'm going to write a bot that auto NAKs all partial series :/ Sorry, I should add

Re: [PATCH v2 3/4] selinux: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Kefeng Wang
On 2023/7/19 17:02, Christian Göttsche wrote: On Wed, 19 Jul 2023 at 09:40, Kefeng Wang wrote: Use the helpers to simplify code. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Acked-by: Paul Moore Signed-off-by: Kefeng Wang --- security/selinux/hooks.c | 7 ++- 1 file

[PATCH v2 0/4] mm: convert to vma_is_initial_heap/stack()

2023-07-19 Thread Kefeng Wang
Add vma_is_initial_stack() and vma_is_initial_heap() helper and use them to simplify code. v2: - address comments per David Hildenbrand and Christian Göttsche - fix selinux build Kefeng Wang (4): mm: factor out VMA stack and heap checks drm/amdkfd: use vma_is_initial_stack

[PATCH v2 1/4] mm: factor out VMA stack and heap checks

2023-07-19 Thread Kefeng Wang
Factor out VMA stack and heap checks and name them vma_is_initial_stack() and vma_is_initial_heap() for general use. Cc: Christian G??ttsche Cc: David Hildenbrand Signed-off-by: Kefeng Wang --- fs/proc/task_mmu.c | 24 fs/proc/task_nommu.c | 15

[PATCH v2 4/4] perf/core: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Kefeng Wang
Use the helpers to simplify code, also kill unneeded goto cpy_name. Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Signed-off-by: Kefeng Wang --- kernel/events/core.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/kernel/events/core.c b/kernel

[PATCH v2 3/4] selinux: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Kefeng Wang
Use the helpers to simplify code. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Acked-by: Paul Moore Signed-off-by: Kefeng Wang --- security/selinux/hooks.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c

Re: [PATCH 2/5] mm: use vma_is_stack() and vma_is_heap()

2023-07-18 Thread Kefeng Wang
On 2023/7/17 18:25, David Hildenbrand wrote: On 12.07.23 16:38, Kefeng Wang wrote: Use the helpers to simplify code. Signed-off-by: Kefeng Wang ---   fs/proc/task_mmu.c   | 24   fs/proc/task_nommu.c | 15 +--   2 files changed, 5 insertions(+), 34

[PATCH 4/5] selinux: use vma_is_stack() and vma_is_heap()

2023-07-12 Thread Kefeng Wang
Use the helpers to simplify code. Signed-off-by: Kefeng Wang --- security/selinux/hooks.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4e46cf3d67b6..289ef2d6a427 100644 --- a/security/selinux/hooks.c +++ b

[PATCH 0/5] mm: convert to vma_is_heap/stack()

2023-07-12 Thread Kefeng Wang
Add vma_is_stack() and vma_is_heap() helper and use them to simplify code. Kefeng Wang (5): mm: introduce vma_is_stack() and vma_is_heap() mm: use vma_is_stack() and vma_is_heap() drm/amdkfd: use vma_is_stack() and vma_is_heap() selinux: use vma_is_stack() and vma_is_heap() perf/core

[PATCH 2/5] mm: use vma_is_stack() and vma_is_heap()

2023-07-12 Thread Kefeng Wang
Use the helpers to simplify code. Signed-off-by: Kefeng Wang --- fs/proc/task_mmu.c | 24 fs/proc/task_nommu.c | 15 +-- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index cfab855fe7e9

[PATCH 5/5] perf/core: use vma_is_stack() and vma_is_heap()

2023-07-12 Thread Kefeng Wang
Use the helpers to simplify code, also kill unneeded goto cpy_name. Signed-off-by: Kefeng Wang --- kernel/events/core.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 78ae7b6f90fd..cb271f449b81 100644

[PATCH 1/5] mm: introduce vma_is_stack() and vma_is_heap()

2023-07-12 Thread Kefeng Wang
Introduce the two helpers for general use. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 1462cf15badf..0bbeb31ac750 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h

[PATCH 3/5] drm/amdkfd: use vma_is_stack() and vma_is_heap()

2023-07-12 Thread Kefeng Wang
Use the helpers to simplify code. Signed-off-by: Kefeng Wang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c index 479c4f66afa7..19ce68a7e1a8 100644

[PATCH 4/5] mm: debug_vm_pgtable: use VM_ACCESS_FLAGS

2022-10-19 Thread Kefeng Wang
Directly use VM_ACCESS_FLAGS instead VMFLAGS. Signed-off-by: Kefeng Wang --- mm/debug_vm_pgtable.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index dc7df1254f0a..2b61fde8c38c 100644 --- a/mm/debug_vm_pgtable.c +++ b

[PATCH 5/5] amdgpu: use VM_ACCESS_FLAGS

2022-10-19 Thread Kefeng Wang
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Kefeng Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH 2/5] x86/sgx: use VM_ACCESS_FLAGS

2022-10-19 Thread Kefeng Wang
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Cc: Jarkko Sakkinen Cc: Dave Hansen Signed-off-by: Kefeng Wang --- arch/x86/kernel/cpu/sgx/encl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c

[PATCH 3/5] mm: mprotect: use VM_ACCESS_FLAGS

2022-10-19 Thread Kefeng Wang
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Signed-off-by: Kefeng Wang --- mm/mprotect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 668bfaa6ed2a..99762403cc8f 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -756,8

[PATCH 0/5] mm: cleanup with VM_ACCESS_FLAGS

2022-10-19 Thread Kefeng Wang
Kefeng Wang (5): nios2: remove unused INIT_MMAP x86/sgx: use VM_ACCESS_FLAGS mm: mprotect: use VM_ACCESS_FLAGS mm: debug_vm_pgtable: use VM_ACCESS_FLAGS amdgpu: use VM_ACCESS_FLAGS arch/nios2/include/asm/processor.h | 3 --- arch/x86/kernel/cpu/sgx/encl.c | 4

[PATCH 1/5] nios2: remove unused INIT_MMAP

2022-10-19 Thread Kefeng Wang
It seems that INIT_MMAP is gone in 2.4.10, not sure, anyways, it is useless now, kill it. Cc: Dinh Nguyen Signed-off-by: Kefeng Wang --- arch/nios2/include/asm/processor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/nios2/include/asm/processor.h b/arch/nios2/include/asm