Skip to content

Commit 6914f7e

Browse files
author
Ingo Molnar
committed
x86/mm: Define PTRS_PER_PMD for assembly code too
Andy reported the following build warning from head_32.S: In file included from arch/x86/kernel/head_32.S:29: arch/x86/include/asm/pgtable_32.h:59:5: error: "PTRS_PER_PMD" is not defined, evaluates to 0 [-Werror=undef] 59 | #if PTRS_PER_PMD > 1 The reason is that on 2-level i386 paging the folded in PMD's PTRS_PER_PMD constant is not defined in assembly headers, only in generic MM C headers. Instead of trying to fish out the definition from the generic headers, just define it - it even has a comment for it already... Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/Z8oa8AUVyi2HWfo9@gmail.com
1 parent 3e385c0 commit 6914f7e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/include/asm/pgtable-2level_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ typedef union {
2323
#define ARCH_PAGE_TABLE_SYNC_MASK PGTBL_PMD_MODIFIED
2424

2525
/*
26-
* traditional i386 two-level paging structure:
26+
* Traditional i386 two-level paging structure:
2727
*/
2828

2929
#define PGDIR_SHIFT 22
3030
#define PTRS_PER_PGD 1024
3131

32-
3332
/*
34-
* the i386 is two-level, so we don't really have any
35-
* PMD directory physically.
33+
* The i386 is two-level, so we don't really have any
34+
* PMD directory physically:
3635
*/
36+
#define PTRS_PER_PMD 1
3737

3838
#define PTRS_PER_PTE 1024
3939

0 commit comments

Comments
 (0)