* + mm-debug_vm_pgtable-dont-use-__p000-directly.patch added to -mm tree
@ 2021-09-24 20:53 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2021-09-24 20:53 UTC (permalink / raw)
To: akpm, anshuman.khandual, christophe.leroy, gerald.schaefer,
gshan, guoren, mm-commits
The patch titled
Subject: mm: debug_vm_pgtable: don't use __P000 directly
has been added to the -mm tree. Its filename is
mm-debug_vm_pgtable-dont-use-__p000-directly.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-debug_vm_pgtable-dont-use-__p000-directly.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-debug_vm_pgtable-dont-use-__p000-directly.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Guo Ren <guoren@linux.alibaba.com>
Subject: mm: debug_vm_pgtable: don't use __P000 directly
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.
Link: https://lkml.kernel.org/r/20210924060821.1138281-1-guoren@kernel.org
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Gavin Shan <gshan@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/debug_vm_pgtable.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/mm/debug_vm_pgtable.c~mm-debug_vm_pgtable-dont-use-__p000-directly
+++ a/mm/debug_vm_pgtable.c
@@ -1104,13 +1104,14 @@ static int __init init_args(struct pgtab
/*
* 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;
_
Patches currently in -mm which might be from guoren@linux.alibaba.com are
mm-debug_vm_pgtable-dont-use-__p000-directly.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* + mm-debug_vm_pgtable-dont-use-__p000-directly.patch added to -mm tree
@ 2021-09-24 2:49 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2021-09-24 2:49 UTC (permalink / raw)
To: anshuman.khandual, christophe.leroy, gerald.schaefer, gshan,
guoren, mm-commits
The patch titled
Subject: mm: debug_vm_pgtable: Don't use __P000 directly
has been added to the -mm tree. Its filename is
mm-debug_vm_pgtable-dont-use-__p000-directly.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-debug_vm_pgtable-dont-use-__p000-directly.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-debug_vm_pgtable-dont-use-__p000-directly.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Guo Ren <guoren@linux.alibaba.com>
Subject: mm: debug_vm_pgtable: Don't use __P000 directly
The __Pxxx/__Sxxx macros are only for init protection_map[]. 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 maybe won't cause bug because hw would deny access with
PROT_NONE permission, but it's not rigorous.
Link: https://lkml.kernel.org/r/20210921201815.284412-1-guoren@kernel.org
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Gavin Shan <gshan@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/debug_vm_pgtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/debug_vm_pgtable.c~mm-debug_vm_pgtable-dont-use-__p000-directly
+++ a/mm/debug_vm_pgtable.c
@@ -1104,13 +1104,13 @@ static int __init init_args(struct pgtab
/*
* Initialize the debugging data.
*
- * __P000 (or even __S000) will help create page table entries with
+ * __P000 (protection_map[0]) 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;
_
Patches currently in -mm which might be from guoren@linux.alibaba.com are
mm-debug_vm_pgtable-dont-use-__p000-directly.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-24 20:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 20:53 + mm-debug_vm_pgtable-dont-use-__p000-directly.patch added to -mm tree akpm
-- strict thread matches above, loose matches on Subject: below --
2021-09-24 2:49 akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.