- Add a kvaddr_type for to represent kernel virtual addresses instead of unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles(). It drops the unused 'swapfile' argument and adds a new function pointer argument for a symbol resolving function. Native kernels still use _fdnlist() from libc to resolve symbols, but cross kernels use the supplied function.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend. Each backend is responsible for implementing kvm_read2() for a given vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for powerpc cores).
- Add internal helper routines for the common page offset hash table used by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and to be cross-friendly by using private constants instead of ones that vary by platform (e.g. PAGE_SIZE). Static assertions are present when a given backend is compiled natively to ensure the private constants match the real ones.
- Group Reviewers
- rS291406: Add support to libkvm for reading vmcores from other architectures.
- Test that native vmcores still work with the in-tree kgdb and ps. (Done for amd64 and i386)
- Test that the newer kgdb port can use the new kvm interface to debug both native and cross vmcores. (amd64 has tested amd64 and i386) (i386 has tested amd64 and i386)
- Drop uvatop. It was only present in the unused kvm_sparc.c.
- Add the KVM_ARCH() for sparc64 and a native hook.
- The conditional does need fixing, so fix it.
- Fixes from make universe.
- Fix rescue build.
- Note that libkvm now depends on libelf.
- Manually add libelf as a dependency.
|12 ↗||(On Diff #7908)|
Yes, I've reviewed it. In the new world order, only the kvm_minidump_aarch64.c file will be used and not kvm_aarch64.c since only minidumps are supported on aarch64. (MIPS is in the same boat)
|17 ↗||(On Diff #7908)|
It's just a copy of kvm_amd64.c. Probably a license sweep in libkvm is in order, but I think that is orthogonal to this.
|192 ↗||(On Diff #8374)|
There shouldn't be any trailing whitespace in new changes (I removed some prior to the last update that git had highlighted: https://github.com/bsdjhb/freebsd/commit/12f1fc0d4aa73ce92e6c22bb323e677da4f78c38)
There is some existing trailing whitespace in libkvm, but I left that alone to avoid further muddying the diff. Do you which lines git apply complained about specifically?
One open question I have that I think I want to change is to make the internal kvm_nlist always use the resolver function if it is provided and only fallback to libc's __fdnlist if there is no resolver function (and then only for native kernels). However, aside from that I have grown tired of waiting for testing and would like to get this reviewed so I can commit it.
Please remember to update .Dd on all the changed man pages. Thanks!
|74 ↗||(On Diff #9926)|
Needs a comma:
For live kernels, the
Or to avoid a sentence with a pause in it, reorganize:
.Xr kldsym 2 is used to locate the symbol for live kernels.
|84 ↗||(On Diff #9926)|
The \& should not be needed here.