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]
Date: Thu, 18 Jan 2024 13:27:31 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Alexandre Ghiti <alexghiti@...osinc.com>,
 Stephen Rothwell <sfr@...b.auug.org.au>,
 Linux Next Mailing List <linux-next@...r.kernel.org>,
 Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
 <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
 Frederik Haxel <haxel@....de>, linux-riscv@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: Fix build error on rv32 + XIP



On 1/18/24 13:21, Alexandre Ghiti wrote:
> commit 66f1e6809397 ("riscv: Make XIP bootable again") restricted page
> offset to the sv39 page offset instead of the default sv57, which makes
> sense since probably the platforms that target XIP kernels do not
> support anything else than sv39 and we do not try to find out the
> largest address space supported on XIP kernels (ie set_satp_mode()).
> 
> But PAGE_OFFSET_L3 is not defined for rv32, so fix the build error by
> restoring the previous behaviour which picks CONFIG_PAGE_OFFSET for rv32.
> 
> Fixes: 66f1e6809397 ("riscv: Make XIP bootable again")
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
> Closes: https://lore.kernel.org/linux-riscv/344dca85-5c48-44e1-bc64-4fa7973edd12@infradead.org/T/#u
> Signed-off-by: Alexandre Ghiti <alexghiti@...osinc.com>

Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org> # build-tested

Thanks.


> ---
>  arch/riscv/mm/init.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index f533dd667a83..32cad6a65ccd 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -1060,7 +1060,11 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  	kernel_map.virt_addr = KERNEL_LINK_ADDR + kernel_map.virt_offset;
>  
>  #ifdef CONFIG_XIP_KERNEL
> +#ifdef CONFIG_64BIT
>  	kernel_map.page_offset = PAGE_OFFSET_L3;
> +#else
> +	kernel_map.page_offset = _AC(CONFIG_PAGE_OFFSET, UL);
> +#endif
>  	kernel_map.xiprom = (uintptr_t)CONFIG_XIP_PHYS_ADDR;
>  	kernel_map.xiprom_sz = (uintptr_t)(&_exiprom) - (uintptr_t)(&_xiprom);
>  

-- 
#Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ