[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJF2gTTYHqJdz0+rrNyLPSi+Q-LLQYk=pb86vfnd1u03G+Sovw@mail.gmail.com>
Date: Fri, 24 Sep 2021 14:09:24 +0800
From: Guo Ren <guoren@...nel.org>
To: Guo Ren <guoren@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Linux-MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Guo Ren <guoren@...ux.alibaba.com>
Subject: Re: [PATCH] mm: debug_vm_pgtable: Don't use __P000 directly
Sorry, the patch forgets to add --prefix PATCH V2, abandon.
Review the V2, thx.
On Fri, Sep 24, 2021 at 2:07 PM <guoren@...nel.org> wrote:
>
> From: Guo Ren <guoren@...ux.alibaba.com>
>
> The __Pxxx/__Sxxx macros are only for protection_map[] init. All
> usage of them in linux should come from protection_map array.
>
> Because a lot of architectures would re-initilize protection_map[]
> array, eg: x86-mem_encrypt, m68k-motorola, mips, arm, sparc.
>
> Using __P000 is not rigorous.
>
> Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
> Reviewed-by: Andrew Morton <akpm@...ux-foundation.org>
>
> ---
>
> Changes since V2:
> - s/init protection_map[]/protection_map[] init/
> - s/Becasue/Because/
> - Remove unclear part
> - Replace __P000 and __S000 with protection_map[0] and
> protection_map[8]
> ---
> mm/debug_vm_pgtable.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index 1403639302e4..228e3954b90c 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -1104,13 +1104,14 @@ static int __init init_args(struct pgtable_debug_args *args)
> /*
> * Initialize the debugging data.
> *
> - * __P000 (or even __S000) will help create page table entries with
> - * PROT_NONE permission as required for pxx_protnone_tests().
> + * protection_map[0] (or even protection_map[8]) will help create
> + * page table entries with PROT_NONE permission as required for
> + * pxx_protnone_tests().
> */
> memset(args, 0, sizeof(*args));
> args->vaddr = get_random_vaddr();
> args->page_prot = vm_get_page_prot(VMFLAGS);
> - args->page_prot_none = __P000;
> + args->page_prot_none = protection_map[0];
> args->is_contiguous_page = false;
> args->pud_pfn = ULONG_MAX;
> args->pmd_pfn = ULONG_MAX;
> --
> 2.25.1
>
--
Best Regards
Guo Ren
ML: https://lore.kernel.org/linux-csky/
Powered by blists - more mailing lists