[PATCHv3 01/15] x86/vdso32: Prepare for <linux/pgtable.h> inclusion

From: Kiryl Shutsemau

Date: Thu Jan 15 2026 - 09:46:12 EST


The 32-bit vDSO for 64-bit kernels is built by faking a 32-bit environment
through various #undefs and #defines in fake_32bit_build.h.

Upcoming change will include <linux/pgtable.h> in <linux/mmzone.h>.
Without preparation, it breaks build of 32-bit vDSO because of exposure
to more 64-bit things.

CONFIG_PHYS_ADDR_T_64BIT triggers "Missing MAX_POSSIBLE_PHYSMEM_BITS
definition" error in <linux/pgtable.h>.

And CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS leads to "shift count >=
width of type" errors in pte_flags_pkey().

Undefine CONFIG_PHYS_ADDR_T_64BIT and CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
in fake_32bit_build.h to fix the problem.

Signed-off-by: Kiryl Shutsemau <kas@xxxxxxxxxx>
Cc: x86@xxxxxxxxxx
---
arch/x86/entry/vdso/vdso32/fake_32bit_build.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/entry/vdso/vdso32/fake_32bit_build.h b/arch/x86/entry/vdso/vdso32/fake_32bit_build.h
index db1b15f686e3..900cdcde1029 100644
--- a/arch/x86/entry/vdso/vdso32/fake_32bit_build.h
+++ b/arch/x86/entry/vdso/vdso32/fake_32bit_build.h
@@ -13,6 +13,8 @@
#undef CONFIG_SPARSEMEM_VMEMMAP
#undef CONFIG_NR_CPUS
#undef CONFIG_PARAVIRT_XXL
+#undef CONFIG_PHYS_ADDR_T_64BIT
+#undef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS

#define CONFIG_X86_32 1
#define CONFIG_PGTABLE_LEVELS 2
--
2.51.2