Page MenuHomeFreeBSD

[PPC64] Initial libkvm minidump implementation
ClosedPublic

Authored by luporl on Sep 6 2019, 6:48 PM.
Referenced Files
F103405850: D21555.id62795.diff
Sun, Nov 24, 2:36 PM
Unknown Object (File)
Mon, Nov 18, 1:24 PM
Unknown Object (File)
Mon, Nov 18, 1:24 PM
Unknown Object (File)
Mon, Nov 18, 1:20 PM
Unknown Object (File)
Mon, Nov 18, 1:02 PM
Unknown Object (File)
Thu, Nov 7, 7:46 AM
Unknown Object (File)
Wed, Nov 6, 4:31 PM
Unknown Object (File)
Oct 25 2024, 4:13 PM
Subscribers

Details

Summary

This change adds PowerPC64 support for minidumps on libkvm.

Address translation, page walk, and data retrieval were tested and seem to be working correctly.

This enables crashinfo to start gathering information about a kernel minidump, although there are still several issues, but most seem to be related to missing pages in the kernel minidump.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26810
Build 25144: arc lint + arc unit

Event Timeline

mhorne added inline comments.
lib/libkvm/kvm_minidump_powerpc64.c
4

You can remove my copyright from this since it is only really for the RISC-V specific bits.

lib/libkvm/kvm_private.c
135 ↗(On Diff #61752)

Maybe we can also add EM_PPC to this, since 32-bit powerpc kernels are ET_DYN. A separate change. But, maybe this change itself can be isolated to a different diff, and committed as adding powerpc* support to the probe function?

  • Address reviews' comments

_kvm_probe_elf_kernel() change was moved to a separate change

luporl added inline comments.
lib/libkvm/kvm_minidump_powerpc64.c
4

Ok, thanks.

  • [PPC64] Handle relocated kernels properly
  • Merge branch 'master' into luporl-crashdump-libkvm

This is very specific to AIM64 HPT. Can you rename it to kvm_..._hpt.c, or something, and add another key to the header to probe against for the particular pmap implementation? I'll want to add Book-E support, as well as AIM Radix when we do finally get radix stabilized.

[PPC64] libkvm minidump refactoring

Moved HPT MMU specific code to a separate file.
Each new MMU implementation is expected to implement the methods
of struct ppc64_mmu_ops.

This is very specific to AIM64 HPT. Can you rename it to kvm_..._hpt.c, or something, and add another key to the header to probe against for the particular pmap implementation? I'll want to add Book-E support, as well as AIM Radix when we do finally get radix stabilized.

I've moved the HPT MMU specific parts to kvm_minidump_powerpc64_hpt.c.
The key was added and is used to select the proper MMU implementation to use.

I didn't make this a completely different implementation of a KVM_ARCH because of the following reasons:

  • Code duplication: there is a considerable amount of code that can be shared among different PPC64 address translation schemes
  • Heavy probe: kvm probe method would need to perform several operations in order to detect the correct arch implementation. While other probe implementations simply check a few fields of kernel ELF and minidump, we would need to:
    • Allocate memory
    • Read the header from the minidump file
    • Check magic, convert and check version
    • Compare mmu_name

      In this way, the probe process would be less efficient and this would impact other architectures as well.

That's why the approach used in this change is to let the common parts in kvm_minidump_powerpc64.c and the specifics in struct ppc64_mmu_ops, that are called when necessary.

  • make kvatop handle dpcpu/vnet addresses properly
This revision is now accepted and ready to land.Dec 8 2019, 4:50 AM
This revision was automatically updated to reflect the committed changes.