From owner-svn-src-all@FreeBSD.ORG Sat Aug 6 03:40:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED671065672; Sat, 6 Aug 2011 03:40:34 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E7C88FC08; Sat, 6 Aug 2011 03:40:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p763eYPA033351; Sat, 6 Aug 2011 03:40:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p763eXAs033349; Sat, 6 Aug 2011 03:40:34 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108060340.p763eXAs033349@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 6 Aug 2011 03:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224668 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 03:40:34 -0000 Author: marcel Date: Sat Aug 6 03:40:33 2011 New Revision: 224668 URL: http://svn.freebsd.org/changeset/base/224668 Log: Fix kernel core dumps now that the kernel is using PBVM. The basic problem to solve is that we don't have a fixed mapping from kernel text to physical address so that libkvm can bootstrap itself. We solve this by passing the physical address of the bootinfo structure to the consumer as the entry point of the core file. This way, libkvm can extract the PBVM page table information and locate the kernel in the core file. We also need to dump memory chunks of type loader data, because those hold the kernel and the PBVM page table (among other things). Approved by: re (blanket) Modified: head/sys/ia64/ia64/dump_machdep.c Modified: head/sys/ia64/ia64/dump_machdep.c ============================================================================== --- head/sys/ia64/ia64/dump_machdep.c Sat Aug 6 00:45:33 2011 (r224667) +++ head/sys/ia64/ia64/dump_machdep.c Sat Aug 6 03:40:33 2011 (r224668) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #include #include @@ -191,7 +192,8 @@ foreach_chunk(callback_t cb, void *arg) seqnr = 0; mdp = efi_md_first(); while (mdp != NULL) { - if (mdp->md_type == EFI_MD_TYPE_FREE) { + if (mdp->md_type == EFI_MD_TYPE_FREE || + mdp->md_type == EFI_MD_TYPE_DATA) { error = (*cb)(mdp, seqnr++, arg); if (error) return (-error); @@ -225,6 +227,7 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; ehdr.e_machine = EM_IA_64; + ehdr.e_entry = ia64_tpa((uintptr_t)bootinfo); ehdr.e_phoff = sizeof(ehdr); ehdr.e_flags = EF_IA_64_ABSOLUTE; /* XXX misuse? */ ehdr.e_ehsize = sizeof(ehdr);