svn commit: r224668 - head/sys/ia64/ia64
Marcel Moolenaar
marcel at FreeBSD.org
Sat Aug 6 03:40:34 UTC 2011
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 <vm/vm.h>
#include <vm/pmap.h>
+#include <machine/bootinfo.h>
#include <machine/efi.h>
#include <machine/elf.h>
#include <machine/md_var.h>
@@ -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);
More information about the svn-src-all
mailing list