Module Name:    othersrc
Committed By:   wiz
Date:           Sat Dec 24 08:18:44 UTC 2016

Modified Files:
        othersrc/usr.bin/guest2core: Makefile
Added Files:
        othersrc/usr.bin/guest2core: guest2core.8

Log Message:
Add man page for guest2core.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/usr.bin/guest2core/Makefile
cvs rdiff -u -r0 -r1.1 othersrc/usr.bin/guest2core/guest2core.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/usr.bin/guest2core/Makefile
diff -u othersrc/usr.bin/guest2core/Makefile:1.1 othersrc/usr.bin/guest2core/Makefile:1.2
--- othersrc/usr.bin/guest2core/Makefile:1.1	Thu Dec 22 10:31:17 2016
+++ othersrc/usr.bin/guest2core/Makefile	Sat Dec 24 08:18:44 2016
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.1 2016/12/22 10:31:17 mlelstv Exp $
+#       $NetBSD: Makefile,v 1.2 2016/12/24 08:18:44 wiz Exp $
 #       @(#)Makefile    8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
@@ -6,7 +6,7 @@
 WARNS=  3
 PROG=   guest2core
 SRCS=   main.c
-MAN=
+MAN=	guest2core.8
 
 LDADD+= -lelf
 DPADD+= ${LIBELF}

Added files:

Index: othersrc/usr.bin/guest2core/guest2core.8
diff -u /dev/null othersrc/usr.bin/guest2core/guest2core.8:1.1
--- /dev/null	Sat Dec 24 08:18:44 2016
+++ othersrc/usr.bin/guest2core/guest2core.8	Sat Dec 24 08:18:44 2016
@@ -0,0 +1,85 @@
+.\" $NetBSD: guest2core.8,v 1.1 2016/12/24 08:18:44 wiz Exp $
+.\"
+.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Thomas Klausner.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd December 24, 2016
+.Dt GUEST2CORE 8
+.Os
+.Sh NAME
+.Nm guest2core
+.Nd translate qemu guest memory dump to NetBSD kernel core file
+.Sh SYNOPSIS
+.Nm
+.Ar infile
+.Ar outfile
+.Ar ptd
+.Sh DESCRIPTION
+The
+.Nm
+program converts the output of
+.Xr qemu 1 Ap s
+.Xr dump-guest-memory 1
+command into a
+.Nx
+kernel core file for analysis by
+.Xr crash 8
+or
+.Xr gdb 1 .
+.Pp
+The x86_64 core dump needs a single parameter, the physical address
+of the PDP to find the MMU tables to translate the physical address
+core dump to virtual (KVA) addresses used by
+.Xr kvm 3 .
+This value needs to be passed to the program as argument
+.Ar ptd .
+.Pp
+The value is stored on the running guest in the kernel variable
+PDPpaddr.
+The value doesn't change between runs but between different kernels.
+.Pp
+You can get the value either from
+.Xr qemu 1
+onsole by looking at the virtual memory of the guest or by attaching a
+remote
+.Xr gdb 1
+to
+.Xr qemu 1 .
+In either case you need an unstripped version of the guest kernel to
+find the virtual address of PDPpaddr.
+.Sh SEE ALSO
+.Xr gdb 1 ,
+.Xr qemu 1 ,
+.Xr crash 8
+.Sh HISTORY
+.Nm
+was written by
+.An Michael van Elst Aq Mt mlel...@netbsd.org .
+.Sh BUGS
+So far,
+.Nm
+is for x86_64 only.

Reply via email to