lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43829e94-98ae-46a4-a3e6-dbabbe94d7c1@ghiti.fr>
Date: Wed, 8 May 2024 20:22:43 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Nam Cao <namcao@...utronix.de>, Paul Walmsley <paul.walmsley@...ive.com>,
 Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
 Alexandre Ghiti <alexghiti@...osinc.com>, linux-riscv@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: Don't use hugepage mappings for vmemmap if it's
 not supported

Hi Nam,

On 08/05/2024 19:31, Nam Cao wrote:
> Commit ff172d4818ad ("riscv: Use hugepage mappings for vmemmap") broke XIP
> kernel, because huge pages are not supported on XIP kernel.


I don't understand why XIP kernels can't support huge vmalloc mappings, 
so I think the right fix would be to enable such mappings on XIP. WDYT?

Thanks,

Alex


>
> Only use hugepage mapping if it is supported.
>
> Fixes: ff172d4818ad ("riscv: Use hugepage mappings for vmemmap")
> Signed-off-by: Nam Cao <namcao@...utronix.de>
> Cc: Alexandre Ghiti <alexghiti@...osinc.com>
> Cc: <stable@...r.kernel.org>
> ---
>   arch/riscv/mm/init.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 968761843203..c081e7d349b1 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -1414,6 +1414,8 @@ int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node,
>   int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
>   			       struct vmem_altmap *altmap)
>   {
> +	if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP))
> +		return vmemmap_populate_basepages(start, end, node, NULL);
>   	/*
>   	 * Note that SPARSEMEM_VMEMMAP is only selected for rv64 and that we
>   	 * can't use hugepage mappings for 2-level page table because in case of

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ