From: Guo Ren <guoren@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Guo Ren <guoren@linux.alibaba.com>
Subject: Re: [PATCH V2] mm: debug_vm_pgtable: Don't use __P000 directly
Date: Mon, 27 Sep 2021 14:21:41 +0800 [thread overview]
Message-ID: <CAJF2gTRmvYBG5=NN4-53z2Gk-bC42LOHsEzHV6cnruoq1Xh0LA@mail.gmail.com> (raw)
In-Reply-To: <30c10b5f-1b26-e0a8-8185-6fa3296d68dc@arm.com>
Got it, thanks!
On Mon, Sep 27, 2021 at 10:16 AM Anshuman Khandual
<anshuman.khandual@arm.com> wrote:
>
>
>
> On 9/24/21 11:38 AM, guoren@kernel.org wrote:
> > From: Guo Ren <guoren@linux.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@linux.alibaba.com>
> > Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
>
> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
>
>
> >
> > ---
> >
> > 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;
> >
--
Best Regards
Guo Ren
ML: https://lore.kernel.org/linux-csky/
prev parent reply other threads:[~2021-09-27 6:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 6:08 [PATCH V2] mm: debug_vm_pgtable: Don't use __P000 directly guoren
2021-09-27 2:17 ` Anshuman Khandual
2021-09-27 6:21 ` Guo Ren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJF2gTRmvYBG5=NN4-53z2Gk-bC42LOHsEzHV6cnruoq1Xh0LA@mail.gmail.com' \
--to=guoren@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=guoren@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).