x86/mm: fix dump pagetables for 4 levels of page tables
PATCH 1/1 x86/mm: fix dump pagetables for 4 levels of page tables
Commit fdd3d8ce0ea62 ("x86/dump_pagetables: Add support for 5-level paging") introduced an error for dumping with only 4 levels by setting PGD_LEVEL_MULT to a wrong value.
This is leading to e.g. addresses printed as "(null)" for ranges:
x86/mm: Found insecure W+X mapping at address (null)/(null)
--- arch/x86/mm/dump_pagetables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/dump_pagetables.c +1 -1
@@ -111,7 +111,7 @@ static struct addr_marker address_markers[] = {#define PMD_LEVEL_MULT (PTRS_PER_PTE * PTE_LEVEL_MULT)#define PUD_LEVEL_MULT (PTRS_PER_PMD * PMD_LEVEL_MULT)#define P4D_LEVEL_MULT (PTRS_PER_PUD * PUD_LEVEL_MULT) -#define PGD_LEVEL_MULT (PTRS_PER_PUD * P4D_LEVEL_MULT) +#define PGD_LEVEL_MULT (PTRS_PER_P4D * P4D_LEVEL_MULT) #define pt_dump_seq_printf(m, to_dmesg, fmt, args...) \ ({ \
Signature · 1 line
2.12.0
Quoted 9 lines · Juergen Gross
Commit
fdd3d8ce0ea62("x86/dump_pagetables: Add support for 5-level paging") introduced an error for dumping with only 4 levels by settingPGD_LEVEL_MULTto a wrong value.This is leading to e.g. addresses printed as "(null)" for ranges:
x86/mm: Found insecure W+X mapping at address (null)/(null)
Signed-off-by Juergen Gross <[email protected]>
Sorry for this.
Signature · 1 line
Kirill A. Shutemov
tip-bot for Juergen Gross
merge bot[tip:x86/mm] x86/mm: Fix dump pagetables for 4 levels of page tables
In reply to Juergen Grossx86/mm: Fix dump pagetables for 4 levels of page tables
Commit-ID: 84bbabc3a452e8085cfbd745ff0bff2b89074417 Gitweb: http://git.kernel.org/tip/84bbabc3a452e8085cfbd745ff0bff2b89074417 Author: Juergen Gross <[email protected]> AuthorDate: Wed, 12 Apr 2017 16:36:34 +0200 Committer: Thomas Gleixner <[email protected]> CommitDate: Thu, 13 Apr 2017 00:26:30 +0200
x86/mm: Fix dump pagetables for 4 levels of page tables
Commit fdd3d8ce0ea62 ("x86/dump_pagetables: Add support for 5-level paging") introduced an error for dumping with only 4 levels by setting PGD_LEVEL_MULT to a wrong value.
This is leading to e.g. addresses printed as "(null)" for ranges:
x86/mm: Found insecure W+X mapping at address (null)/(null)
Make PGD_LEVEL_MULT a multiple of PTRS_PER_P4D instead of PTRS_PER_PUD
--- arch/x86/mm/dump_pagetables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/dump_pagetables.c +1 -1
@@ -111,7 +111,7 @@ static struct addr_marker address_markers[] = {#define PMD_LEVEL_MULT (PTRS_PER_PTE * PTE_LEVEL_MULT)#define PUD_LEVEL_MULT (PTRS_PER_PMD * PMD_LEVEL_MULT)#define P4D_LEVEL_MULT (PTRS_PER_PUD * PUD_LEVEL_MULT) -#define PGD_LEVEL_MULT (PTRS_PER_PUD * P4D_LEVEL_MULT) +#define PGD_LEVEL_MULT (PTRS_PER_P4D * P4D_LEVEL_MULT) #define pt_dump_seq_printf(m, to_dmesg, fmt, args...) \ ({ \