Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   Avoid dump_mem_map when there is no page (http://www.linux-archive.org/crash-utility/635257-avoid-dump_mem_map-when-there-no-page.html)

"Suzuki K. Poulose" 02-20-2012 10:08 AM

Avoid dump_mem_map when there is no page
 
Physical address regions above the System RAM size doesn't
have associated page descriptors. In such cases we shouldn't
invoke dump_mem_map().


After the patch :

crash> vtop d1002000
VIRTUAL PHYSICAL
d1002000 20ec00000

PAGE DIRECTORY: c0578000
PGD: c0579a20 => c784b000
PMD: c784b000 => c784b010
PTE: c784b010 => 20ec0051b
PAGE: 20ec00000

PTE PHYSICAL FLAGS
20ec0051b 20ec00000 (PRESENT|USER|GUARDED|COHERENT|ACCESSED)

crash>

Signed-off-by: Dave Anderson <anderson@redhat.com>
Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
---

memory.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/memory.c b/memory.c
index 55a184b..84ae1b5 100755
--- a/memory.c
+++ b/memory.c
@@ -2796,7 +2796,7 @@ void
do_vtop(ulong vaddr, struct task_context *tc, ulong vtop_flags)
{
physaddr_t paddr;
- ulong vma;
+ ulong vma, page;
int page_exists;
struct meminfo meminfo;
char buf1[BUFSIZE];
@@ -2930,7 +2930,7 @@ do_vtop(ulong vaddr, struct task_context *tc, ulong vtop_flags)

fprintf(fp, "
");

- if (page_exists) {
+ if (page_exists && phys_to_page(paddr, &page)) {
if ((pc->flags & DEVMEM) && (paddr >= VTOP(vt->high_memory)))
return;
BZERO(&meminfo, sizeof(struct meminfo));

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 02:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.