LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I6BWFP
--------------------------------
default to use 40 bits address space for user.
Signed-off-by: Hongchen Zhang zhanghongchen@loongson.cn --- arch/loongarch/Kconfig | 7 +++++++ arch/loongarch/include/asm/pgtable.h | 4 ++++ arch/loongarch/mm/pgtable.c | 2 -- 3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index b9b141aa5a13..759e3b30df6e 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -442,6 +442,13 @@ config NODES_SHIFT default "6" depends on NUMA
+config VA_BITS_40 + bool "40-bits" + default y + depends on 64BIT + help + Support a maximum at least 40 bits of application virtual memory. + config ARCH_FORCE_MAX_ORDER int "Maximum zone order" default "13" if PAGE_SIZE_64KB diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index 0ac6afa4a825..cf7d70e563a5 100644 --- a/arch/loongarch/include/asm/pgtable.h +++ b/arch/loongarch/include/asm/pgtable.h @@ -42,7 +42,11 @@ #define PGDIR_SIZE (1UL << PGDIR_SHIFT) #define PGDIR_MASK (~(PGDIR_SIZE-1))
+#ifdef CONFIG_VA_BITS_40 +#define VA_BITS 40 +#else #define VA_BITS (PGDIR_SHIFT + (PAGE_SHIFT - 3)) +#endif
#define PTRS_PER_PGD (PAGE_SIZE >> 3) #if CONFIG_PGTABLE_LEVELS > 3 diff --git a/arch/loongarch/mm/pgtable.c b/arch/loongarch/mm/pgtable.c index 36a6dc0148ae..ef58a676dc9b 100644 --- a/arch/loongarch/mm/pgtable.c +++ b/arch/loongarch/mm/pgtable.c @@ -17,8 +17,6 @@ pgd_t *pgd_alloc(struct mm_struct *mm) if (ret) { init = pgd_offset(&init_mm, 0UL); pgd_init(ret); - memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, - (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); }
return ret;