Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: Remove 3-level page table support on i386

The highmem support has been removed by commit a98a6d864d3b ("um:
Remove broken highmem support"). The 2-level page table is sufficient
on UML/i386 now. Remove the 3-level page table support on UML/i386
which is still marked as experimental.

Suggested-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20240918061702.614837-1-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Tiwei Bie and committed by
Johannes Berg
ed236fe4 5a695127

+1 -43
-1
arch/um/configs/i386_defconfig
··· 1 - CONFIG_3_LEVEL_PGTABLES=y 2 1 # CONFIG_COMPACTION is not set 3 2 CONFIG_BINFMT_MISC=m 4 3 CONFIG_HOSTFS=y
-24
arch/um/include/asm/page.h
··· 32 32 #define clear_user_page(page, vaddr, pg) clear_page(page) 33 33 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 34 34 35 - #if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT) 36 - 37 - typedef struct { unsigned long pte; } pte_t; 38 - typedef struct { unsigned long pmd; } pmd_t; 39 - typedef struct { unsigned long pgd; } pgd_t; 40 - #define pte_val(p) ((p).pte) 41 - 42 - #define pte_get_bits(p, bits) ((p).pte & (bits)) 43 - #define pte_set_bits(p, bits) ((p).pte |= (bits)) 44 - #define pte_clear_bits(p, bits) ((p).pte &= ~(bits)) 45 - #define pte_copy(to, from) ({ (to).pte = (from).pte; }) 46 - #define pte_is_zero(p) (!((p).pte & ~_PAGE_NEWPAGE)) 47 - #define pte_set_val(p, phys, prot) \ 48 - ({ (p).pte = (phys) | pgprot_val(prot); }) 49 - 50 - #define pmd_val(x) ((x).pmd) 51 - #define __pmd(x) ((pmd_t) { (x) } ) 52 - 53 - typedef unsigned long long phys_t; 54 - 55 - #else 56 - 57 35 typedef struct { unsigned long pte; } pte_t; 58 36 typedef struct { unsigned long pgd; } pgd_t; 59 37 ··· 52 74 #define pte_set_val(p, phys, prot) (p).pte = (phys | pgprot_val(prot)) 53 75 54 76 typedef unsigned long phys_t; 55 - 56 - #endif 57 77 58 78 typedef struct { unsigned long pgprot; } pgprot_t; 59 79
-9
arch/um/include/asm/pgtable-3level.h
··· 11 11 12 12 /* PGDIR_SHIFT determines what a third-level page table entry can map */ 13 13 14 - #ifdef CONFIG_64BIT 15 14 #define PGDIR_SHIFT 30 16 - #else 17 - #define PGDIR_SHIFT 31 18 - #endif 19 15 #define PGDIR_SIZE (1UL << PGDIR_SHIFT) 20 16 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 21 17 ··· 28 32 */ 29 33 30 34 #define PTRS_PER_PTE 512 31 - #ifdef CONFIG_64BIT 32 35 #define PTRS_PER_PMD 512 33 36 #define PTRS_PER_PGD 512 34 - #else 35 - #define PTRS_PER_PMD 1024 36 - #define PTRS_PER_PGD 1024 37 - #endif 38 37 39 38 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) 40 39
+1 -9
arch/x86/um/Kconfig
··· 30 30 select MODULES_USE_ELF_RELA 31 31 32 32 config 3_LEVEL_PGTABLES 33 - bool "Three-level pagetables" if !64BIT 34 - default 64BIT 35 - help 36 - Three-level pagetables will let UML have more than 4G of physical 37 - memory. All the memory that can't be mapped directly will be treated 38 - as high memory. 39 - 40 - However, this it experimental on 32-bit architectures, so if unsure say 41 - N (on x86-64 it's automatically enabled, instead, as it's safe there). 33 + def_bool 64BIT 42 34 43 35 config ARCH_HAS_SC_SIGNALS 44 36 def_bool !64BIT