* [PATCH] ppc64: add mmu information to vmcoreinfo
@ 2023-10-23 7:26 Aditya Gupta
2023-10-27 9:59 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Aditya Gupta @ 2023-10-23 7:26 UTC (permalink / raw)
To: linuxppc-dev, mpe
Cc: Sachin Sant, Sourabh Jain, Mahesh J Salgaonkar, Hari Bathini,
Aneesh Kumar K.V
Since below commit, address mapping for vmemmap has changed for Radix
MMU, where address mapping is stored in kernel page table itself,
instead of earlier used 'vmemmap_list'.
commit 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use
a different vmemmap handling function")
Hence with upstream kernel, in case of Radix MMU, makedumpfile fails to do
address translation for vmemmap addresses, as it depended on vmemmap_list,
which can now be empty.
While fixing the address translation in makedumpfile, it was identified
that currently makedumpfile cannot distinguish between Hash MMU and
Radix MMU, unless VMLINUX is passed with -x flag to makedumpfile.
And hence fails to assign offsets and shifts correctly (such as in L4 to
PGDIR offset calculation in makedumpfile).
For getting the MMU, makedumpfile uses `cur_cpu_spec.mmu_features`.
Add `cur_cpu_spec` symbol and offset of `mmu_features` in the
`cpu_spec` struct, to VMCOREINFO, so that makedumpfile can assign the
offsets correctly, without needing a VMLINUX.
Also, even along with `cur_cpu_spec->mmu_features` makedumpfile has to
depend on the 'MMU_FTR_TYPE_RADIX' flag in mmu_features, implying kernel
developers need to be cautious of changes to 'MMU_FTR_*' defines.
A more stable approach was suggested in the below thread by contributors:
https://lore.kernel.org/linuxppc-dev/20230920105706.853626-1-adityag@linux.ibm.com/
The suggestion was to add whether 'RADIX_MMU' is enabled in vmcoreinfo
This patch also implements the suggestion, by adding 'RADIX_MMU' in
vmcoreinfo, which makedumpfile can use to get whether the crashed system
had RADIX MMU (in which case 'NUMBER(RADIX_MMU)=1') or not (in which
case 'NUMBER(RADIX_MMU)=0')
Fixes: 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function")
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
arch/powerpc/kexec/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kexec/core.c b/arch/powerpc/kexec/core.c
index de64c7962991..005269ac3244 100644
--- a/arch/powerpc/kexec/core.c
+++ b/arch/powerpc/kexec/core.c
@@ -74,6 +74,9 @@ void arch_crash_save_vmcoreinfo(void)
VMCOREINFO_STRUCT_SIZE(mmu_psize_def);
VMCOREINFO_OFFSET(mmu_psize_def, shift);
#endif
+ VMCOREINFO_SYMBOL(cur_cpu_spec);
+ VMCOREINFO_OFFSET(cpu_spec, mmu_features);
+ vmcoreinfo_append_str("NUMBER(RADIX_MMU)=%d\n", early_radix_enabled());
vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
}
--
2.41.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc64: add mmu information to vmcoreinfo
2023-10-23 7:26 [PATCH] ppc64: add mmu information to vmcoreinfo Aditya Gupta
@ 2023-10-27 9:59 ` Michael Ellerman
2023-10-27 17:51 ` Aditya Gupta
2023-10-27 18:11 ` Aditya Gupta
0 siblings, 2 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-10-27 9:59 UTC (permalink / raw)
To: linuxppc-dev, Aditya Gupta
Cc: Hari Bathini, Aneesh Kumar K.V, Sourabh Jain, Sachin Sant,
Mahesh J Salgaonkar
On Mon, 23 Oct 2023 12:56:12 +0530, Aditya Gupta wrote:
> Since below commit, address mapping for vmemmap has changed for Radix
> MMU, where address mapping is stored in kernel page table itself,
> instead of earlier used 'vmemmap_list'.
>
> commit 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use
> a different vmemmap handling function")
>
> [...]
Applied to powerpc/next.
[1/1] ppc64: add mmu information to vmcoreinfo
https://git.kernel.org/powerpc/c/36e826b568e412f61d68fedc02a67b4d8b7583cc
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc64: add mmu information to vmcoreinfo
2023-10-27 9:59 ` Michael Ellerman
@ 2023-10-27 17:51 ` Aditya Gupta
2023-10-27 18:11 ` Aditya Gupta
1 sibling, 0 replies; 4+ messages in thread
From: Aditya Gupta @ 2023-10-27 17:51 UTC (permalink / raw)
To: Michael Ellerman
Cc: Aneesh Kumar K.V, Mahesh J Salgaonkar, Sourabh Jain, linuxppc-dev,
Sachin Sant, Hari Bathini
On Fri, Oct 27, 2023 at 08:59:56PM +1100, Michael Ellerman wrote:
> On Mon, 23 Oct 2023 12:56:12 +0530, Aditya Gupta wrote:
> > Since below commit, address mapping for vmemmap has changed for Radix
> > MMU, where address mapping is stored in kernel page table itself,
> > instead of earlier used 'vmemmap_list'.
> >
> > commit 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use
> > a different vmemmap handling function")
> >
> > [...]
>
> Applied to powerpc/next.
>
> [1/1] ppc64: add mmu information to vmcoreinfo
> https://git.kernel.org/powerpc/c/36e826b568e412f61d68fedc02a67b4d8b7583cc
>
> cheers
Thank you for the update.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc64: add mmu information to vmcoreinfo
2023-10-27 9:59 ` Michael Ellerman
2023-10-27 17:51 ` Aditya Gupta
@ 2023-10-27 18:11 ` Aditya Gupta
1 sibling, 0 replies; 4+ messages in thread
From: Aditya Gupta @ 2023-10-27 18:11 UTC (permalink / raw)
To: Michael Ellerman
Cc: Aneesh Kumar K.V, Mahesh J Salgaonkar, Sourabh Jain, linuxppc-dev,
Sachin Sant, Hari Bathini
On Fri, Oct 27, 2023 at 08:59:56PM +1100, Michael Ellerman wrote:
> On Mon, 23 Oct 2023 12:56:12 +0530, Aditya Gupta wrote:
> > Since below commit, address mapping for vmemmap has changed for Radix
> > MMU, where address mapping is stored in kernel page table itself,
> > instead of earlier used 'vmemmap_list'.
> >
> > commit 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use
> > a different vmemmap handling function")
> >
> > [...]
>
> Applied to powerpc/next.
>
> [1/1] ppc64: add mmu information to vmcoreinfo
> https://git.kernel.org/powerpc/c/36e826b568e412f61d68fedc02a67b4d8b7583cc
>
> cheers
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-27 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 7:26 [PATCH] ppc64: add mmu information to vmcoreinfo Aditya Gupta
2023-10-27 9:59 ` Michael Ellerman
2023-10-27 17:51 ` Aditya Gupta
2023-10-27 18:11 ` Aditya Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).