Skip to content

Commit 8772716

Browse files
guoren83torvalds
authored andcommitted
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/[email protected] Signed-off-by: Guo Ren <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Cc: Gavin Shan <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Gerald Schaefer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2301003 commit 8772716

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mm/debug_vm_pgtable.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,13 +1104,14 @@ static int __init init_args(struct pgtable_debug_args *args)
11041104
/*
11051105
* Initialize the debugging data.
11061106
*
1107-
* __P000 (or even __S000) will help create page table entries with
1108-
* PROT_NONE permission as required for pxx_protnone_tests().
1107+
* protection_map[0] (or even protection_map[8]) will help create
1108+
* page table entries with PROT_NONE permission as required for
1109+
* pxx_protnone_tests().
11091110
*/
11101111
memset(args, 0, sizeof(*args));
11111112
args->vaddr = get_random_vaddr();
11121113
args->page_prot = vm_get_page_prot(VMFLAGS);
1113-
args->page_prot_none = __P000;
1114+
args->page_prot_none = protection_map[0];
11141115
args->is_contiguous_page = false;
11151116
args->pud_pfn = ULONG_MAX;
11161117
args->pmd_pfn = ULONG_MAX;

0 commit comments

Comments
 (0)