git: kernel - Fix kernel minidumps

Matthew Dillon dillon at
Wed Jan 31 16:23:42 PST 2018

commit d30a28dd7601e7f9501f48a27ebc603ebf097415
Author: Matthew Dillon <dillon at>
Date:   Wed Jan 31 16:12:04 2018 -0800

    kernel - Fix kernel minidumps
    * Refactor minidumps.  Fix an overflows due to KVM now being 8TB, fix
      improper pdp[] array calculations (cropped up when we want to > 1 PML4e
      entry for the kernel), and refactor the page table entry handling code
      to improve efficiency and reduce the dump size.
      If we had kept the original pte mapping in the minidump it would have
      required ~16GB of disk space JUST to hold a pte array that is mostly 0's.
      Now it only requires ~2MB.
      Dumping performance is improved because the page table array is primarily
      flushed to storage in 4KB block sizes, and now only 2MB or so is written
      out in this manner.
    * minidump now dumps the PDP array of PD entries (representing 1GB each)
      for the entire system VA space (user and kernel) - 256TB.  This requires
      512*512*8 = 2MB of storage.
      PD pages and PT pages are no longer linearized into an array in the
      minidump.  Instead, their physical addresses are included in the dump
      map and libkvm accesses the PTEs through the physical map.
      NOTE: Only kernel memory proper is actually populated at this time, but
      this leaves the door open for e.g. dumping more information without having
      to change the minidump format again.
    * Revamp the minidump header, magic string, and version to address the new
      reality.  libkvm should still be able to recognize the old minidump
      format, as well as now the new one.
    Reminded-by: everyone

Summary of changes:
 lib/libkvm/kvm_minidump_x86_64.c            | 236 ++++++++++++++++++++++++----
 sys/platform/pc64/include/md_var.h          |   2 +-
 sys/platform/pc64/include/minidump.h        |  24 ++-
 sys/platform/pc64/include/vmparam.h         |   1 +
 sys/platform/pc64/x86_64/minidump_machdep.c | 168 ++++++++++++--------
 5 files changed, 327 insertions(+), 104 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list