diff mbox series

riscv: Remove redundant restriction on memory size

Message ID 20240624121723.2186279-1-stuart.menefy@codasip.com (mailing list archive)
State Accepted
Commit d6a1928134a1c626ff369129d7a80951b2949a48
Headers show
Series riscv: Remove redundant restriction on memory size | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Stuart Menefy June 24, 2024, 12:17 p.m. UTC
The original reason for reserving the top 4GiB of the direct map
(space for modules/BPF/kernel) hasn't applied since the address
map was reworked for KASAN.

Signed-off-by: Stuart Menefy <stuart.menefy@codasip.com>
---
 arch/riscv/mm/init.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Alexandre Ghiti July 1, 2024, 12:21 p.m. UTC | #1
Hi Stuart,

On 24/06/2024 14:17, Stuart Menefy wrote:
> The original reason for reserving the top 4GiB of the direct map
> (space for modules/BPF/kernel) hasn't applied since the address
> map was reworked for KASAN.
>
> Signed-off-by: Stuart Menefy <stuart.menefy@codasip.com>
> ---
>   arch/riscv/mm/init.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 7e25606f858a..3998d1ca369c 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -1130,13 +1130,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>   				0UL : PAGE_OFFSET - kernel_map.phys_addr;
>   	kernel_map.va_kernel_pa_offset = kernel_map.virt_addr - kernel_map.phys_addr;
>   
> -	/*
> -	 * The default maximal physical memory size is KERN_VIRT_SIZE for 32-bit
> -	 * kernel, whereas for 64-bit kernel, the end of the virtual address
> -	 * space is occupied by the modules/BPF/kernel mappings which reduces
> -	 * the available size of the linear mapping.
> -	 */
> -	memory_limit = KERN_VIRT_SIZE - (IS_ENABLED(CONFIG_64BIT) ? SZ_4G : 0);
> +	memory_limit = KERN_VIRT_SIZE;
>   
>   	/* Sanity check alignment and size */
>   	BUG_ON((PAGE_OFFSET % PGDIR_SIZE) != 0);


I somehow totally missed this one, I guess this is the third fix you 
mentioned earlier right?

This is correct so you can add:

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks,

Alex
patchwork-bot+linux-riscv@kernel.org Sept. 17, 2024, 1 p.m. UTC | #2
Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Mon, 24 Jun 2024 13:17:23 +0100 you wrote:
> The original reason for reserving the top 4GiB of the direct map
> (space for modules/BPF/kernel) hasn't applied since the address
> map was reworked for KASAN.
> 
> Signed-off-by: Stuart Menefy <stuart.menefy@codasip.com>
> ---
>  arch/riscv/mm/init.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Here is the summary with links:
  - riscv: Remove redundant restriction on memory size
    https://git.kernel.org/riscv/c/d6a1928134a1

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 7e25606f858a..3998d1ca369c 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -1130,13 +1130,7 @@  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
 				0UL : PAGE_OFFSET - kernel_map.phys_addr;
 	kernel_map.va_kernel_pa_offset = kernel_map.virt_addr - kernel_map.phys_addr;
 
-	/*
-	 * The default maximal physical memory size is KERN_VIRT_SIZE for 32-bit
-	 * kernel, whereas for 64-bit kernel, the end of the virtual address
-	 * space is occupied by the modules/BPF/kernel mappings which reduces
-	 * the available size of the linear mapping.
-	 */
-	memory_limit = KERN_VIRT_SIZE - (IS_ENABLED(CONFIG_64BIT) ? SZ_4G : 0);
+	memory_limit = KERN_VIRT_SIZE;
 
 	/* Sanity check alignment and size */
 	BUG_ON((PAGE_OFFSET % PGDIR_SIZE) != 0);