Skip to content

Commit 4e8537e

Browse files
joergroedelKAGA-KOKO
authored andcommitted
x86/mm/dump_pagetables: Define INIT_PGD
Define INIT_PGD to point to the correct initial page-table for 32 and 64 bit and use it where needed. This fixes the build on 32 bit with CONFIG_PAGE_TABLE_ISOLATION enabled. Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Pavel Machek <pavel@ucw.cz> Cc: "H . Peter Anvin" <hpa@zytor.com> Cc: linux-mm@kvack.org Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Brian Gerst <brgerst@gmail.com> Cc: David Laight <David.Laight@aculab.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Eduardo Valentin <eduval@amazon.com> Cc: Greg KH <gregkh@linuxfoundation.org> Cc: Will Deacon <will.deacon@arm.com> Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Waiman Long <llong@redhat.com> Cc: "David H . Gutteridge" <dhgutteridge@sympatico.ca> Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-32-git-send-email-joro@8bytes.org
1 parent ba0364e commit 4e8537e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/x86/mm/dump_pagetables.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ static struct addr_marker address_markers[] = {
111111
[END_OF_SPACE_NR] = { -1, NULL }
112112
};
113113

114+
#define INIT_PGD ((pgd_t *) &init_top_pgt)
115+
114116
#else /* CONFIG_X86_64 */
115117

116118
enum address_markers_idx {
@@ -139,6 +141,8 @@ static struct addr_marker address_markers[] = {
139141
[END_OF_SPACE_NR] = { -1, NULL }
140142
};
141143

144+
#define INIT_PGD (swapper_pg_dir)
145+
142146
#endif /* !CONFIG_X86_64 */
143147

144148
/* Multipliers for offsets within the PTEs */
@@ -496,11 +500,7 @@ static inline bool is_hypervisor_range(int idx)
496500
static void ptdump_walk_pgd_level_core(struct seq_file *m, pgd_t *pgd,
497501
bool checkwx, bool dmesg)
498502
{
499-
#ifdef CONFIG_X86_64
500-
pgd_t *start = (pgd_t *) &init_top_pgt;
501-
#else
502-
pgd_t *start = swapper_pg_dir;
503-
#endif
503+
pgd_t *start = INIT_PGD;
504504
pgprotval_t prot, eff;
505505
int i;
506506
struct pg_state st = {};
@@ -566,7 +566,7 @@ EXPORT_SYMBOL_GPL(ptdump_walk_pgd_level_debugfs);
566566
static void ptdump_walk_user_pgd_level_checkwx(void)
567567
{
568568
#ifdef CONFIG_PAGE_TABLE_ISOLATION
569-
pgd_t *pgd = (pgd_t *) &init_top_pgt;
569+
pgd_t *pgd = INIT_PGD;
570570

571571
if (!static_cpu_has(X86_FEATURE_PTI))
572572
return;

0 commit comments

Comments
 (0)