diff options
author | marcel <marcel@FreeBSD.org> | 2011-08-06 03:40:33 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2011-08-06 03:40:33 +0000 |
commit | 74b9549a99508a2d26f5e37d1beb844aae7d612f (patch) | |
tree | cf3032bc6093879f803c5ce4a1391396941e0d40 | |
parent | 729191f841b21f040585b9ff3eb717cce0b52b76 (diff) | |
download | FreeBSD-src-74b9549a99508a2d26f5e37d1beb844aae7d612f.zip FreeBSD-src-74b9549a99508a2d26f5e37d1beb844aae7d612f.tar.gz |
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)
-rw-r--r-- | sys/ia64/ia64/dump_machdep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/ia64/ia64/dump_machdep.c b/sys/ia64/ia64/dump_machdep.c index ae82c36..734acc7 100644 --- a/sys/ia64/ia64/dump_machdep.c +++ b/sys/ia64/ia64/dump_machdep.c @@ -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); |