From: Randy Dunlap <rdunlap@infradead•org>
To: Alexandre Ghiti <alexghiti@rivosinc•com>,
Stephen Rothwell <sfr@canb•auug.org.au>,
Linux Next Mailing List <linux-next@vger•kernel.org>,
Paul Walmsley <paul.walmsley@sifive•com>,
Palmer Dabbelt <palmer@dabbelt•com>,
Albert Ou <aou@eecs•berkeley.edu>, Frederik Haxel <haxel@fzi•de>,
linux-riscv@lists•infradead.org, linux-kernel@vger•kernel.org
Subject: Re: [PATCH] riscv: Fix build error on rv32 + XIP
Date: Thu, 18 Jan 2024 13:27:31 -0800 [thread overview]
Message-ID: <370e7792-a8ce-4e91-8c41-8eec623fdde1@infradead.org> (raw)
In-Reply-To: <20240118212120.2087803-1-alexghiti@rivosinc.com>
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@infradead•org>
> Closes: https://lore.kernel.org/linux-riscv/344dca85-5c48-44e1-bc64-4fa7973edd12@infradead.org/T/#u
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc•com>
Acked-by: Randy Dunlap <rdunlap@infradead•org>
Tested-by: Randy Dunlap <rdunlap@infradead•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
next prev parent reply other threads:[~2024-01-18 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 21:21 [PATCH] riscv: Fix build error on rv32 + XIP Alexandre Ghiti
2024-01-18 21:27 ` Randy Dunlap [this message]
2024-01-20 21:09 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=370e7792-a8ce-4e91-8c41-8eec623fdde1@infradead.org \
--to=rdunlap@infradead$(echo .)org \
--cc=alexghiti@rivosinc$(echo .)com \
--cc=aou@eecs$(echo .)berkeley.edu \
--cc=haxel@fzi$(echo .)de \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=linux-riscv@lists$(echo .)infradead.org \
--cc=palmer@dabbelt$(echo .)com \
--cc=paul.walmsley@sifive$(echo .)com \
--cc=sfr@canb$(echo .)auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox