public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
@ 2023-07-24 10:09 Song Shuai
  2023-07-24 10:09 ` [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 Song Shuai
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Song Shuai @ 2023-07-24 10:09 UTC (permalink / raw)
  To: bhe, vgoyal, dyoung, corbet, paul.walmsley, palmer, aou,
	xianting.tian, suagrfillet, anup, robh, ajones, alexghiti,
	conor.dooley
  Cc: kexec, linux-doc, linux-kernel, linux-riscv

Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use
PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base
from the physical start of the kernel to the actual start of the DRAM.

The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr
to translate kernel virtual address, that failed the Crash with Linux v6.4 [1].

Export kernel_map.va_kernel_pa_offset in vmcoreinfo to help Crash translate
the kernel virtual address correctly.

Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping")
Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/ [1]
Signed-off-by: Song Shuai <suagrfillet@gmail.com>
---
 arch/riscv/kernel/crash_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/kernel/crash_core.c b/arch/riscv/kernel/crash_core.c
index b351a3c01355..55f1d7856b54 100644
--- a/arch/riscv/kernel/crash_core.c
+++ b/arch/riscv/kernel/crash_core.c
@@ -18,4 +18,6 @@ void arch_crash_save_vmcoreinfo(void)
 	vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END);
 #endif
 	vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR);
+	vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
+						kernel_map.va_kernel_pa_offset);
 }
-- 
2.20.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64
  2023-07-24 10:09 [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Song Shuai
@ 2023-07-24 10:09 ` Song Shuai
  2023-07-25  7:48   ` Alexandre Ghiti
  2023-07-25  1:52 ` [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Xianting Tian
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Song Shuai @ 2023-07-24 10:09 UTC (permalink / raw)
  To: bhe, vgoyal, dyoung, corbet, paul.walmsley, palmer, aou,
	xianting.tian, suagrfillet, anup, robh, ajones, alexghiti,
	conor.dooley
  Cc: kexec, linux-doc, linux-kernel, linux-riscv

RISC-V Linux exports "va_kernel_pa_offset" in vmcoreinfo to help
Crash-utility translate the kernel virtual address correctly.

Here adds the definition of "va_kernel_pa_offset".

Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping")
Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/
Signed-off-by: Song Shuai <suagrfillet@gmail.com>
---
 Documentation/admin-guide/kdump/vmcoreinfo.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst
index c18d94fa6470..f8ebb63b6c5d 100644
--- a/Documentation/admin-guide/kdump/vmcoreinfo.rst
+++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst
@@ -624,3 +624,9 @@ Used to get the correct ranges:
   * VMALLOC_START ~ VMALLOC_END : vmalloc() / ioremap() space.
   * VMEMMAP_START ~ VMEMMAP_END : vmemmap space, used for struct page array.
   * KERNEL_LINK_ADDR : start address of Kernel link and BPF
+
+va_kernel_pa_offset
+-------------------
+
+Indicates the offset between the kernel virtual and physical mappings.
+Used to translate virtual to physical addresses.
-- 
2.20.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
  2023-07-24 10:09 [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Song Shuai
  2023-07-24 10:09 ` [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 Song Shuai
@ 2023-07-25  1:52 ` Xianting Tian
  2023-07-25  7:46 ` Alexandre Ghiti
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Xianting Tian @ 2023-07-25  1:52 UTC (permalink / raw)
  To: Song Shuai, bhe, vgoyal, dyoung, corbet, paul.walmsley, palmer,
	aou, anup, robh, ajones, alexghiti, conor.dooley
  Cc: kexec, linux-doc, linux-kernel, linux-riscv


在 2023/7/24 下午6:09, Song Shuai 写道:
> Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use
> PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base
> from the physical start of the kernel to the actual start of the DRAM.
>
> The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr
> to translate kernel virtual address, that failed the Crash with Linux v6.4 [1].
>
> Export kernel_map.va_kernel_pa_offset in vmcoreinfo to help Crash translate
> the kernel virtual address correctly.
>
> Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping")
> Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/ [1]
> Signed-off-by: Song Shuai <suagrfillet@gmail.com>
> ---
>   arch/riscv/kernel/crash_core.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/kernel/crash_core.c b/arch/riscv/kernel/crash_core.c
> index b351a3c01355..55f1d7856b54 100644
> --- a/arch/riscv/kernel/crash_core.c
> +++ b/arch/riscv/kernel/crash_core.c
> @@ -18,4 +18,6 @@ void arch_crash_save_vmcoreinfo(void)
>   	vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END);
>   #endif
>   	vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR);
> +	vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
> +						kernel_map.va_kernel_pa_offset);
>   }
Reviewed-by: Xianting Tian  <xianting.tian@linux.alibaba.com>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
  2023-07-24 10:09 [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Song Shuai
  2023-07-24 10:09 ` [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 Song Shuai
  2023-07-25  1:52 ` [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Xianting Tian
@ 2023-07-25  7:46 ` Alexandre Ghiti
  2023-08-03 14:45 ` Palmer Dabbelt
  2023-08-03 15:10 ` patchwork-bot+linux-riscv
  4 siblings, 0 replies; 7+ messages in thread
From: Alexandre Ghiti @ 2023-07-25  7:46 UTC (permalink / raw)
  To: Song Shuai, bhe, vgoyal, dyoung, corbet, paul.walmsley, palmer,
	aou, xianting.tian, anup, robh, ajones, alexghiti, conor.dooley
  Cc: kexec, linux-doc, linux-kernel, linux-riscv

Hi Song,


On 24/07/2023 12:09, Song Shuai wrote:
> Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use
> PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base
> from the physical start of the kernel to the actual start of the DRAM.
>
> The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr
> to translate kernel virtual address, that failed the Crash with Linux v6.4 [1].
>
> Export kernel_map.va_kernel_pa_offset in vmcoreinfo to help Crash translate
> the kernel virtual address correctly.
>
> Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping")
> Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/ [1]
> Signed-off-by: Song Shuai <suagrfillet@gmail.com>
> ---
>   arch/riscv/kernel/crash_core.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/kernel/crash_core.c b/arch/riscv/kernel/crash_core.c
> index b351a3c01355..55f1d7856b54 100644
> --- a/arch/riscv/kernel/crash_core.c
> +++ b/arch/riscv/kernel/crash_core.c
> @@ -18,4 +18,6 @@ void arch_crash_save_vmcoreinfo(void)
>   	vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END);
>   #endif
>   	vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR);
> +	vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
> +						kernel_map.va_kernel_pa_offset);
>   }


You can add:

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

Thanks for that and for the instructions on how to reproduce the problem 
BTW!

Alex



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64
  2023-07-24 10:09 ` [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 Song Shuai
@ 2023-07-25  7:48   ` Alexandre Ghiti
  0 siblings, 0 replies; 7+ messages in thread
From: Alexandre Ghiti @ 2023-07-25  7:48 UTC (permalink / raw)
  To: Song Shuai, bhe, vgoyal, dyoung, corbet, paul.walmsley, palmer,
	aou, xianting.tian, anup, robh, ajones, alexghiti, conor.dooley
  Cc: kexec, linux-doc, linux-kernel, linux-riscv


On 24/07/2023 12:09, Song Shuai wrote:
> RISC-V Linux exports "va_kernel_pa_offset" in vmcoreinfo to help
> Crash-utility translate the kernel virtual address correctly.
>
> Here adds the definition of "va_kernel_pa_offset".
>
> Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping")
> Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/
> Signed-off-by: Song Shuai <suagrfillet@gmail.com>
> ---
>   Documentation/admin-guide/kdump/vmcoreinfo.rst | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst
> index c18d94fa6470..f8ebb63b6c5d 100644
> --- a/Documentation/admin-guide/kdump/vmcoreinfo.rst
> +++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst
> @@ -624,3 +624,9 @@ Used to get the correct ranges:
>     * VMALLOC_START ~ VMALLOC_END : vmalloc() / ioremap() space.
>     * VMEMMAP_START ~ VMEMMAP_END : vmemmap space, used for struct page array.
>     * KERNEL_LINK_ADDR : start address of Kernel link and BPF
> +
> +va_kernel_pa_offset
> +-------------------
> +
> +Indicates the offset between the kernel virtual and physical mappings.
> +Used to translate virtual to physical addresses.


You can add:

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

Thanks,

Alex


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
  2023-07-24 10:09 [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Song Shuai
                   ` (2 preceding siblings ...)
  2023-07-25  7:46 ` Alexandre Ghiti
@ 2023-08-03 14:45 ` Palmer Dabbelt
  2023-08-03 15:10 ` patchwork-bot+linux-riscv
  4 siblings, 0 replies; 7+ messages in thread
From: Palmer Dabbelt @ 2023-08-03 14:45 UTC (permalink / raw)
  To: bhe, vgoyal, dyoung, corbet, Paul Walmsley, Palmer Dabbelt, aou,
	xianting.tian, anup, robh, ajones, alexghiti, Conor Dooley,
	Song Shuai
  Cc: kexec, linux-doc, linux-kernel, linux-riscv


On Mon, 24 Jul 2023 18:09:16 +0800, Song Shuai wrote:
> Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use
> PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base
> from the physical start of the kernel to the actual start of the DRAM.
> 
> The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr
> to translate kernel virtual address, that failed the Crash with Linux v6.4 [1].
> 
> [...]

Applied, thanks!

[1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
      https://git.kernel.org/palmer/c/fbe7d19d2b7f
[2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64
      https://git.kernel.org/palmer/c/640c503d7dbd

Best regards,
-- 
Palmer Dabbelt <palmer@rivosinc.com>


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
  2023-07-24 10:09 [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Song Shuai
                   ` (3 preceding siblings ...)
  2023-08-03 14:45 ` Palmer Dabbelt
@ 2023-08-03 15:10 ` patchwork-bot+linux-riscv
  4 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+linux-riscv @ 2023-08-03 15:10 UTC (permalink / raw)
  To: Song Shuai
  Cc: linux-riscv, bhe, vgoyal, dyoung, corbet, paul.walmsley, palmer,
	aou, xianting.tian, anup, robh, ajones, alexghiti, conor.dooley,
	kexec, linux-doc, linux-kernel

Hello:

This series was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Mon, 24 Jul 2023 18:09:16 +0800 you wrote:
> Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use
> PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base
> from the physical start of the kernel to the actual start of the DRAM.
> 
> The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr
> to translate kernel virtual address, that failed the Crash with Linux v6.4 [1].
> 
> [...]

Here is the summary with links:
  - [RESEND,-fixes,1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
    https://git.kernel.org/riscv/c/fbe7d19d2b7f
  - [RESEND,-fixes,2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64
    https://git.kernel.org/riscv/c/640c503d7dbd

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-03 15:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 10:09 [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Song Shuai
2023-07-24 10:09 ` [RESEND PATCH -fixes 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 Song Shuai
2023-07-25  7:48   ` Alexandre Ghiti
2023-07-25  1:52 ` [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Xianting Tian
2023-07-25  7:46 ` Alexandre Ghiti
2023-08-03 14:45 ` Palmer Dabbelt
2023-08-03 15:10 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox