[PATCH v2 1/6] xen: Always calculate max_cpus value
by Daniel Kiper
max_cpus is not available since 20374 changeset (Miscellaneous data
placement adjustments). It was moved to __initdata section. This section
is freed after Xen initialization. Assume that max_cpus is always
equal to XEN_HYPER_SIZE(cpumask_t) * 8.
Signed-off-by: Daniel Kiper <daniel.kiper(a)oracle.com>
diff -Npru crash-6.0.8.orig/xen_hyper.c crash-6.0.8/xen_hyper.c
--- crash-6.0.8.orig/xen_hyper.c 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/xen_hyper.c 2012-07-05 14:52:59.000000000 +0200
@@ -1879,11 +1879,9 @@ xen_hyper_get_cpu_info(void)
uint *cpu_idx;
int i, j, cpus;
- get_symbol_data("max_cpus", sizeof(xht->max_cpus), &xht->max_cpus);
XEN_HYPER_STRUCT_SIZE_INIT(cpumask_t, "cpumask_t");
- if (XEN_HYPER_SIZE(cpumask_t) * 8 > xht->max_cpus) {
- xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
- }
+ xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+
if (xht->cpumask) {
free(xht->cpumask);
}
12 years, 4 months
Patch to fix Seg Violation in parse_for_member
by Bob Montgomery
If you change the
fprintf(pc->saved_fp, buf);
lines to
print_verbatim(pc->saved_fp, buf);
Then I won't get:
crash> sk_buff.head ffff88012014dc80
Segmentation fault
When I need to get:
crash> sk_buff.head ffff88012014dc80
head = 0xffff880121267000 "\"%s %s %s\", got type \"%s\""
Patch attached (6.0.8).
I suspect performance will suffer a bit when I try to print
2 million of these...
Thanks,
Bob Montgomery
12 years, 4 months
[PATCH v2 6/6] xen: Add support for 3 level P2M tree
by Daniel Kiper
Linux Kernel commit 58e05027b530ff081ecea68e38de8d59db8f87e0 (xen: convert
p2m to a 3 level tree) introduced 3 level P2M tree. Add support for this.
Signed-off-by: Daniel Kiper <daniel.kiper(a)oracle.com>
diff -Npru crash-6.0.8.orig/defs.h crash-6.0.8/defs.h
--- crash-6.0.8.orig/defs.h 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/defs.h 2012-08-06 23:32:31.000000000 +0200
@@ -595,6 +595,10 @@ struct new_utsname {
#define XEN_MACHADDR_NOT_FOUND (~0ULL)
+#define XEN_P2M_PER_PAGE (PAGESIZE() / sizeof(unsigned long))
+#define XEN_P2M_MID_PER_PAGE (PAGESIZE() / sizeof(unsigned long *))
+#define XEN_P2M_TOP_PER_PAGE (PAGESIZE() / sizeof(unsigned long **))
+
struct kernel_table { /* kernel data */
ulong flags;
ulong stext;
@@ -655,6 +659,7 @@ struct kernel_table {
struct pvops_xen_info {
int p2m_top_entries;
ulong p2m_top;
+ ulong p2m_mid_missing;
ulong p2m_missing;
} pvops_xen;
int highest_irq;
diff -Npru crash-6.0.8.orig/kernel.c crash-6.0.8/kernel.c
--- crash-6.0.8.orig/kernel.c 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/kernel.c 2012-08-07 13:44:12.000000000 +0200
@@ -49,6 +49,8 @@ static void verify_namelist(void);
static char *debug_kernel_version(char *);
static int restore_stack(struct bt_info *);
static ulong __xen_m2p(ulonglong, ulong);
+static ulong __xen_pvops_m2p_l2(ulonglong, ulong);
+static ulong __xen_pvops_m2p_l3(ulonglong, ulong);
static int search_mapping_page(ulong, ulong *, ulong *, ulong *);
static void read_in_kernel_config_err(int, char *);
static void BUG_bytes_init(void);
@@ -147,9 +149,19 @@ kernel_init()
if ((kt->m2p_page = (char *)malloc(PAGESIZE())) == NULL)
error(FATAL, "cannot malloc m2p page.");
- kt->pvops_xen.p2m_top_entries = get_array_length("p2m_top", NULL, 0);
- kt->pvops_xen.p2m_top = symbol_value("p2m_top");
- kt->pvops_xen.p2m_missing = symbol_value("p2m_missing");
+ if (symbol_exists("p2m_mid_missing")) {
+ kt->pvops_xen.p2m_top_entries = XEN_P2M_TOP_PER_PAGE;
+ get_symbol_data("p2m_top", sizeof(ulong),
+ &kt->pvops_xen.p2m_top);
+ get_symbol_data("p2m_mid_missing", sizeof(ulong),
+ &kt->pvops_xen.p2m_mid_missing);
+ get_symbol_data("p2m_missing", sizeof(ulong),
+ &kt->pvops_xen.p2m_missing);
+ } else {
+ kt->pvops_xen.p2m_top_entries = get_array_length("p2m_top", NULL, 0);
+ kt->pvops_xen.p2m_top = symbol_value("p2m_top");
+ kt->pvops_xen.p2m_missing = symbol_value("p2m_missing");
+ }
}
if (symbol_exists("smp_num_cpus")) {
@@ -5044,6 +5056,8 @@ no_cpu_flags:
fprintf(fp, " pvops_xen:\n");
fprintf(fp, " p2m_top: %lx\n", kt->pvops_xen.p2m_top);
fprintf(fp, " p2m_top_entries: %d\n", kt->pvops_xen.p2m_top_entries);
+ if (symbol_exists("p2m_mid_missing"))
+ fprintf(fp, " p2m_mid_missing: %lx\n", kt->pvops_xen.p2m_mid_missing);
fprintf(fp, " p2m_missing: %lx\n", kt->pvops_xen.p2m_missing);
}
@@ -7391,15 +7405,9 @@ xen_m2p(ulonglong machine)
static ulong
__xen_m2p(ulonglong machine, ulong mfn)
{
- ulong mapping, p2m, kmfn, pfn, p, i, e, c;
+ ulong c, i, kmfn, mapping, p, pfn;
ulong start, end;
- ulong *mp;
-
- mp = (ulong *)kt->m2p_page;
- if (PVOPS_XEN())
- mapping = UNINITIALIZED;
- else
- mapping = kt->phys_to_machine_mapping;
+ ulong *mp = (ulong *)kt->m2p_page;
/*
* Check the FIFO cache first.
@@ -7449,55 +7457,21 @@ __xen_m2p(ulonglong machine, ulong mfn)
* beginning of the p2m_top array, caching the contiguous
* range containing the found machine address.
*/
- for (e = p = 0, p2m = kt->pvops_xen.p2m_top;
- e < kt->pvops_xen.p2m_top_entries;
- e++, p += XEN_PFNS_PER_PAGE, p2m += sizeof(void *)) {
-
- if (!readmem(p2m, KVADDR, &mapping,
- sizeof(void *), "p2m_top", RETURN_ON_ERROR))
- error(FATAL, "cannot access p2m_top[] entry\n");
-
- if (mapping != kt->last_mapping_read) {
- if (mapping != kt->pvops_xen.p2m_missing) {
- if (!readmem(mapping, KVADDR, mp,
- PAGESIZE(), "p2m_top page",
- RETURN_ON_ERROR))
- error(FATAL,
- "cannot access "
- "p2m_top[] page\n");
- kt->last_mapping_read = mapping;
- }
- }
-
- if (mapping == kt->pvops_xen.p2m_missing)
- continue;
-
- kt->p2m_pages_searched++;
+ if (symbol_exists("p2m_mid_missing"))
+ pfn = __xen_pvops_m2p_l3(machine, mfn);
+ else
+ pfn = __xen_pvops_m2p_l2(machine, mfn);
- if (search_mapping_page(mfn, &i, &start, &end)) {
- pfn = p + i;
- if (CRASHDEBUG(1))
- console("pages: %d mfn: %lx (%llx) p: %ld"
- " i: %ld pfn: %lx (%llx)\n",
- (p/XEN_PFNS_PER_PAGE)+1, mfn, machine,
- p, i, pfn, XEN_PFN_TO_PSEUDO(pfn));
-
- c = kt->p2m_cache_index;
- kt->p2m_mapping_cache[c].start = start;
- kt->p2m_mapping_cache[c].end = end;
- kt->p2m_mapping_cache[c].mapping = mapping;
- kt->p2m_mapping_cache[c].pfn = p;
- kt->p2m_cache_index = (c+1) % P2M_MAPPING_CACHE;
-
- return pfn;
- }
- }
+ if (pfn != XEN_MFN_NOT_FOUND)
+ return pfn;
} else {
/*
* The machine address was not cached, so search from the
* beginning of the phys_to_machine_mapping array, caching
* the contiguous range containing the found machine address.
*/
+ mapping = kt->phys_to_machine_mapping;
+
for (p = 0; p < kt->p2m_table_size; p += XEN_PFNS_PER_PAGE)
{
if (mapping != kt->last_mapping_read) {
@@ -7540,6 +7514,115 @@ __xen_m2p(ulonglong machine, ulong mfn)
return (XEN_MFN_NOT_FOUND);
}
+static ulong
+__xen_pvops_m2p_l2(ulonglong machine, ulong mfn)
+{
+ ulong c, e, end, i, mapping, p, p2m, pfn, start;
+
+ for (e = p = 0, p2m = kt->pvops_xen.p2m_top;
+ e < kt->pvops_xen.p2m_top_entries;
+ e++, p += XEN_PFNS_PER_PAGE, p2m += sizeof(void *)) {
+
+ if (!readmem(p2m, KVADDR, &mapping, sizeof(void *),
+ "p2m_top", RETURN_ON_ERROR))
+ error(FATAL, "cannot access p2m_top[] entry\n");
+
+ if (mapping == kt->pvops_xen.p2m_missing)
+ continue;
+
+ if (mapping != kt->last_mapping_read) {
+ if (!readmem(mapping, KVADDR, (void *)kt->m2p_page,
+ PAGESIZE(), "p2m_top page", RETURN_ON_ERROR))
+ error(FATAL, "cannot access p2m_top[] page\n");
+
+ kt->last_mapping_read = mapping;
+ }
+
+ kt->p2m_pages_searched++;
+
+ if (search_mapping_page(mfn, &i, &start, &end)) {
+ pfn = p + i;
+ if (CRASHDEBUG(1))
+ console("pages: %d mfn: %lx (%llx) p: %ld"
+ " i: %ld pfn: %lx (%llx)\n",
+ (p/XEN_PFNS_PER_PAGE)+1, mfn, machine,
+ p, i, pfn, XEN_PFN_TO_PSEUDO(pfn));
+
+ c = kt->p2m_cache_index;
+ kt->p2m_mapping_cache[c].start = start;
+ kt->p2m_mapping_cache[c].end = end;
+ kt->p2m_mapping_cache[c].mapping = mapping;
+ kt->p2m_mapping_cache[c].pfn = p;
+ kt->p2m_cache_index = (c+1) % P2M_MAPPING_CACHE;
+
+ return pfn;
+ }
+ }
+
+ return XEN_MFN_NOT_FOUND;
+}
+
+static ulong
+__xen_pvops_m2p_l3(ulonglong machine, ulong mfn)
+{
+ ulong c, end, i, j, k, mapping, p;
+ ulong p2m_mid, p2m_top, pfn, start;
+
+ p2m_top = kt->pvops_xen.p2m_top;
+
+ for (i = 0; i < XEN_P2M_TOP_PER_PAGE; ++i, p2m_top += sizeof(void *)) {
+ if (!readmem(p2m_top, KVADDR, &mapping,
+ sizeof(void *), "p2m_top", RETURN_ON_ERROR))
+ error(FATAL, "cannot access p2m_top[] entry\n");
+
+ if (mapping == kt->pvops_xen.p2m_mid_missing)
+ continue;
+
+ p2m_mid = mapping;
+
+ for (j = 0; j < XEN_P2M_MID_PER_PAGE; ++j, p2m_mid += sizeof(void *)) {
+ if (!readmem(p2m_mid, KVADDR, &mapping,
+ sizeof(void *), "p2m_mid", RETURN_ON_ERROR))
+ error(FATAL, "cannot access p2m_mid[] entry\n");
+
+ if (mapping == kt->pvops_xen.p2m_missing)
+ continue;
+
+ if (mapping != kt->last_mapping_read) {
+ if (!readmem(mapping, KVADDR, (void *)kt->m2p_page,
+ PAGESIZE(), "p2m_mid page", RETURN_ON_ERROR))
+ error(FATAL, "cannot access p2m_mid[] page\n");
+
+ kt->last_mapping_read = mapping;
+ }
+
+ if (!search_mapping_page(mfn, &k, &start, &end))
+ continue;
+
+ p = i * XEN_P2M_MID_PER_PAGE * XEN_P2M_PER_PAGE;
+ p += j * XEN_P2M_PER_PAGE;
+ pfn = p + k;
+
+ if (CRASHDEBUG(1))
+ console("pages: %d mfn: %lx (%llx) p: %ld"
+ " i: %ld j: %ld k: %ld pfn: %lx (%llx)\n",
+ (p / XEN_P2M_PER_PAGE) + 1, mfn, machine,
+ p, i, j, k, pfn, XEN_PFN_TO_PSEUDO(pfn));
+
+ c = kt->p2m_cache_index;
+ kt->p2m_mapping_cache[c].start = start;
+ kt->p2m_mapping_cache[c].end = end;
+ kt->p2m_mapping_cache[c].mapping = mapping;
+ kt->p2m_mapping_cache[c].pfn = p;
+ kt->p2m_cache_index = (c + 1) % P2M_MAPPING_CACHE;
+
+ return pfn;
+ }
+ }
+
+ return XEN_MFN_NOT_FOUND;
+}
+
/*
* Search for an mfn in the current mapping page, and if found,
* determine the range of contiguous mfns that it's contained
diff -Npru crash-6.0.8.orig/x86.c crash-6.0.8/x86.c
--- crash-6.0.8.orig/x86.c 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/x86.c 2012-08-07 13:26:27.000000000 +0200
@@ -1024,6 +1024,8 @@ static void x86_init_kernel_pgd(void);
static ulong xen_m2p_nonPAE(ulong);
static int x86_xendump_p2m_create(struct xendump_data *);
static int x86_pvops_xendump_p2m_create(struct xendump_data *);
+static int x86_pvops_xendump_p2m_l2_create(struct xendump_data *);
+static int x86_pvops_xendump_p2m_l3_create(struct xendump_data *);
static void x86_debug_dump_page(FILE *, char *, char *);
static int x86_xen_kdump_p2m_create(struct xen_kdump_data *);
static char *x86_xen_kdump_load_page(ulong, char *);
@@ -4969,7 +4971,7 @@ x86_xendump_p2m_create(struct xendump_da
static int
x86_pvops_xendump_p2m_create(struct xendump_data *xd)
{
- int i, p, idx;
+ int i;
ulong mfn, kvaddr, ctrlreg[8], ctrlreg_offset;
ulong *up;
ulonglong *ulp;
@@ -5040,21 +5042,29 @@ x86_pvops_xendump_p2m_create(struct xend
malloc(xd->xc_core.p2m_frames * sizeof(int))) == NULL)
error(FATAL, "cannot malloc p2m_frame_index_list");
+ if (symbol_exists("p2m_mid_missing"))
+ return x86_pvops_xendump_p2m_l3_create(xd);
+ else
+ return x86_pvops_xendump_p2m_l2_create(xd);
+}
+
+static int x86_pvops_xendump_p2m_l2_create(struct xendump_data *xd)
+{
+ int i, idx, p;
+ ulong kvaddr, *up;
+
machdep->last_ptbl_read = BADADDR;
machdep->last_pmd_read = BADADDR;
+
kvaddr = symbol_value("p2m_top");
for (p = 0; p < xd->xc_core.p2m_frames; p += XEN_PFNS_PER_PAGE) {
if (!x86_xendump_load_page(kvaddr, xd->page))
return FALSE;
- if ((idx = x86_xendump_page_index(kvaddr)) == MFN_NOT_FOUND)
- return FALSE;
-
- if (CRASHDEBUG(7)) {
- x86_debug_dump_page(xd->ofp, xd->page,
- "contents of page:");
- }
+ if (CRASHDEBUG(7))
+ x86_debug_dump_page(xd->ofp, xd->page,
+ "contents of page:");
up = (ulong *)(xd->page);
@@ -5067,7 +5077,7 @@ x86_pvops_xendump_p2m_create(struct xend
}
kvaddr += PAGESIZE();
- }
+ }
machdep->last_ptbl_read = 0;
machdep->last_pmd_read = 0;
@@ -5075,6 +5085,94 @@ x86_pvops_xendump_p2m_create(struct xend
return TRUE;
}
+static int x86_pvops_xendump_p2m_l3_create(struct xendump_data *xd)
+{
+ int i, idx, j, p2m_frame, ret = FALSE;
+ ulong kvaddr, *p2m_mid, p2m_mid_missing, p2m_missing, *p2m_top;
+
+ machdep->last_ptbl_read = BADADDR;
+ machdep->last_pmd_read = BADADDR;
+
+ kvaddr = symbol_value("p2m_missing");
+
+ if (!x86_xendump_load_page(kvaddr, xd->page))
+ goto err;
+
+ p2m_missing = *(ulong *)(xd->page + PAGEOFFSET(kvaddr));
+
+ kvaddr = symbol_value("p2m_mid_missing");
+
+ if (!x86_xendump_load_page(kvaddr, xd->page))
+ goto err;
+
+ p2m_mid_missing = *(ulong *)(xd->page + PAGEOFFSET(kvaddr));
+
+ kvaddr = symbol_value("p2m_top");
+
+ if (!x86_xendump_load_page(kvaddr, xd->page))
+ goto err;
+
+ kvaddr = *(ulong *)(xd->page + PAGEOFFSET(kvaddr));
+
+ if (!x86_xendump_load_page(kvaddr, xd->page))
+ goto err;
+
+ if (CRASHDEBUG(7))
+ x86_debug_dump_page(xd->ofp, xd->page,
+ "contents of p2m_top page:");
+
+ p2m_top = malloc(PAGESIZE());
+
+ if (!p2m_top)
+ error(FATAL, "cannot malloc p2m_top");
+
+ memcpy(p2m_top, xd->page, PAGESIZE());
+
+ for (i = 0; i < XEN_P2M_TOP_PER_PAGE; ++i) {
+ p2m_frame = i * XEN_P2M_MID_PER_PAGE;
+
+ if (p2m_frame >= xd->xc_core.p2m_frames)
+ break;
+
+ if (p2m_top[i] == p2m_mid_missing)
+ continue;
+
+ if (!x86_xendump_load_page(p2m_top[i], xd->page))
+ goto err;
+
+ if (CRASHDEBUG(7))
+ x86_debug_dump_page(xd->ofp, xd->page,
+ "contents of p2m_mid page:");
+
+ p2m_mid = (ulong *)xd->page;
+
+ for (j = 0; j < XEN_P2M_MID_PER_PAGE; ++j, ++p2m_frame) {
+ if (p2m_frame >= xd->xc_core.p2m_frames)
+ break;
+
+ if (p2m_mid[j] == p2m_missing)
+ continue;
+
+ idx = x86_xendump_page_index(p2m_mid[j]);
+
+ if (idx == MFN_NOT_FOUND)
+ goto err;
+
+ xd->xc_core.p2m_frame_index_list[p2m_frame] = idx;
+ }
+ }
+
+ machdep->last_ptbl_read = 0;
+ machdep->last_pmd_read = 0;
+
+ ret = TRUE;
+
+err:
+ free(p2m_top);
+
+ return ret;
+}
+
static void
x86_debug_dump_page(FILE *ofp, char *page, char *name)
{
diff -Npru crash-6.0.8.orig/x86_64.c crash-6.0.8/x86_64.c
--- crash-6.0.8.orig/x86_64.c 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/x86_64.c 2012-08-07 13:32:34.000000000 +0200
@@ -91,6 +91,8 @@ static void x86_64_framepointer_init(voi
static int x86_64_virt_phys_base(void);
static int x86_64_xendump_p2m_create(struct xendump_data *);
static int x86_64_pvops_xendump_p2m_create(struct xendump_data *);
+static int x86_64_pvops_xendump_p2m_l2_create(struct xendump_data *);
+static int x86_64_pvops_xendump_p2m_l3_create(struct xendump_data *);
static char *x86_64_xendump_load_page(ulong, struct xendump_data *);
static int x86_64_xendump_page_index(ulong, struct xendump_data *);
static int x86_64_xen_kdump_p2m_create(struct xen_kdump_data *);
@@ -6078,7 +6080,7 @@ x86_64_xendump_p2m_create(struct xendump
static int
x86_64_pvops_xendump_p2m_create(struct xendump_data *xd)
{
- int i, p, idx;
+ int i;
ulong mfn, kvaddr, ctrlreg[8], ctrlreg_offset;
ulong *up;
off_t offset;
@@ -6138,20 +6140,28 @@ x86_64_pvops_xendump_p2m_create(struct x
malloc(xd->xc_core.p2m_frames * sizeof(ulong))) == NULL)
error(FATAL, "cannot malloc p2m_frame_list");
+ if (symbol_exists("p2m_mid_missing"))
+ return x86_64_pvops_xendump_p2m_l3_create(xd);
+ else
+ return x86_64_pvops_xendump_p2m_l2_create(xd);
+}
+
+static int x86_64_pvops_xendump_p2m_l2_create(struct xendump_data *xd)
+{
+ int i, idx, p;
+ ulong kvaddr, *up;
+
machdep->last_ptbl_read = BADADDR;
+
kvaddr = symbol_value("p2m_top");
for (p = 0; p < xd->xc_core.p2m_frames; p += XEN_PFNS_PER_PAGE) {
if (!x86_64_xendump_load_page(kvaddr, xd))
return FALSE;
- if ((idx = x86_64_xendump_page_index(kvaddr, xd)) == MFN_NOT_FOUND)
- return FALSE;
-
- if (CRASHDEBUG(7)) {
+ if (CRASHDEBUG(7))
x86_64_debug_dump_page(xd->ofp, xd->page,
"contents of page:");
- }
up = (ulong *)(xd->page);
@@ -6160,17 +6170,103 @@ x86_64_pvops_xendump_p2m_create(struct x
break;
if ((idx = x86_64_xendump_page_index(*up, xd)) == MFN_NOT_FOUND)
return FALSE;
- xd->xc_core.p2m_frame_index_list[p+i] = idx;
+ xd->xc_core.p2m_frame_index_list[p+i] = idx;
}
kvaddr += PAGESIZE();
}
-
+
machdep->last_ptbl_read = 0;
return TRUE;
}
+static int x86_64_pvops_xendump_p2m_l3_create(struct xendump_data *xd)
+{
+ int i, idx, j, p2m_frame, ret = FALSE;
+ ulong kvaddr, *p2m_mid, p2m_mid_missing, p2m_missing, *p2m_top;
+
+ machdep->last_ptbl_read = BADADDR;
+
+ kvaddr = symbol_value("p2m_missing");
+
+ if (!x86_64_xendump_load_page(kvaddr, xd))
+ goto err;
+
+ p2m_missing = *(ulong *)(xd->page + PAGEOFFSET(kvaddr));
+
+ kvaddr = symbol_value("p2m_mid_missing");
+
+ if (!x86_64_xendump_load_page(kvaddr, xd))
+ goto err;
+
+ p2m_mid_missing = *(ulong *)(xd->page + PAGEOFFSET(kvaddr));
+
+ kvaddr = symbol_value("p2m_top");
+
+ if (!x86_64_xendump_load_page(kvaddr, xd))
+ goto err;
+
+ kvaddr = *(ulong *)(xd->page + PAGEOFFSET(kvaddr));
+
+ if (!x86_64_xendump_load_page(kvaddr, xd))
+ goto err;
+
+ if (CRASHDEBUG(7))
+ x86_64_debug_dump_page(xd->ofp, xd->page,
+ "contents of p2m_top page:");
+
+ p2m_top = malloc(PAGESIZE());
+
+ if (!p2m_top)
+ error(FATAL, "cannot malloc p2m_top");
+
+ memcpy(p2m_top, xd->page, PAGESIZE());
+
+ for (i = 0; i < XEN_P2M_TOP_PER_PAGE; ++i) {
+ p2m_frame = i * XEN_P2M_MID_PER_PAGE;
+
+ if (p2m_frame >= xd->xc_core.p2m_frames)
+ break;
+
+ if (p2m_top[i] == p2m_mid_missing)
+ continue;
+
+ if (!x86_64_xendump_load_page(p2m_top[i], xd))
+ goto err;
+
+ if (CRASHDEBUG(7))
+ x86_64_debug_dump_page(xd->ofp, xd->page,
+ "contents of p2m_mid page:");
+
+ p2m_mid = (ulong *)xd->page;
+
+ for (j = 0; j < XEN_P2M_MID_PER_PAGE; ++j, ++p2m_frame) {
+ if (p2m_frame >= xd->xc_core.p2m_frames)
+ break;
+
+ if (p2m_mid[j] == p2m_missing)
+ continue;
+
+ idx = x86_64_xendump_page_index(p2m_mid[j], xd);
+
+ if (idx == MFN_NOT_FOUND)
+ goto err;
+
+ xd->xc_core.p2m_frame_index_list[p2m_frame] = idx;
+ }
+ }
+
+ machdep->last_ptbl_read = 0;
+
+ ret = TRUE;
+
+err:
+ free(p2m_top);
+
+ return ret;
+}
+
static void
x86_64_debug_dump_page(FILE *ofp, char *page, char *name)
{
12 years, 4 months
[PATCH v2 5/6] xen: Read data correctly from dynamically allocated console ring, too
by Daniel Kiper
console ring is dynamically allocated since 19543 changeset (New option
conring_size= to allow larger console ring). Take into account that
and read data correctly from it, too.
v2 - Dave Anderson suggestions/fixes:
- check conring type before determining its value.
Signed-off-by: Daniel Kiper <daniel.kiper(a)oracle.com>
diff -Npru crash-6.0.8.orig/xen_hyper_command.c crash-6.0.8/xen_hyper_command.c
--- crash-6.0.8.orig/xen_hyper_command.c 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/xen_hyper_command.c 2012-08-10 14:05:24.000000000 +0200
@@ -590,24 +590,35 @@ xen_hyper_dump_log(void)
ulong conring;
char *buf;
char last;
+ uint32_t conring_size;
+
+ if (get_symbol_type("conring", NULL, NULL) == TYPE_CODE_ARRAY)
+ conring = symbol_value("conring");
+ else
+ get_symbol_data("conring", sizeof(ulong), &conring);
- conring = symbol_value("conring");
get_symbol_data("conringc", sizeof(uint), &conringc);
get_symbol_data("conringp", sizeof(uint), &conringp);
+
+ if (symbol_exists("conring_size"))
+ get_symbol_data("conring_size", sizeof(uint32_t), &conring_size);
+ else
+ conring_size = XEN_HYPER_CONRING_SIZE;
+
warp = FALSE;
- if (conringp >= XEN_HYPER_CONRING_SIZE) {
- if ((start = conringp & (XEN_HYPER_CONRING_SIZE - 1))) {
+ if (conringp >= conring_size) {
+ if ((start = conringp & (conring_size - 1))) {
warp = TRUE;
}
} else {
start = 0;
}
- buf = GETBUF(XEN_HYPER_CONRING_SIZE);
- readmem(conring, KVADDR, buf, XEN_HYPER_CONRING_SIZE,
+ buf = GETBUF(conring_size);
+ readmem(conring, KVADDR, buf, conring_size,
"conring contents", FAULT_ON_ERROR);
idx = start;
- len = XEN_HYPER_CONRING_SIZE;
+ len = conring_size;
last = 0;
wrap_around:
12 years, 4 months
[PATCH v2 4/6] xen: Get idle data from alternative source
by Daniel Kiper
idle member was removed from struct schedule_data by 21422 changeset
(Fix CPU hotplug after percpu data handling changes). Get idle data
from alternative source.
Signed-off-by: Daniel Kiper <daniel.kiper(a)oracle.com>
diff -Npru crash-6.0.8.orig/xen_hyper.c crash-6.0.8/xen_hyper.c
--- crash-6.0.8.orig/xen_hyper.c 2012-07-05 16:05:31.000000000 +0200
+++ crash-6.0.8/xen_hyper.c 2012-07-05 16:08:52.000000000 +0200
@@ -397,7 +397,8 @@ xen_hyper_misc_init(void)
XEN_HYPER_STRUCT_SIZE_INIT(schedule_data, "schedule_data");
XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_schedule_lock, "schedule_data", "schedule_lock");
XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_curr, "schedule_data", "curr");
- XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_idle, "schedule_data", "idle");
+ if (MEMBER_EXISTS("schedule_data", "idle"))
+ XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_idle, "schedule_data", "idle");
XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_sched_priv, "schedule_data", "sched_priv");
XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_s_timer, "schedule_data", "s_timer");
XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_tick, "schedule_data", "tick");
@@ -539,7 +540,10 @@ xen_hyper_schedule_init(void)
}
schc->cpu_id = cpuid;
schc->curr = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_curr));
- schc->idle = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_idle));
+ if (MEMBER_EXISTS("schedule_data", "idle"))
+ schc->idle = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_idle));
+ else
+ schc->idle = xht->idle_vcpu_array[cpuid];
schc->sched_priv =
ULONG(buf + XEN_HYPER_OFFSET(schedule_data_sched_priv));
if (XEN_HYPER_VALID_MEMBER(schedule_data_tick))
12 years, 4 months
[PATCH v2 3/6] x86/xen: Read variables from dynamically allocated per_cpu data
by Daniel Kiper
per_cpu data is dynamically allocated since 21416 changeset (x86: Dynamically
allocate percpu data area when a CPU comes online). Take into account that
and read variables from correct address.
Signed-off-by: Daniel Kiper <daniel.kiper(a)oracle.com>
diff -Npru crash-6.0.8.orig/xen_hyper.c crash-6.0.8/xen_hyper.c
--- crash-6.0.8.orig/xen_hyper.c 2012-07-05 15:47:09.000000000 +0200
+++ crash-6.0.8/xen_hyper.c 2012-07-05 15:50:19.000000000 +0200
@@ -64,7 +64,6 @@ xen_hyper_init(void)
machdep->get_smp_cpus();
machdep->memory_size();
-#ifdef IA64
if (symbol_exists("__per_cpu_offset")) {
xht->flags |= XEN_HYPER_SMP;
if((xht->__per_cpu_offset = malloc(sizeof(ulong) * XEN_HYPER_MAX_CPUS())) == NULL) {
@@ -76,7 +75,6 @@ xen_hyper_init(void)
error(FATAL, "cannot read __per_cpu_offset.\n");
}
}
-#endif
#if defined(X86) || defined(X86_64)
if (symbol_exists("__per_cpu_shift")) {
diff -Npru crash-6.0.8.orig/xen_hyper_defs.h crash-6.0.8/xen_hyper_defs.h
--- crash-6.0.8.orig/xen_hyper_defs.h 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/xen_hyper_defs.h 2012-07-05 15:50:19.000000000 +0200
@@ -136,7 +136,13 @@ typedef uint32_t Elf_Word;
#if defined(X86) || defined(X86_64)
#define xen_hyper_per_cpu(var, cpu) \
- ((ulong)(var) + (((ulong)(cpu))<<xht->percpu_shift))
+ ({ ulong __var_addr; \
+ if (xht->__per_cpu_offset) \
+ __var_addr = (xht->flags & XEN_HYPER_SMP) ? \
+ ((ulong)(var) + xht->__per_cpu_offset[cpu]) : (ulong)(var); \
+ else \
+ __var_addr = (ulong)(var) + ((ulong)(cpu) << xht->percpu_shift); \
+ __var_addr; })
#elif defined(IA64)
#define xen_hyper_per_cpu(var, cpu) \
((xht->flags & XEN_HYPER_SMP) ? \
12 years, 4 months
[PATCH v2 2/6] xen: Read only crash notes for onlined CPUs
by Daniel Kiper
Read only crash notes for onlined CPUs. Crash notes for not running
CPUs does not exist in core file. Do not try to read them.
Signed-off-by: Daniel Kiper <daniel.kiper(a)oracle.com>
diff -Npru crash-6.0.8.orig/xen_hyper.c crash-6.0.8/xen_hyper.c
--- crash-6.0.8.orig/xen_hyper.c 2012-07-05 15:34:45.000000000 +0200
+++ crash-6.0.8/xen_hyper.c 2012-07-05 15:35:05.000000000 +0200
@@ -633,18 +633,18 @@ xen_hyper_dumpinfo_init(void)
}
/* allocate a context area */
- size = sizeof(struct xen_hyper_dumpinfo_context) * XEN_HYPER_MAX_CPUS();
+ size = sizeof(struct xen_hyper_dumpinfo_context) * machdep->get_smp_cpus();
if((xhdit->context_array = malloc(size)) == NULL) {
error(FATAL, "cannot malloc dumpinfo table context space.\n");
}
BZERO(xhdit->context_array, size);
- size = sizeof(struct xen_hyper_dumpinfo_context_xen_core) * XEN_HYPER_MAX_CPUS();
+ size = sizeof(struct xen_hyper_dumpinfo_context_xen_core) * machdep->get_smp_cpus();
if((xhdit->context_xen_core_array = malloc(size)) == NULL) {
error(FATAL, "cannot malloc dumpinfo table context_xen_core_array space.\n");
}
BZERO(xhdit->context_xen_core_array, size);
addr = symbol_value("per_cpu__crash_notes");
- for (i = 0; i < XEN_HYPER_MAX_CPUS(); i++) {
+ for (i = 0; i < machdep->get_smp_cpus(); i++) {
ulong addr_notes;
addr_notes = xen_hyper_per_cpu(addr, i);
12 years, 4 months
ARM w/40-bit physical address space and ARM64
by Dave Anderson
Hi guys,
By any chance are you gents looking into updating the crash utility's
ARM support for its new 40-bit PAE capability, or the 64-bit ARM
architecture?
Dave
12 years, 4 months
Re: [Crash-utility] sample vmcores of virsh dump --memory-only
by Dave Anderson
----- Original Message -----
> Hello Dave,
>
> [ cut ]
>
> FJ_sample_vmcores.tar.bz2
>
> This includes two sample vmcores as follows:
>
> rhel6.2_i386
> rhel6.2_x86_64
>
> Their md5 hashes are respectively:
>
> ec8c7b6dc2202d8e61c5af8f810b3252 FJ_sample_vmcores.tar.bz2
> 88c9bf546ad0c11cd2a1a52bd18ffbcf rhel6.2_i386
> 95b8f7f3a9a8427eeb1a66f42fd85534 rhel6.2_x86_64
>
> Thanks.
> HATAYAMA, Daisuke
>
Hello Daisuke and Qian,
Sorry for the delay -- I am still catching up on my vacation email,
and only got to this one today. Thanks for the two vmcores.
Anyway, it was surprising to note is that the two dumpfiles can already
can be read with no problem by the crash utility -- with no additional
patches to support it. The crash utility just thinks that it's a kdump
with some unknown "QEMU" ELF notes:
$ crash vmlinux-2.6.32-220.el6.x86_64.gz rhel6.2_x86_64
crash 6.0.8
Copyright (C) 2002-2012 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. Enter "help copying" to see the conditions.
This program has absolutely no warranty. Enter "help warranty" for details.
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...
KERNEL: vmlinux-2.6.32-220.el6.x86_64.gz
DUMPFILE: rhel6.2_x86_64
CPUS: 4
DATE: Thu Aug 2 01:11:23 2012
UPTIME: 02:46:20
LOAD AVERAGE: 0.02, 0.02, 0.00
TASKS: 213
NODENAME: localhost.localdomain
RELEASE: 2.6.32-220.el6.x86_64
VERSION: #1 SMP Wed Nov 9 08:03:13 EST 2011
MACHINE: x86_64 (2000 Mhz)
MEMORY: 128 MB
PANIC: "Oops: 0002 [#1] SMP " (check log for details)
PID: 1850
COMMAND: "bash"
TASK: ffff88001f1aeb40 [THREAD_INFO: ffff88001f752000]
CPU: 0
STATE: TASK_RUNNING (PANIC)
crash> bt
PID: 1850 TASK: ffff88001f1aeb40 CPU: 0 COMMAND: "bash"
#0 [ffff88001f7539e0] machine_kexec at ffffffff81031fcb
#1 [ffff88001f753a40] crash_kexec at ffffffff810b8f72
#2 [ffff88001f753b10] oops_end at ffffffff814f04b0
#3 [ffff88001f753b40] no_context at ffffffff8104230b
#4 [ffff88001f753b90] __bad_area_nosemaphore at ffffffff81042595
#5 [ffff88001f753be0] bad_area at ffffffff810426be
#6 [ffff88001f753c10] __do_page_fault at ffffffff81042dc3
#7 [ffff88001f753d30] do_page_fault at ffffffff814f248e
#8 [ffff88001f753d60] page_fault at ffffffff814ef845
[exception RIP: sysrq_handle_crash+22]
RIP: ffffffff81325476 RSP: ffff88001f753e18 RFLAGS: 00010096
RAX: 0000000000000010 RBX: 0000000000000063 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000063
RBP: ffff88001f753e18 R8: 0000000000000000 R9: ffffffff8163a940
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffffffff81afad40 R14: 0000000000000286 R15: 0000000000000004
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
#9 [ffff88001f753e20] __handle_sysrq at ffffffff81325732
#10 [ffff88001f753e70] write_sysrq_trigger at ffffffff813257ee
#11 [ffff88001f753ea0] proc_reg_write at ffffffff811dae8e
#12 [ffff88001f753ef0] vfs_write at ffffffff811765d8
#13 [ffff88001f753f30] sys_write at ffffffff81176fe1
#14 [ffff88001f753f80] system_call_fastpath at ffffffff8100b0f2
RIP: 0000003009cd8450 RSP: 00007fffdddada80 RFLAGS: 00010206
RAX: 0000000000000001 RBX: ffffffff8100b0f2 RCX: 0000000000000400
RDX: 0000000000000002 RSI: 00007f923ca64000 RDI: 0000000000000001
RBP: 00007f923ca64000 R8: 000000000000000a R9: 00007f923ca5d700
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000002
R13: 0000003009f9b780 R14: 0000000000000002 R15: 0000003009f9b780
ORIG_RAX: 0000000000000001 CS: 0033 SS: 002b
crash> help -n
vmcore_data:
flags: c0 (KDUMP_LOCAL|KDUMP_ELF64)
ndfd: 3
ofp: 1e4addf0
header_size: 3688
num_pt_load_segments: 6
pt_load_segment[0]:
file_offset: e68
phys_start: 0
phys_end: 20000000
zero_fill: 0
pt_load_segment[1]:
file_offset: 20820e68
phys_start: 20000000
phys_end: 20020000
zero_fill: 0
pt_load_segment[2]:
file_offset: 20840e68
phys_start: 20020000
phys_end: 20040000
zero_fill: 0
pt_load_segment[3]:
file_offset: 20000e68
phys_start: 20040000
phys_end: 20840000
zero_fill: 0
pt_load_segment[4]:
file_offset: 20810e68
phys_start: 20840000
phys_end: 20850000
zero_fill: 0
pt_load_segment[5]:
file_offset: 20800e68
phys_start: 20850000
phys_end: 20860000
zero_fill: 0
elf_header: 1c8d6fe0
elf32: 0
notes32: 0
load32: 0
elf64: 1c8d6fe0
notes64: 1c8d7020
load64: 1c8d7058
nt_prstatus: 1c8d71a8
nt_prpsinfo: 0
nt_taskstruct: 0
task_struct: 0
page_size: 0
switch_stack: 0
xen_kdump_data: (unused)
num_prstatus_notes: 4
vmcoreinfo: 0
size_vmcoreinfo: 0
nt_prstatus_percpu:
000000001c8d71a8 000000001c8d730c 000000001c8d7470 000000001c8d75d4
Elf64_Ehdr:
e_ident: \177ELF
e_ident[EI_CLASS]: 2 (ELFCLASS64)
e_ident[EI_DATA]: 1 (ELFDATA2LSB)
e_ident[EI_VERSION]: 1 (EV_CURRENT)
e_ident[EI_OSABI]: 0 (ELFOSABI_SYSV)
e_ident[EI_ABIVERSION]: 0
e_type: 4 (ET_CORE)
e_machine: 62 (EM_X86_64)
e_version: 1 (EV_CURRENT)
e_entry: 0
e_phoff: 40
e_shoff: 0
e_flags: 0
e_ehsize: 40
e_phentsize: 38
e_phnum: 7
e_shentsize: 0
e_shnum: 0
e_shstrndx: 0
Elf64_Phdr:
p_type: 4 (PT_NOTE)
p_offset: 456 (1c8)
p_vaddr: 0
p_paddr: 0
p_filesz: 3232 (ca0)
p_memsz: 3232 (ca0)
p_flags: 0 ()
p_align: 0
Elf64_Phdr:
p_type: 1 (PT_LOAD)
p_offset: 3688 (e68)
p_vaddr: 0
p_paddr: 0
p_filesz: 536870912 (20000000)
p_memsz: 536870912 (20000000)
p_flags: 0 ()
p_align: 0
Elf64_Phdr:
p_type: 1 (PT_LOAD)
p_offset: 545394280 (20820e68)
p_vaddr: 0
p_paddr: 20000000
p_filesz: 131072 (20000)
p_memsz: 131072 (20000)
p_flags: 0 ()
p_align: 0
Elf64_Phdr:
p_type: 1 (PT_LOAD)
p_offset: 545525352 (20840e68)
p_vaddr: 0
p_paddr: 20020000
p_filesz: 131072 (20000)
p_memsz: 131072 (20000)
p_flags: 0 ()
p_align: 0
Elf64_Phdr:
p_type: 1 (PT_LOAD)
p_offset: 536874600 (20000e68)
p_vaddr: 0
p_paddr: 20040000
p_filesz: 8388608 (800000)
p_memsz: 8388608 (800000)
p_flags: 0 ()
p_align: 0
Elf64_Phdr:
p_type: 1 (PT_LOAD)
p_offset: 545328744 (20810e68)
p_vaddr: 0
p_paddr: 20840000
p_filesz: 65536 (10000)
p_memsz: 65536 (10000)
p_flags: 0 ()
p_align: 0
Elf64_Phdr:
p_type: 1 (PT_LOAD)
p_offset: 545263208 (20800e68)
p_vaddr: 0
p_paddr: 20850000
p_filesz: 65536 (10000)
p_memsz: 65536 (10000)
p_flags: 0 ()
p_align: 0
Elf64_Nhdr:
n_namesz: 5 ("CORE")
n_descsz: 336
n_type: 1 (NT_PRSTATUS)
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000001 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
000000000309f000 ffffffffffffffff
0000000000000000 ffffffff81c00480
ffffffff81a01ec8 0000000000000000
0000000000000000 00000013911d5f29
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000001
ffffffff81dd5228 0000000000000000
ffffffff810375ab 0000000000000010
0000000000000246 ffffffff81a01ec8
0000000000000018 0000000000000000
ffff880003200000 0000000000000018
0000000000000018 0000000000000000
0000000000000000 0000000000000000
Elf64_Nhdr:
n_namesz: 5 ("CORE")
n_descsz: 336
n_type: 1 (NT_PRSTATUS)
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000002 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
ffffffff81bfed40 0000000000000000
00000000fffffffe ffff880002287ef8
ffff880002287e88 000000000000000c
ffff88001e6abe78 000009149661fc2b
ffff880002287e54 ffff880002287e50
ffffffff81a93760 0000000080802001
0000000000000000 00000000000000ff
00000000000000f0 0000000000000000
ffffffff810375ba 0000000000000010
0000000000000002 ffff880002287e88
0000000000000018 0000000000000000
ffff880002280000 0000000000000018
0000000000000018 0000000000000000
0000000000000000 0000000000000000
Elf64_Nhdr:
n_namesz: 5 ("CORE")
n_descsz: 336
n_type: 1 (NT_PRSTATUS)
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000003 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
ffffffff81bfed40 0000000000000000
00000000fffffffe ffff880002307ef8
ffff880002307e88 000000000000000c
ffff88001e6dfe78 000009143aed494c
ffff880002307e54 ffff880002307e50
ffffffff81a93760 0000000080802001
0000000000000000 00000000000000ff
00000000000000f0 0000000000000000
ffffffff810375ba 0000000000000010
0000000000000002 ffff880002307e88
0000000000000018 0000000000000000
ffff880002300000 0000000000000018
0000000000000018 0000000000000000
0000000000000000 0000000000000000
Elf64_Nhdr:
n_namesz: 5 ("CORE")
n_descsz: 336
n_type: 1 (NT_PRSTATUS)
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000004 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
ffffffff81bfed40 0000000000000000
00000000fffffffe ffff880002387ef8
ffff880002387e88 000000000000000c
0000000000000000 0000091497285969
ffff880002387e54 ffff880002387e50
ffffffff81a93760 0000000080802001
0000000000000000 00000000000000ff
00000000000000f0 0000000000000000
ffffffff810375ba 0000000000000010
0000000000000046 ffff880002387e88
0000000000000018 0000000000000000
ffff880002380000 0000000000000018
0000000000000018 0000000000000000
0000000000000000 0000000000000000
Elf64_Nhdr:
n_namesz: 5 ("QEMU")
n_descsz: 432
n_type: 0 (?)
000001b000000001 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000001
ffffffff81dd5228 ffffffff81a01ec8
ffffffff81a01ec8 0000000000000000
0000000000000000 00000013911d5f29
0000000000000000 ffffffff81c00480
0000000000000000 ffffffffffffffff
000000000309f000 ffffffff810375ab
0000000000000246 ffffffff00000010
0000000000a09b00 0000000000000000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000018
0000000000c09300 0000000000000000
ffffffff00000000 0000000000000000
0000000000000000 ffffffff00000000
0000000000000000 ffff880003200000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000000
0000000000000000 0000000000000000
0000208700000040 0000000000008b00
ffff880003213b40 0000007f00000000
0000000000000000 ffff880003204000
00000fff00000000 0000000000000000
ffffffff81dd2000 000000008005003b
0000000000000000 0000000001b2e000
0000000007b18000 00000000000006f0
Elf64_Nhdr:
n_namesz: 5 ("QEMU")
n_descsz: 432
n_type: 0 (?)
000001b000000001 ffffffff81a93760
000000000000000c 0000000080802001
0000000000000000 00000000000000ff
00000000000000f0 ffff880002287e88
ffff880002287e88 ffff880002287e50
ffff880002287e54 000009149661fc2b
ffff88001e6abe78 ffff880002287ef8
00000000fffffffe 0000000000000000
ffffffff81bfed40 ffffffff810375ba
0000000000000002 ffffffff00000010
0000000000a09b00 0000000000000000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000018
0000000000c09300 0000000000000000
ffffffff00000000 0000000000000000
0000000000000000 ffffffff00000000
0000000000000000 ffff880002280000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000000
0000000000000000 0000000000000000
0000208700000040 0000000000008b00
ffff880002293b40 0000007f00000000
0000000000000000 ffff880002284000
00000fff00000000 0000000000000000
ffffffff81dd2000 000000008005003b
0000000000000000 0000000002162570
000000001aab8000 00000000000006e0
Elf64_Nhdr:
n_namesz: 5 ("QEMU")
n_descsz: 432
n_type: 0 (?)
000001b000000001 ffffffff81a93760
000000000000000c 0000000080802001
0000000000000000 00000000000000ff
00000000000000f0 ffff880002307e88
ffff880002307e88 ffff880002307e50
ffff880002307e54 000009143aed494c
ffff88001e6dfe78 ffff880002307ef8
00000000fffffffe 0000000000000000
ffffffff81bfed40 ffffffff810375ba
0000000000000002 ffffffff00000010
0000000000a09b00 0000000000000000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000018
0000000000c09300 0000000000000000
ffffffff00000000 0000000000000000
0000000000000000 ffffffff00000000
0000000000000000 ffff880002300000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000000
0000000000000000 0000000000000000
0000208700000040 0000000000008b00
ffff880002313b40 0000007f00000000
0000000000000000 ffff880002304000
00000fff00000000 0000000000000000
ffffffff81dd2000 000000008005003b
0000000000000000 00007fd1a029c000
000000001d5c7000 00000000000006e0
Elf64_Nhdr:
n_namesz: 5 ("QEMU")
n_descsz: 432
n_type: 0 (?)
000001b000000001 ffffffff81a93760
000000000000000c 0000000080802001
0000000000000000 00000000000000ff
00000000000000f0 ffff880002387e88
ffff880002387e88 ffff880002387e50
ffff880002387e54 0000091497285969
0000000000000000 ffff880002387ef8
00000000fffffffe 0000000000000000
ffffffff81bfed40 ffffffff810375ba
0000000000000046 ffffffff00000010
0000000000a09b00 0000000000000000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000018
0000000000c09300 0000000000000000
ffffffff00000000 0000000000000000
0000000000000000 ffffffff00000000
0000000000000000 ffff880002380000
ffffffff00000018 0000000000c09300
0000000000000000 ffffffff00000000
0000000000000000 0000000000000000
0000208700000040 0000000000008b00
ffff880002393b40 0000007f00000000
0000000000000000 ffff880002384000
00000fff00000000 0000000000000000
ffffffff81dd2000 000000008005003b
0000000000000000 00007f981fe51000
000000001f214000 00000000000006e0
crash>
That being the case, the question that immediately arises is:
Why bother to create a new special dumpfile "type"?
When I quickly reviewed Qian's original patch, I was not aware that the dumpfile
is already a "clone" of a kdump, and that crash already supports it with no additional
patches required. Knowing that, I'd much rather prefer to keep things simpler,
and avoid creating a new dumpfile type at all.
Also, when I suggested creating a new dumpfile type, I forgot how ugly and confusing
the repetitive changes such as this are:
} else if (is_xendump(argv[optind])) {
- if (pc->flags & MEMORY_SOURCES) {
+ if (pc->flags & MEMORY_SOURCES || pc->flags2 & QEMU_MEM_DUMP) {
error(INFO,
"too many dumpfile arguments\n");
program_usage(SHORT_FORM);
I should have suggested moving one of the currently-existing pc->flags bits into
pc->flags2, and keeping all the dumpfile types in pc->flags. Or at least create a
new macro to replace all the usages of "(pc->flags & MEMORY_SOURCES)".
My mistake, Qian -- sorry about that...
But -- it seems that we can just leave the dumpfile type as a "KDUMP_ELF32/KDUMP_ELF64",
and then based upon the existence of a "QEMU" note, just set a QEMU_MEM_DUMP pc->flags2
bit that can be used everywhere that you're interested in accessing the "QEMU"
notes/registers section? Wouldn't that be far simpler?
Dave
12 years, 4 months
[PATCH] allow various git command locations
by Cliff Wickman
From: Cliff Wickman <cpw(a)sgi.com>
I build crash on systems that don't always have the git command
as /usr/bin/git.
Could you allow git to be in various places? Something like below?
Signed-off-by: Cliff Wickman <cpw(a)sgi.com>
---
extensions/eppic.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: crash-6.0.8/extensions/eppic.mk
===================================================================
--- crash-6.0.8.orig/extensions/eppic.mk
+++ crash-6.0.8/extensions/eppic.mk
@@ -24,7 +24,8 @@ all:
then \
if [ ! -f $(APPFILE) ]; \
then \
- if [ -f /usr/bin/git ]; \
+ GIT=`which git 2> /dev/null`; \
+ if [ -f $${GIT} ]; \
then \
git clone https://code.google.com/p/eppic eppic; \
else \
12 years, 4 months