[PATCH] LoongArch: mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS

WangYuli posted 1 patch 3 weeks, 1 day ago
arch/loongarch/include/asm/page.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] LoongArch: mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS
Posted by WangYuli 3 weeks, 1 day ago
Commit c62da0c35d58 ("mm/vma: define a default value for
VM_DATA_DEFAULT_FLAGS") has unified default values of
VM_DATA_DEFAULT_FLAGS across different platforms.

Apply the same consistency to LoongArch.

Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 arch/loongarch/include/asm/page.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/loongarch/include/asm/page.h b/arch/loongarch/include/asm/page.h
index e85df33f11c7..8f21567a3188 100644
--- a/arch/loongarch/include/asm/page.h
+++ b/arch/loongarch/include/asm/page.h
@@ -113,10 +113,7 @@ struct page *tlb_virt_to_page(unsigned long kaddr);
 extern int __virt_addr_valid(volatile void *kaddr);
 #define virt_addr_valid(kaddr)	__virt_addr_valid((volatile void *)(kaddr))
 
-#define VM_DATA_DEFAULT_FLAGS \
-	(VM_READ | VM_WRITE | \
-	 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
-	 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+#define VM_DATA_DEFAULT_FLAGS	VM_DATA_FLAGS_TSK_EXEC
 
 #include <asm-generic/memory_model.h>
 #include <asm-generic/getorder.h>
-- 
2.45.2
Re: [PATCH] LoongArch: mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS
Posted by Huacai Chen 3 weeks, 1 day ago
Queued, thanks.

Huacai

On Sat, Nov 2, 2024 at 1:42 PM WangYuli <wangyuli@uniontech.com> wrote:
>
> Commit c62da0c35d58 ("mm/vma: define a default value for
> VM_DATA_DEFAULT_FLAGS") has unified default values of
> VM_DATA_DEFAULT_FLAGS across different platforms.
>
> Apply the same consistency to LoongArch.
>
> Suggested-by: Wentao Guan <guanwentao@uniontech.com>
> Signed-off-by: WangYuli <wangyuli@uniontech.com>
> ---
>  arch/loongarch/include/asm/page.h | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/loongarch/include/asm/page.h b/arch/loongarch/include/asm/page.h
> index e85df33f11c7..8f21567a3188 100644
> --- a/arch/loongarch/include/asm/page.h
> +++ b/arch/loongarch/include/asm/page.h
> @@ -113,10 +113,7 @@ struct page *tlb_virt_to_page(unsigned long kaddr);
>  extern int __virt_addr_valid(volatile void *kaddr);
>  #define virt_addr_valid(kaddr) __virt_addr_valid((volatile void *)(kaddr))
>
> -#define VM_DATA_DEFAULT_FLAGS \
> -       (VM_READ | VM_WRITE | \
> -        ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
> -        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
> +#define VM_DATA_DEFAULT_FLAGS  VM_DATA_FLAGS_TSK_EXEC
>
>  #include <asm-generic/memory_model.h>
>  #include <asm-generic/getorder.h>
> --
> 2.45.2
>