From: Alexandre Ghiti <alex@ghiti.fr>
To: Nam Cao <namcao@linutronix.de>,
Alexandre Ghiti <alexghiti@rivosinc.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/8] riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel
Date: Fri, 21 Jun 2024 12:27:43 +0200 [thread overview]
Message-ID: <825ab2df-c040-4454-9db6-8d08bc3df592@ghiti.fr> (raw)
In-Reply-To: <8f8760d3f9a11af4ea0acbc247e4f49ff5d317e9.1717789719.git.namcao@linutronix.de>
Hi Nam,
On 07/06/2024 22:22, Nam Cao wrote:
> The crash utility uses va_kernel_pa_offset to translate virtual addresses.
> This is incorrect in the case of XIP kernel, because va_kernel_pa_offset is
> not the virtual-physical address offset (yes, the name is misleading; this
> variable will be removed for XIP in a following commit).
>
> Stop exporting this variable for XIP kernel. The replacement is to be
> determined, note it as a TODO for now.
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> ---
> arch/riscv/kernel/vmcore_info.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/riscv/kernel/vmcore_info.c b/arch/riscv/kernel/vmcore_info.c
> index 6d7a22522d63..d5e448aa90e7 100644
> --- a/arch/riscv/kernel/vmcore_info.c
> +++ b/arch/riscv/kernel/vmcore_info.c
> @@ -19,6 +19,13 @@ void arch_crash_save_vmcoreinfo(void)
> #endif
> #endif
> vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR);
> +#ifdef CONFIG_XIP_KERNEL
> + /* TODO: Communicate with crash-utility developers on the information to
> + * export. The XIP case is more complicated, because the virtual-physical
> + * address offset depends on whether the address is in ROM or in RAM.
> + */
> +#else
> vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
> kernel_map.va_kernel_pa_offset);
> +#endif
> }
So that will regress crash on XIP kernels, but on the other hand this
was wrong in the first place. And not sure anyone ever used crash on a
XIP platform.
At least people will know that using va_kernel_pa_offset was wrong, so:
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks for all your changes in v2,
Alex
next prev parent reply other threads:[~2024-06-21 10:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 20:22 [PATCH v2 0/8] remove size limit on " Nam Cao
2024-06-07 20:22 ` [PATCH v2 1/8] riscv: cleanup XIP_FIXUP macro Nam Cao
2024-06-07 20:22 ` [PATCH v2 2/8] riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel Nam Cao
2024-06-21 10:27 ` Alexandre Ghiti [this message]
2024-06-07 20:22 ` [PATCH v2 3/8] riscv: replace misleading va_kernel_pa_offset on " Nam Cao
2024-06-07 20:22 ` [PATCH v2 4/8] riscv: drop the use of XIP_OFFSET in XIP_FIXUP_OFFSET Nam Cao
2024-06-07 20:22 ` [PATCH v2 5/8] riscv: drop the use of XIP_OFFSET in XIP_FIXUP_FLASH_OFFSET Nam Cao
2024-06-07 20:22 ` [PATCH v2 6/8] riscv: drop the use of XIP_OFFSET in kernel_mapping_va_to_pa() Nam Cao
2024-06-07 20:22 ` [PATCH v2 7/8] riscv: drop the use of XIP_OFFSET in create_kernel_page_table() Nam Cao
2024-06-07 20:22 ` [PATCH v2 8/8] riscv: remove limit on the size of read-only section for XIP kernel Nam Cao
2024-09-14 8:13 ` [PATCH v2 0/8] remove size limit on " 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=825ab2df-c040-4454-9db6-8d08bc3df592@ghiti.fr \
--to=alex@ghiti.fr \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=namcao@linutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®