Hi Bob,
Thank you for the great report.
2007/03/14 08:40:16 +0530, Vivek Goyal <vgoyal(a)in.ibm.com> wrote:
> =====================================
> Can ELF Dumpfiles Solve This Problem?
> =====================================
>
> To achieve correctness with ELF dumpfiles, one could perhaps remap the
> four types of pages to the three types of ELF representations so that
> "A) Not In The Address Space" and "B) Excluded Type" were both
mapped
> to "1) Not In The Address Space". Then "C) Zero Content" would
map
> to "2) Not In The File, Zero Fill". You would lose the ability to
> know if a page were missing because it was never in the address space
> in the first place, or because it was excluded because of its type.
> But if you read a zero, you'd know it really was a zero.
>
I think this is the way to go. Why would I like to know if a page was
never present or mkdumpfile filtered it out? I think we can live with that
and lets just not create any sort of mapping for excluded pages in finally
generated ELF headers.
In the above way, I worry that the crash utility cannot get the
relocatable information (machdep->machspec->phys_start) on ia64.
At ia64_calc_phys_start(), the crash utility gets phdr->p_paddr
of region 5 memory section as the relocatable information.
If the start of region 5 is excluded, the crash gets different
phdr->p_paddr in the above way.
2007/03/05 16:53:40 -0700, Bob Montgomery <bob.montgomery(a)hp.com> wrote:
> In the above patch, a user cannot distinguish between the
original
> unaccessable pages and the excluded pages.
> I think that the crash utility should display the warning message
> to mean "These pages are excluded by partial dump" when it accesses
> the excluded pages.
I'm not sure how to do this. I think it will require modifying memory.c
in crash to accept another type of return value from read_diskdump,
maybe?
I think that read_diskdump() should display the warning message
before returning SEEK_ERROR.
The following patch is for crash-4.0-3.20:
diff -rpuN
crash-4.0-3.20.org/defs.h crash-4.0-3.20/defs.h
---
crash-4.0-3.20.org/defs.h 2007-02-22 05:52:01.000000000 +0900
+++ crash-4.0-3.20/defs.h 2007-03-06 17:06:51.000000000 +0900
@@ -211,6 +211,7 @@ struct number_option {
#define DISKDUMP_LOCAL (0x1)
#define KDUMP_CMPRS_LOCAL (0x2)
+#define NOT_ACCESS_EXCLUDED (0x4)
#define DISKDUMP_VALID() (dd->flags & DISKDUMP_LOCAL)
#define KDUMP_CMPRS_VALID() (dd->flags & KDUMP_CMPRS_LOCAL)
diff -rpuN
crash-4.0-3.20.org/diskdump.c crash-4.0-3.20/diskdump.c
---
crash-4.0-3.20.org/diskdump.c 2007-02-22 05:52:01.000000000 +0900
+++ crash-4.0-3.20/diskdump.c 2007-03-06 17:10:11.000000000 +0900
@@ -134,6 +134,8 @@ static int read_dump_header(void)
} else if (!memcmp(header->signature, KDUMP_SIGNATURE,
sizeof(header->signature))) {
dd->flags |= KDUMP_CMPRS_LOCAL;
+ if (header->header_version >= 1)
+ dd->flags |= NOT_ACCESS_EXCLUDED;
} else {
if (CRASHDEBUG(1))
error(INFO, "diskdump: dump does not have panic dump header\n");
@@ -452,6 +454,10 @@ read_diskdump(int fd, void *bufptr, int
if ((pfn >= dd->header->max_mapnr) || !page_is_ram(pfn))
return SEEK_ERROR;
if (!page_is_dumpable(pfn)) {
+ if (dd->flags & NOT_ACCESS_EXCLUDED) {
+ error(INFO, "diskdump: cannot access paddr(%lx) due to the excluded page\n",
paddr);
+ return SEEK_ERROR;
+ }
memset(bufptr, 0, cnt);
return cnt;
}
_
Thanks
Ken'ichi Ohmichi