]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/mm: Define PTRS_PER_PMD for assembly code too
authorIngo Molnar <mingo@kernel.org>
Thu, 6 Mar 2025 22:00:16 +0000 (23:00 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 7 Mar 2025 23:09:09 +0000 (00:09 +0100)
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
arch/x86/include/asm/pgtable-2level_types.h

index 7f6ccff0ba727c94155d86ccc612ad7609de0317..4a12c276b1812ca9148968ef01df03ef18b13288 100644 (file)
@@ -23,17 +23,17 @@ typedef union {
 #define ARCH_PAGE_TABLE_SYNC_MASK      PGTBL_PMD_MODIFIED
 
 /*
- * traditional i386 two-level paging structure:
+ * Traditional i386 two-level paging structure:
  */
 
 #define PGDIR_SHIFT    22
 #define PTRS_PER_PGD   1024
 
-
 /*
- * the i386 is two-level, so we don't really have any
- * PMD directory physically.
+ * The i386 is two-level, so we don't really have any
+ * PMD directory physically:
  */
+#define PTRS_PER_PMD   1
 
 #define PTRS_PER_PTE   1024