From 0dde507c5edf256b557dbd8d1dccb50972474fc8 Mon Sep 17 00:00:00 2001 From: Hongchen Zhang Date: Wed, 30 Nov 2022 18:38:34 +0800 Subject: [PATCH] LoongArch: use 40 bits address space for user 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 Change-Id: I23088f43e700ed9b4eb15df2cc9c58299a0582ff --- arch/loongarch/Kconfig | 7 +++++++ arch/loongarch/include/asm/pgtable.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index c8619a3c16f8..7ff49eba631b 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -426,6 +426,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 FORCE_MAX_ZONEORDER int "Maximum zone order" range 14 64 if PAGE_SIZE_64KB diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index e5ed54fce402..27aa3d03162d 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 -- GitLab