powerpc: add `cur_cpu_spec` symbol to vmcoreinfo
PATCH 1/1 powerpc: add `cur_cpu_spec` symbol to vmcoreinfo
Presently, while reading a vmcore, makedumpfile uses cur_cpu_spec.mmu_features to decide whether the crashed system had RADIX MMU or not.
Currently, makedumpfile fails to get the cur_cpu_spec symbol (unless a vmlinux is passed with the -x flag to makedumpfile), and hence assigns offsets and shifts (such as pgd_offset_l4) incorrecly considering MMU to be hash MMU.
Add cur_cpu_spec symbol and offset of mmu_features in the cpu_spec struct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file
--- arch/powerpc/kexec/core.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kexec/core.c +2 -0
@@ -63,6 +63,8 @@ void arch_crash_save_vmcoreinfo(void)#ifndef CONFIG_NUMA VMCOREINFO_SYMBOL (contig_page_data);#endif +VMCOREINFO_SYMBOL (cur_cpu_spec); +VMCOREINFO_OFFSET (cpu_spec, mmu_features);#if defined(CONFIG_PPC64 ) && defined(CONFIG_SPARSEMEM_VMEMMAP )VMCOREINFO_SYMBOL (vmemmap_list);VMCOREINFO_SYMBOL (mmu_vmemmap_psize);
Signature · 1 line
2.41.0
Quoted 13 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.
Quoted 6 lines
Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux fileSigned-off-by Aditya Gupta <[email protected]>---
Thanks for the patch. With this patch applied (along with makedumpfile changes) I am able to capture vmcore against a kernel which contains commit 8dc9a0ad0c3e
- Sachin
Hello Sachin,
Quoted 17 lines · Sachin Sant
Quoted 17 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file
Quoted 8 lines
Quoted 2 lines
Signed-off-by Aditya Gupta <[email protected]>---
Thanks for the patch. With this patch applied (along with makedumpfile changes) I am able to capture vmcore against a kernel which contains commit
8dc9a0ad0c3eReported-by Sachin Sant <[email protected]>Tested-by Sachin Sant <[email protected]>
Thanks for testing this, and for providing the tags.
- Aditya Gupta
Michael Ellerman
reviewerQuoted 15 lines · Sachin Sant
Quoted 15 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file
Quoted 5 lines
Quoted 2 lines
Signed-off-by Aditya Gupta <[email protected]>---
Thanks for the patch. With this patch applied (along with makedumpfile changes) I am able to capture vmcore against a kernel which contains commit
8dc9a0ad0c3e
I can't find that commit? Was just wondering if it should be referenced in the commit message.
cheers
Quoted 20 lines · Michael Ellerman
Quoted 15 lines · Sachin Sant
Quoted 15 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Aditya Gupta <[email protected]>---
Thanks for the patch. With this patch applied (along with makedumpfile changes) I am able to capture vmcore against a kernel which contains commit
8dc9a0ad0c3eI can't find that commit? Was just wondering if it should be referenced in the commit message.
My bad, I copied that commit id from the email when I first reported this issue against linux-next.
The commit should be368a0590d954: (powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function)
Michael Ellerman
reviewerQuoted 28 lines · Sachin Sant
Quoted 18 lines · Michael Ellerman
Quoted 15 lines · Sachin Sant
Quoted 15 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux fileQuoted 9 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Aditya Gupta <[email protected]>---
Thanks for the patch. With this patch applied (along with makedumpfile changes) I am able to capture vmcore against a kernel which contains commit
8dc9a0ad0c3eI can't find that commit? Was just wondering if it should be referenced in the commit message.
Quoted 6 lines
My bad, I copied that commit id from the email when I first reported this issue against linux-next.
The commit should be
368a0590d954: (powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function)
OK thanks.
Aditya, can you please rephrase the commit message to mention how that commit broke the previous behaviour.
Also I don't know what pgd_offset_l4 is?
cheers
Hello mpe,
Quoted 32 lines · Michael Ellerman
Quoted 31 lines · Sachin Sant
Quoted 18 lines · Michael Ellerman
Quoted 15 lines · Sachin Sant
Quoted 15 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux fileQuoted 9 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Aditya Gupta <[email protected]>---
Thanks for the patch. With this patch applied (along with makedumpfile changes) I am able to capture vmcore against a kernel which contains commit
8dc9a0ad0c3eI can't find that commit? Was just wondering if it should be referenced in the commit message.
My bad, I copied that commit id from the email when I first reported this issue against linux-next.
Quoted 8 lines
Quoted 3 lines
The commit should be
368a0590d954: (powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function)OK thanks.
Aditya, can you please rephrase the commit message to mention how that commit broke the previous behaviour.
Offsets were being wrongly assigned, in makedumpfile, in Radix MMU case (unless -x vmlinux was passed to makedumpfile, which generally isn't the case)
That was happening even before the '368a0590d954' commit mentioned, it's just that we hit the issue now, since with above commit, we needed to use those offsets for page traversal, in makedumpfile. And those offsets were incorrecly assigned, and hence page traversal failed.
For the offsets/shifts to be correctly assigned in makedumpfile, cur_cpu_spec.mmu_features needs to be exported in VMCOREINFO by kernel.
Quoted 2 lines
Also I don't know what
pgd_offset_l4is?
Sure, I will try to explain with more context in commit description in next version, or directly mention the particular shifts that was wrong.
In makedumpfile, it is the offset of pgdir from the kernel pgd, for a given virtual address
It is same as what the pgd_index function returns, in the powerpc kernel source.
Quoted 2 lines
cheers
Thanks
Michael Ellerman
reviewerQuoted 4 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.
Quoted 8 lines
Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file
This looks fine.
Seems like cpu_features would be needed or at least pretty useful too?
cheers
Quoted 10 lines · Michael Ellerman
Quoted 9 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.
Quoted 7 lines
Quoted 3 lines
Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux fileThis looks fine.
Seems like
cpu_featureswould be needed or at least pretty useful too?
Yeah. Would be nice to have access to that, to accurately identify the kind of system vmcore was generated for.
Thanks
Hari
Quoted 14 lines · Michael Ellerman
Quoted 4 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Quoted 8 lines
Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file
Quoted 5 lines
This looks fine.
Seems like
cpu_featureswould be needed or at least pretty useful too?cheers
Sure, that can be added too, to the vmcoreinfo. Not sure if it's used now, but sure it can help to identify features in makedumpfile.
Will add it, in next version.
Thanks
- Aditya Gupta
Michael Ellerman
reviewerQuoted 17 lines · Aditya Gupta
Quoted 16 lines · Michael Ellerman
Quoted 4 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Quoted 8 lines
Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux fileThis looks fine.
Quoted 8 lines
Quoted 3 lines
Seems like
cpu_featureswould be needed or at least pretty useful too?cheers
Sure, that can be added too, to the vmcoreinfo. Not sure if it's used now, but sure it can help to identify features in makedumpfile.
Will add it, in next version.
Please do it in a separate commit to the mmu_features :)
cheers
Quoted 22 lines · Michael Ellerman
Quoted 21 lines · Aditya Gupta
Quoted 19 lines · Michael Ellerman
Quoted 4 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Quoted 8 lines
Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.Add
cur_cpu_specsymbol and offset ofmmu_featuresin thecpu_specstruct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux fileThis looks fine.
Seems like
cpu_featureswould be needed or at least pretty useful too?cheers
Quoted 8 lines
Quoted 4 lines
Sure, that can be added too, to the vmcoreinfo. Not sure if it's used now, but sure it can help to identify features in makedumpfile.
Will add it, in next version.
Please do it in a separate commit to the
mmu_features:)cheers
Sure, have done it in a separate patch in V2.
Thanks
Michael Ellerman
AppliedQuoted 10 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.[...]
Applied to powerpc/next.
[1/1] powerpc: add cur_cpu_spec symbol to vmcoreinfo
https://git.kernel.org/powerpc/c/7135b921b32966d7602ede396b7286d372aee63f
cheers
Quoted 10 lines · Michael Ellerman
Quoted 9 lines · Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses
cur_cpu_spec.mmu_featuresto decide whether the crashed system had RADIX MMU or not.Currently, makedumpfile fails to get the
cur_cpu_specsymbol (unless a vmlinux is passed with the-xflag to makedumpfile), and hence assigns offsets and shifts (such aspgd_offset_l4) incorrecly considering MMU to be hash MMU.
Quoted 8 lines
Quoted 1 line
[...]
Applied to powerpc/next.
[1/1] powerpc: add
cur_cpu_specsymbol to vmcoreinfohttps://git.kernel.org/powerpc/c/7135b921b32966d7602ede396b7286d372aee63fcheers
Thanks for the update