Index: ia64.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/ia64.c,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -r1.4 -r1.4.6.1
--- ia64.c	22 Mar 2007 02:08:12 -0000	1.4
+++ ia64.c	24 Apr 2007 00:29:15 -0000	1.4.6.1
@@ -3981,7 +3981,8 @@
 static int
 ia64_kvtop_hyper(struct task_context *tc, ulong kvaddr, physaddr_t *paddr, int verbose)
 {
-	unsigned long virt_percpu_start, phys_percpu_start;
+	ulong virt_percpu_start, phys_percpu_start;
+	ulong addr, dirp, entry;
 
 	if (!IS_KVADDR(kvaddr))
 		return FALSE;
@@ -3994,9 +3995,37 @@
 	} else if (DIRECTMAP_VIRT_ADDR(kvaddr)) {
 		*paddr = kvaddr - DIRECTMAP_VIRT_START;
 		return TRUE;
+	} else if (!FRAME_TABLE_VIRT_ADDR(kvaddr)) {
+		return FALSE;
 	}
 
-	return FALSE;
+	/* frametable virtual address */
+	addr = kvaddr - VIRT_FRAME_TABLE_ADDR;
+
+	dirp = symbol_value("frametable_pg_dir");
+	dirp += ((addr >> PGDIR_SHIFT_3L) & (PTRS_PER_PGD - 1)) * sizeof(ulong);
+	readmem(dirp, KVADDR, &entry, sizeof(ulong), 
+		"frametable_pg_dir", FAULT_ON_ERROR);
+
+	dirp = entry & _PFN_MASK;
+	if (!dirp)
+		return FALSE;
+	dirp += ((addr >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) * sizeof(ulong);
+	readmem(dirp, PHYSADDR, &entry, sizeof(ulong), 
+		"frametable pmd", FAULT_ON_ERROR);
+
+	dirp = entry & _PFN_MASK;
+	if (!dirp)
+		return FALSE;
+	dirp += ((addr >> PAGESHIFT()) & (PTRS_PER_PTE - 1)) * sizeof(ulong);
+	readmem(dirp, PHYSADDR, &entry, sizeof(ulong), 
+		"frametable pte", FAULT_ON_ERROR);
+
+	if (!(entry & _PAGE_P))
+		return FALSE;
+
+	*paddr = (entry & _PFN_MASK) + (kvaddr & (PAGESIZE() - 1));
+	return TRUE;
 }
 
 static void
Index: xen_hyper.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/xen_hyper.c,v
retrieving revision 1.3
retrieving revision 1.3.8.5
diff -u -r1.3 -r1.3.8.5
--- xen_hyper.c	21 Feb 2007 22:58:33 -0000	1.3
+++ xen_hyper.c	24 Apr 2007 04:51:03 -0000	1.3.8.5
@@ -170,6 +170,26 @@
 	XEN_HYPER_MEMBER_OFFSET_INIT(domain_domain_flags, "domain", "domain_flags");
 	XEN_HYPER_MEMBER_OFFSET_INIT(domain_evtchn, "domain", "evtchn");
 	XEN_HYPER_MEMBER_OFFSET_INIT(domain_vcpu, "domain", "vcpu");
+	XEN_HYPER_MEMBER_OFFSET_INIT(domain_arch, "domain", "arch");
+
+	XEN_HYPER_STRUCT_SIZE_INIT(arch_shared_info, "arch_shared_info");
+	XEN_HYPER_MEMBER_OFFSET_INIT(arch_shared_info_max_pfn, "arch_shared_info", "max_pfn");
+	XEN_HYPER_MEMBER_OFFSET_INIT(arch_shared_info_pfn_to_mfn_frame_list_list, "arch_shared_info", "pfn_to_mfn_frame_list_list");
+	XEN_HYPER_MEMBER_OFFSET_INIT(arch_shared_info_nmi_reason, "arch_shared_info", "nmi_reason");
+
+	XEN_HYPER_STRUCT_SIZE_INIT(shared_info, "shared_info");
+	XEN_HYPER_MEMBER_OFFSET_INIT(shared_info_vcpu_info, "shared_info", "vcpu_info");
+	XEN_HYPER_MEMBER_OFFSET_INIT(shared_info_evtchn_pending, "shared_info", "evtchn_pending");
+	XEN_HYPER_MEMBER_OFFSET_INIT(shared_info_evtchn_mask, "shared_info", "evtchn_mask");
+	XEN_HYPER_MEMBER_OFFSET_INIT(shared_info_arch, "shared_info", "arch");
+
+	XEN_HYPER_STRUCT_SIZE_INIT(arch_domain, "arch_domain");
+#ifdef IA64
+	XEN_HYPER_MEMBER_OFFSET_INIT(arch_domain_mm, "arch_domain", "mm");
+
+	XEN_HYPER_STRUCT_SIZE_INIT(mm_struct, "mm_struct");
+	XEN_HYPER_MEMBER_OFFSET_INIT(mm_struct_pgd, "mm_struct", "pgd");
+#endif
 
 	if((xhdt->domain_struct = malloc(XEN_HYPER_SIZE(domain))) == NULL) {
 		error(FATAL, "cannot malloc domain struct space.\n");
@@ -453,7 +473,8 @@
 		schc->idle = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_idle));
 		schc->sched_priv =
 			ULONG(buf + XEN_HYPER_OFFSET(schedule_data_sched_priv));
-		schc->tick = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_tick));
+		if (XEN_HYPER_VALID_MEMBER(schedule_data_tick))
+			schc->tick = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_tick));
 	}
 	FREEBUF(buf);
 }
@@ -751,7 +772,7 @@
 xen_hyper_refresh_domain_context_space(void)
 {
 	char *domain_struct;
-	ulong domain, next, idle_vcpu;
+	ulong domain, next, dom_xen, dom_io, idle_vcpu;
 	struct xen_hyper_domain_context *dc;
 	struct xen_hyper_domain_context *dom0;
 
@@ -764,6 +785,25 @@
 	xen_hyper_alloc_domain_context_space(XEN_HYPER_NR_DOMAINS());
 
 	dc = xhdt->context_array;
+
+	/* restore an dom_io context. */
+	get_symbol_data("dom_io", sizeof(dom_io), &dom_io);
+	if ((domain_struct = xen_hyper_read_domain(dom_io)) == NULL) {
+		error(FATAL, "cannot read dom_io.\n");
+	}
+	xen_hyper_store_domain_context(dc, dom_io, domain_struct);
+	xhdt->dom_io = dc;
+	dc++;
+
+	/* restore an dom_xen context. */
+	get_symbol_data("dom_xen", sizeof(dom_xen), &dom_xen);
+	if ((domain_struct = xen_hyper_read_domain(dom_xen)) == NULL) {
+		error(FATAL, "cannot read dom_xen.\n");
+	}
+	xen_hyper_store_domain_context(dc, dom_xen, domain_struct);
+	xhdt->dom_xen = dc;
+	dc++;
+
 	/* restore an idle domain context. */
 	get_symbol_data("idle_vcpu", sizeof(idle_vcpu), &idle_vcpu);
 	if (!readmem(idle_vcpu + MEMBER_OFFSET("vcpu", "domain"),
@@ -814,7 +854,7 @@
 			error(FATAL, "cannot read domain.next_in_list.\n");
 		}
 	}
-	i++;					/* for idle domain */
+	i += 3;		/* for dom_io, dom_xen and idle domain */
 	return i;
 }
 
@@ -1009,7 +1049,10 @@
 	dc->shared_info = ULONG(dp + XEN_HYPER_OFFSET(domain_shared_info));
 	dc->sched_priv = ULONG(dp + XEN_HYPER_OFFSET(domain_sched_priv));
 	dc->next_in_list = ULONG(dp + XEN_HYPER_OFFSET(domain_next_in_list));
-	dc->domain_flags = ULONG(dp + XEN_HYPER_OFFSET(domain_domain_flags));
+	if (XEN_HYPER_VALID_MEMBER(domain_domain_flags))
+		dc->domain_flags = ULONG(dp + XEN_HYPER_OFFSET(domain_domain_flags));
+	else
+		dc->domain_flags = XEN_HYPER_DOMF_ERROR;
 	dc->evtchn = ULONG(dp + XEN_HYPER_OFFSET(domain_evtchn));
 	for (i = 0; i < XEN_HYPER_MAX_VIRT_CPUS; i++) {
 		dc->vcpu[i] = ULONG(dp + XEN_HYPER_OFFSET(domain_vcpu) + i*sizeof(void *));
@@ -1231,7 +1274,8 @@
 	vcc->vcpu_info = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_vcpu_info));
 	vcc->domain = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_domain));
 	vcc->next_in_list = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_next_in_list));
-	vcc->sleep_tick = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_sleep_tick));
+	if (XEN_HYPER_VALID_MEMBER(vcpu_sleep_tick))
+		vcc->sleep_tick = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_sleep_tick));
 	vcc->sched_priv = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_sched_priv));
 	vcc->state = INT(vcp + XEN_HYPER_OFFSET(vcpu_runstate) +
 		XEN_HYPER_OFFSET(vcpu_runstate_info_state));
@@ -1239,7 +1283,10 @@
 		XEN_HYPER_OFFSET(vcpu_runstate) +
 		XEN_HYPER_OFFSET(vcpu_runstate_info_state_entry_time));
 	vcc->runstate_guest = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_runstate_guest));
-	vcc->vcpu_flags = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_vcpu_flags));
+	if (XEN_HYPER_VALID_MEMBER(vcpu_vcpu_flags))
+		vcc->vcpu_flags = ULONG(vcp + XEN_HYPER_OFFSET(vcpu_vcpu_flags));
+	else
+		vcc->vcpu_flags = XEN_HYPER_VCPUF_ERROR;
 	return vcc;
 }
 
@@ -1299,8 +1346,8 @@
 			error(FATAL, "cannot malloc context arrays (%d domains).",
 				domains);
 		}
-		xhvct->vcpu_context_arrays_cnt = domains;
 		BZERO(xhvct->vcpu_context_arrays, domains * sizeof(struct xen_hyper_vcpu_context_array));
+		xhvct->vcpu_context_arrays_cnt = domains;
 	} else if (domains > xhvct->vcpu_context_arrays_cnt) {
 		if (!(xhvct->vcpu_context_arrays =
 			realloc(xhvct->vcpu_context_arrays,
@@ -1321,7 +1368,13 @@
 void
 xen_hyper_alloc_vcpu_context_space(struct xen_hyper_vcpu_context_array *vcca, int vcpus)
 {
-	if (vcca->context_array == NULL) {
+	if (!vcpus) {
+		if (vcca->context_array != NULL) {
+			free(vcca->context_array);
+			vcca->context_array = NULL;
+		}
+		vcca->context_array_cnt = vcpus;
+	} else if (vcca->context_array == NULL) {
 		if (!(vcca->context_array =
 			malloc(vcpus * sizeof(struct xen_hyper_vcpu_context)))) {
 			error(FATAL, "cannot malloc context array (%d vcpus).",
@@ -1542,7 +1595,7 @@
  *  Calculate and return the uptime.
  */
 ulonglong
-get_uptime_hyper(void)
+xen_hyper_get_uptime_hyper(void)
 {
 	ulong jiffies, tmp1, tmp2;
 	ulonglong jiffies_64, wrapped;
@@ -1645,7 +1698,8 @@
 		"total_pages", RETURN_ON_ERROR)) {
 		error(WARNING, "cannot read total_pages.\n");
 	}
-	machdep->memsize = (uint64_t)(xht->total_pages) * (uint64_t)(machdep->pagesize);
+	xht->sys_pages = xht->total_pages;
+	machdep->memsize = (uint64_t)(xht->sys_pages) * (uint64_t)(machdep->pagesize);
 	return machdep->memsize;
 }
 
@@ -1683,7 +1737,7 @@
 
 	if (!xht->cpu_data_address ||
 	    !XEN_HYPER_VALID_STRUCT(cpuinfo_ia64) ||
-	    !XEN_HYPER_VALID_MEMBER(cpuinfo_ia64_proc_freq))
+	    XEN_HYPER_INVALID_MEMBER(cpuinfo_ia64_proc_freq))
 		return (machdep->mhz = mhz);
 
         readmem(xen_hyper_per_cpu(xht->cpu_data_address, xht->cpu_idxs[0]) + 
Index: xen_hyper_command.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/xen_hyper_command.c,v
retrieving revision 1.4
retrieving revision 1.4.8.8
diff -u -r1.4 -r1.4.8.8
--- xen_hyper_command.c	21 Feb 2007 22:58:33 -0000	1.4
+++ xen_hyper_command.c	24 Apr 2007 04:51:03 -0000	1.4.8.8
@@ -219,11 +219,19 @@
 {
 	struct xen_hyper_domain_context *dca;
 	char buf1[XEN_HYPER_CMD_BUFSIZE];
+	char buf2[XEN_HYPER_CMD_BUFSIZE];
 	int i;
 
-	fprintf(fp,
-		"   DID  %s ST T %%MMEM %%TMEM VCPU\n",
-		mkstring(buf1, VADDR_PRLEN, CENTER|RJUST, "DOMAIN"));
+	sprintf(buf1, "   DID  %s ST T ",
+		mkstring(buf2, VADDR_PRLEN, CENTER|RJUST, "DOMAIN"));
+	mkstring(&buf1[strlen(buf1)], INT_PRLEN, CENTER|RJUST, "MAXPAGE");
+	strncat(buf1, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf1)-1);
+	mkstring(&buf1[strlen(buf1)], INT_PRLEN, CENTER|RJUST, "TOTPAGE");
+	strncat(buf1, " VCPU ", XEN_HYPER_CMD_BUFSIZE-strlen(buf1)-1);
+	mkstring(&buf1[strlen(buf1)], VADDR_PRLEN, CENTER|RJUST, "SHARED_I");
+	strncat(buf1, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf1)-1);
+	mkstring(&buf1[strlen(buf1)], LONG_PRLEN, CENTER|RJUST, "P2M_MFN");
+	fprintf(fp, "%s\n", buf1);
 	if (da->cnt) {
 		for (i = 0; i < da->cnt; i++) {
 			xen_hyper_show_doms(da->context[i]);
@@ -239,11 +247,16 @@
 static void
 xen_hyper_show_doms(struct xen_hyper_domain_context *dc)
 {
-	double mmem, tmem;
 	char *act, *crash;
 	uint cpuid;
 	int type, i, j;
 	struct xen_hyper_pcpu_context *pcc;
+#if defined(X86) || defined(X86_64)
+	char *shared_info;
+#elif defined(IA64)
+	char *domain_struct;
+	ulong pgd;
+#endif
 	char buf1[XEN_HYPER_CMD_BUFSIZE];
 	char buf2[XEN_HYPER_CMD_BUFSIZE];
 
@@ -251,6 +264,21 @@
 		return;
 	}
 
+#if defined(X86) || defined(X86_64)
+	shared_info = GETBUF(XEN_HYPER_SIZE(shared_info));
+	if (dc->shared_info) {
+		if (!readmem(dc->shared_info, KVADDR, shared_info,
+			XEN_HYPER_SIZE(shared_info), "fill_shared_info_struct",
+			ACTIVE() ? (RETURN_ON_ERROR|QUIET) : RETURN_ON_ERROR)) {
+			error(WARNING, "cannot fill shared_info struct.\n");
+			BZERO(shared_info, XEN_HYPER_SIZE(shared_info));
+		}
+	}
+#elif defined(IA64)
+	if ((domain_struct = xen_hyper_read_domain(dc->domain)) == NULL) {
+		error(FATAL, "cannot read domain.\n");
+	}
+#endif
 	act = NULL;
 	for_cpu_indexes(i, cpuid)
 	{
@@ -269,14 +297,6 @@
 	} else {
 		crash = " ";
 	}
-	if (dc->max_pages == -1) {
-		mmem = 100;
-	} else {
-		mmem = (double)(dc->max_pages) /
-			(double)(xht->max_page) * (double)100;
-	}
-	tmem = (double)(dc->tot_pages) /
-		(double)(xht->max_page) * (double)100;
 	sprintf(buf1, "%s%s%5d ", act, crash, dc->domain_id);
 	mkstring(&buf1[strlen(buf1)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST, (char *)(dc->domain));
 	strncat(buf1, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf1)-1);
@@ -284,15 +304,40 @@
 		xen_hyper_domain_state_string(dc, buf2, !VERBOSE));
 	sprintf(&buf1[strlen(buf1)], "%s ",
 		xen_hyper_domain_context_to_type(dc, &type, buf2, !VERBOSE));
-
-	sprintf(buf2, "%3.1f", mmem);
-	mkstring(&buf1[strlen(buf1)], 5, RJUST, buf2);
+	mkstring(&buf1[strlen(buf1)], INT_PRLEN, CENTER|INT_HEX|RJUST,
+		MKSTR((long)(dc->max_pages)));
 	strncat(buf1, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf1)-1);
+	mkstring(&buf1[strlen(buf1)], INT_PRLEN, CENTER|INT_HEX|RJUST,
+		MKSTR((long)(dc->tot_pages)));
+	sprintf(&buf1[strlen(buf1)], " %3d  ", dc->vcpu_cnt);
+	mkstring(&buf1[strlen(buf1)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
+		MKSTR(dc->shared_info));
+	strncat(buf1, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf1)-1);
+#if defined(X86) || defined(X86_64)
+	if (dc->shared_info) {
+		mkstring(&buf1[strlen(buf1)], LONG_PRLEN, CENTER|LONG_HEX|RJUST,
+			MKSTR(ULONG(shared_info +
+				XEN_HYPER_OFFSET(shared_info_arch) +
+				XEN_HYPER_OFFSET(arch_shared_info_pfn_to_mfn_frame_list_list)))
+		);
+	} else {
+		mkstring(&buf1[strlen(buf1)], LONG_PRLEN, CENTER|RJUST, "----");
+	}
+	FREEBUF(shared_info);
+#elif defined(IA64)
+	pgd = ULONG(domain_struct + XEN_HYPER_OFFSET(domain_arch) +
+		XEN_HYPER_OFFSET(arch_domain_mm) +
+		XEN_HYPER_OFFSET(mm_struct_pgd));
+	if (pgd) {
+		mkstring(&buf1[strlen(buf1)], LONG_PRLEN,
+			CENTER|LONG_HEX|RJUST,
+			MKSTR((pgd - DIRECTMAP_VIRT_START) >> machdep->pageshift));
+	} else {
+		mkstring(&buf1[strlen(buf1)], LONG_PRLEN, CENTER|RJUST, "----");
+	}
+#endif
 
-	sprintf(buf2, "%3.1f", tmem);
-	mkstring(&buf1[strlen(buf1)], 5, RJUST, buf2);
-
-	fprintf(fp, "%s %3d\n", buf1, dc->vcpu_cnt);
+	fprintf(fp, "%s\n", buf1);
 }
 
 /*
@@ -413,7 +458,7 @@
 	note_buf = dic->ELF_Prstatus_ptr;
 	sprintf(buf, "%5d ", dic->pcpu_id);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(dic->note));
+		MKSTR(dic->note));
 
 	pid = INT(note_buf + XEN_HYPER_OFFSET(ELF_Prstatus_pr_pid));
 	sprintf(&buf[strlen(buf)], " %5d ", pid);
@@ -456,11 +501,11 @@
 			tv_usec = LONG(addr +
 				XEN_HYPER_OFFSET(ELF_Timeval_tv_sec) +
 				XEN_HYPER_OFFSET(ELF_Timeval_tv_usec));
-			mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-				(char *)(tv_sec));
+			mkstring(&buf[strlen(buf)], LONG_PRLEN, CENTER|LONG_HEX|RJUST,
+				MKSTR(tv_sec));
 			strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
-			mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-				(char *)(tv_usec));
+			mkstring(&buf[strlen(buf)], LONG_PRLEN, CENTER|LONG_HEX|RJUST,
+				MKSTR(tv_usec));
 			fprintf(fp, "%s\n", buf);
 		}
 	}
@@ -477,7 +522,7 @@
 			}
 			fprintf(fp, "  %s = ", xhregt[i]);
 			fprintf(fp, "0x%s\n",
-				mkstring(buf, VADDR_PRLEN, LONG_HEX|LJUST, (char *)(*regs)));
+				mkstring(buf, LONG_PRLEN, LONG_HEX|LJUST, MKSTR(*regs)));
 		}
 	}
 }
@@ -668,13 +713,13 @@
 	}
 
 	sprintf(buf, "%s%5d ", act, pcc->processor_id);
-	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST, (char *)(pcc->pcpu));
+	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST, MKSTR(pcc->pcpu));
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(pcc->current_vcpu));
+		MKSTR(pcc->current_vcpu));
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(pcc->init_tss));
+		MKSTR(pcc->init_tss));
 	fprintf(fp, "%s\n", buf);
 	if (flag & XEN_HYPER_PCPUS_REGS) {
 		fprintf(fp, "Register information:\n");
@@ -796,26 +841,30 @@
 		mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|RJUST, "CUR-VCPU");
 		strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 		mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|RJUST, "IDL-VCPU");
-		strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
-		mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|RJUST, "TICK");
+		if (XEN_HYPER_VALID_MEMBER(schedule_data_tick)) {
+			strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
+			mkstring(&buf[strlen(buf)], LONG_PRLEN, CENTER|RJUST, "TICK");
+		}
 		fprintf(fp, "%s\n", buf);
 	}
 
 	sprintf(buf, "%5d  ", schc->cpu_id);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(schc->schedule_data));
-	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
-	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(schc->sched_priv));
+		MKSTR(schc->schedule_data));
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(schc->curr));
+		MKSTR(schc->sched_priv));
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(schc->idle));
+		MKSTR(schc->curr));
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(schc->tick));
+		MKSTR(schc->idle));
+	if (XEN_HYPER_VALID_MEMBER(schedule_data_tick)) {
+		strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
+		mkstring(&buf[strlen(buf)], LONG_PRLEN, CENTER|LONG_HEX|RJUST,
+			MKSTR(schc->tick));
+	}
 	fprintf(fp, "%s\n", buf);
 	if (flag & XEN_HYPER_SCHED_VERBOSE) {
 		;
@@ -943,7 +992,7 @@
 		(buf1, "%d\n", XEN_HYPER_NR_DOMAINS()));
 	/* !!!Display a date here if it can be found. */
 	XEN_HYPER_PRI(fp, len, "UPTIME: ", buf1, flag,
-		(buf1, "%s\n", convert_time(get_uptime_hyper(), buf2)));
+		(buf1, "%s\n", convert_time(xen_hyper_get_uptime_hyper(), buf2)));
 	/* !!!Display a version here if it can be found. */
 	XEN_HYPER_PRI_CONST(fp, len, "MACHINE: ", flag);
 	if (strlen(uts->machine)) {
@@ -1176,7 +1225,7 @@
 	}
 	sprintf(buf, "%s%s%5d %5d ", act, crash, vcc->vcpu_id, vcc->processor);
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(vcc->vcpu));
+		MKSTR(vcc->vcpu));
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
 	xen_hyper_vcpu_state_string(vcc, &buf[strlen(buf)], !VERBOSE);
 	strncat(buf, " ", XEN_HYPER_CMD_BUFSIZE-strlen(buf)-1);
@@ -1187,7 +1236,7 @@
 		sprintf(&buf[strlen(buf)], " %5d ", domid);
 	}
 	mkstring(&buf[strlen(buf)], VADDR_PRLEN, CENTER|LONG_HEX|RJUST,
-		(char *)(vcc->domain));
+		MKSTR(vcc->domain));
 	fprintf(fp, "%s\n", buf);
 }
 
@@ -1277,6 +1326,12 @@
 	if (!dc) {
 		*type = XEN_HYPER_DOMAIN_TYPE_INVALID;
 		return NULL;
+	} else if (dc->domain_id == XEN_HYPER_DOMID_IO) {
+		*type = XEN_HYPER_DOMAIN_TYPE_IO;
+		sprintf(buf, verbose ? "dom_io" : "O");
+	} else if (dc->domain_id == XEN_HYPER_DOMID_XEN) {
+		*type = XEN_HYPER_DOMAIN_TYPE_XEN;
+		sprintf(buf, verbose ? "dom_xen" : "X");
 	} else if (dc == xhdt->idle_domain) {
 		*type = XEN_HYPER_DOMAIN_TYPE_IDLE;
 		sprintf(buf, verbose ? "idle domain" : "I");
@@ -1285,7 +1340,7 @@
 		sprintf(buf, verbose ? "domain 0" : "0");
 	} else {
 		*type = XEN_HYPER_DOMAIN_TYPE_GUEST;
-		sprintf(buf, verbose ? "guest domain" : "G");
+		sprintf(buf, verbose ? "domain U" : "U");
 	}
 	return buf;
 }
Index: xen_hyper_defs.h
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/xen_hyper_defs.h,v
retrieving revision 1.3
retrieving revision 1.3.8.6
diff -u -r1.3 -r1.3.8.6
--- xen_hyper_defs.h	21 Feb 2007 22:58:33 -0000	1.3
+++ xen_hyper_defs.h	24 Apr 2007 04:51:03 -0000	1.3.8.6
@@ -74,10 +74,15 @@
 #define PERCPU_ADDR	      (DEFAULT_SHAREDINFO_ADDR - PERCPU_PAGE_SIZE)
 #define DIRECTMAP_VIRT_START  (0xf000000000000000)
 #define DIRECTMAP_VIRT_END    PERCPU_ADDR
+#define VIRT_FRAME_TABLE_ADDR    (0xf300000000000000)
+#define VIRT_FRAME_TABLE_END     (0xf400000000000000)
 
 #define PERCPU_VIRT_ADDR(vaddr) \
     (((vaddr) >= PERCPU_ADDR) && ((vaddr) < PERCPU_ADDR + PERCPU_PAGE_SIZE))
 
+#define FRAME_TABLE_VIRT_ADDR(vaddr) \
+    ((vaddr) >= VIRT_FRAME_TABLE_ADDR && (vaddr) < VIRT_FRAME_TABLE_END)
+
 #undef IA64_RBS_OFFSET
 #define IA64_RBS_OFFSET   ((XEN_HYPER_SIZE(vcpu) + 15) & ~15)
 
@@ -147,6 +152,9 @@
 /*
  * Domain
  */
+/* Prepared domain ID. */
+#define XEN_HYPER_DOMID_IO		(0x7FF1U)
+#define XEN_HYPER_DOMID_XEN		(0x7FF2U)
 /* Domain flags (domain_flags). */
  /* Is this domain privileged? */
 #define XEN_HYPER__DOMF_privileged       0
@@ -266,9 +274,11 @@
 #define XEN_HYPER_STR_PCPU	(0x32)
 #define XEN_HYPER_STR_INVALID	(-1)
 
-#define XEN_HYPER_DOMAIN_TYPE_IDLE	(0x0)
-#define XEN_HYPER_DOMAIN_TYPE_DOM0	(0x1)
-#define XEN_HYPER_DOMAIN_TYPE_GUEST	(0x2)
+#define XEN_HYPER_DOMAIN_TYPE_IO	(0x0)
+#define XEN_HYPER_DOMAIN_TYPE_XEN	(0x1)
+#define XEN_HYPER_DOMAIN_TYPE_IDLE	(0x2)
+#define XEN_HYPER_DOMAIN_TYPE_DOM0	(0x3)
+#define XEN_HYPER_DOMAIN_TYPE_GUEST	(0x4)
 #define XEN_HYPER_DOMAIN_TYPE_INVALID	(-1)
 
 #define XEN_HYPER_ELF_NOTE_FILL_T_NOTE		(0)
@@ -343,6 +353,7 @@
 	int pcpus;			/* number of physical cpu */
 	int vcpus;			/* number of virtual cpu */
 	int domains;			/* number of domain */
+	ulong sys_pages;
 	int crashing_cpu;
 	struct xen_hyper_vcpu_context *crashing_vcc;
 	ulong max_page;
@@ -410,6 +421,8 @@
 	struct xen_hyper_domain_context *context_array;
 	int context_array_cnt;
 	ulong running_domains;
+	struct xen_hyper_domain_context *dom_io;
+	struct xen_hyper_domain_context *dom_xen;
 	struct xen_hyper_domain_context *dom0;
 	struct xen_hyper_domain_context *idle_domain;
 	struct xen_hyper_domain_context *curr_domain;
@@ -503,6 +516,8 @@
 	long ELF_Signifo;
 	long ELF_Gregset;
 	long ELF_Timeval;
+	long arch_domain;
+	long arch_shared_info;
 	long cpu_info;
 	long cpu_time;
 	long cpu_user_regs;
@@ -517,9 +532,13 @@
 	long crash_xen_core_t;			/* elf note v3 */
 	long crash_xen_info_t;			/* elf note v3 */
 	long domain;
+#ifdef IA64
+	long mm_struct;
+#endif
 	long note_buf_t;			/* elf note v1 */
 	long schedule_data;
 	long scheduler;
+	long shared_info;
 	long timer;
 	long tss_struct;
 	long vcpu;
@@ -545,6 +564,14 @@
 	long ELF_Prstatus_pr_fpvalid;
 	long ELF_Timeval_tv_sec;
 	long ELF_Timeval_tv_usec;
+	/* arch_domain */
+#ifdef IA64
+	long arch_domain_mm;
+#endif
+	/* arch_shared_info */
+	long arch_shared_info_max_pfn;
+	long arch_shared_info_pfn_to_mfn_frame_list_list;
+	long arch_shared_info_nmi_reason;
 	/* cpu_info */
 	long cpu_info_guest_cpu_user_regs;
 	long cpu_info_processor_id;
@@ -588,6 +615,11 @@
 	long domain_domain_flags;
 	long domain_evtchn;
 	long domain_vcpu;
+	long domain_arch;
+#ifdef IA64
+	/* mm_struct */
+	long mm_struct_pgd;
+#endif
 	/* schedule_data */
 	long schedule_data_schedule_lock;
 	long schedule_data_curr;
@@ -610,6 +642,11 @@
 	long scheduler_adjust;
 	long scheduler_dump_settings;
 	long scheduler_dump_cpu_state;
+	/* shared_info */
+	long shared_info_vcpu_info;
+	long shared_info_evtchn_pending;
+	long shared_info_evtchn_mask;
+	long shared_info_arch;
 	/* timer */
 	long timer_expires;
 	long timer_cpu;
@@ -755,7 +792,7 @@
 /*
  * Prototype
  */
-ulonglong get_uptime_hyper(void);
+ulonglong xen_hyper_get_uptime_hyper(void);
 
 /*
  * x86
Index: xen_hyper_dump_tables.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/xen_hyper_dump_tables.c,v
retrieving revision 1.3
retrieving revision 1.3.8.4
diff -u -r1.3 -r1.3.8.4
--- xen_hyper_dump_tables.c	21 Feb 2007 22:58:33 -0000	1.3
+++ xen_hyper_dump_tables.c	24 Apr 2007 01:45:50 -0000	1.3.8.4
@@ -217,12 +217,16 @@
 		(buf, "%d\n", xht->vcpus));
 	XEN_HYPER_PRI(fp, len, "domains: ", buf, flag,
 		(buf, "%d\n", xht->domains));
+	XEN_HYPER_PRI(fp, len, "sys_pages: ", buf, flag,
+		(buf, "%lu\n", xht->sys_pages));
 	XEN_HYPER_PRI(fp, len, "crashing_cpu: ", buf, flag,
 		(buf, "%d\n", xht->crashing_cpu));
 	XEN_HYPER_PRI(fp, len, "crashing_vcc: ", buf, flag,
 		(buf, "%p\n", xht->crashing_vcc));
 	XEN_HYPER_PRI(fp, len, "max_page: ", buf, flag,
 		(buf, "%lu\n", xht->max_page));
+	XEN_HYPER_PRI(fp, len, "total_pages: ", buf, flag,
+		(buf, "%lu\n", xht->total_pages));
 	XEN_HYPER_PRI(fp, len, "cpumask: ", buf, flag,
 		(buf, "%p\n", xht->cpumask));
 	if (verbose && xht->cpumask) {
@@ -327,6 +331,10 @@
 		(buf, "%d\n", xhdt->context_array_cnt));
 	XEN_HYPER_PRI(fp, len, "running_domains: ", buf, flag,
 		(buf, "%lu\n", xhdt->running_domains));
+	XEN_HYPER_PRI(fp, len, "dom_io: ", buf, flag,
+		(buf, "%p\n", xhdt->dom_io));
+	XEN_HYPER_PRI(fp, len, "dom_xen: ", buf, flag,
+		(buf, "%p\n", xhdt->dom_xen));
 	XEN_HYPER_PRI(fp, len, "dom0: ", buf, flag,
 		(buf, "%p\n", xhdt->dom0));
 	XEN_HYPER_PRI(fp, len, "idle_domain: ", buf, flag,
@@ -488,6 +496,10 @@
 		(buf, "%ld\n", xen_hyper_size_table.ELF_Gregset));
 	XEN_HYPER_PRI(fp, len, "ELF_Timeval: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.ELF_Timeval));
+	XEN_HYPER_PRI(fp, len, "arch_domain: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_size_table.arch_domain));
+	XEN_HYPER_PRI(fp, len, "arch_shared_info: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_size_table.arch_shared_info));
 	XEN_HYPER_PRI(fp, len, "cpu_info: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.cpu_info));
 	XEN_HYPER_PRI(fp, len, "cpu_time: ", buf, flag,
@@ -516,12 +528,18 @@
 		(buf, "%ld\n", xen_hyper_size_table.crash_xen_info_t));
 	XEN_HYPER_PRI(fp, len, "domain: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.domain));
+#ifdef IA64
+	XEN_HYPER_PRI(fp, len, "mm_struct: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_size_table.mm_struct));
+#endif
 	XEN_HYPER_PRI(fp, len, "note_buf_t: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.note_buf_t));
 	XEN_HYPER_PRI(fp, len, "schedule_data: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.schedule_data));
 	XEN_HYPER_PRI(fp, len, "scheduler: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.scheduler));
+	XEN_HYPER_PRI(fp, len, "shared_info: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_size_table.shared_info));
 	XEN_HYPER_PRI(fp, len, "timer: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_size_table.timer));
 	XEN_HYPER_PRI(fp, len, "tss_struct: ", buf, flag,
@@ -543,7 +561,7 @@
 	char buf[XEN_HYPER_CMD_BUFSIZE];
 	int len, flag;
 
-	len = 37;
+	len = 45;
 	flag = XEN_HYPER_PRI_R;
 
 	XEN_HYPER_PRI(fp, len, "ELF_Prstatus_pr_info: ", buf, flag,
@@ -577,6 +595,18 @@
 	XEN_HYPER_PRI(fp, len, "ELF_Timeval_tv_usec: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_offset_table.ELF_Timeval_tv_usec));
 
+#ifdef IA64
+	XEN_HYPER_PRI(fp, len, "arch_domain_mm: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.arch_domain_mm));
+#endif
+
+	XEN_HYPER_PRI(fp, len, "arch_shared_info_max_pfn: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.arch_shared_info_max_pfn));
+	XEN_HYPER_PRI(fp, len, "arch_shared_info_pfn_to_mfn_frame_list_list: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.arch_shared_info_pfn_to_mfn_frame_list_list));
+	XEN_HYPER_PRI(fp, len, "arch_shared_info_nmi_reason: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.arch_shared_info_nmi_reason));
+
 	XEN_HYPER_PRI(fp, len, "cpu_info_guest_cpu_user_regs: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_offset_table.cpu_info_guest_cpu_user_regs));
 	XEN_HYPER_PRI(fp, len, "cpu_info_processor_id: ", buf, flag,
@@ -649,6 +679,11 @@
 	XEN_HYPER_PRI(fp, len, "domain_vcpu: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_offset_table.domain_vcpu));
 
+#ifdef IA64
+	XEN_HYPER_PRI(fp, len, "mm_struct_pgd: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.mm_struct_pgd));
+#endif
+
 	XEN_HYPER_PRI(fp, len, "schedule_data_schedule_lock: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_offset_table.schedule_data_schedule_lock));
 	XEN_HYPER_PRI(fp, len, "schedule_data_curr: ", buf, flag,
@@ -690,6 +725,15 @@
 		(buf, "%ld\n", xen_hyper_offset_table.scheduler_dump_settings));
 	XEN_HYPER_PRI(fp, len, "scheduler_dump_cpu_state: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_offset_table.scheduler_dump_cpu_state));
+
+	XEN_HYPER_PRI(fp, len, "shared_info_vcpu_info: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.shared_info_vcpu_info));
+	XEN_HYPER_PRI(fp, len, "shared_info_evtchn_pending: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.shared_info_evtchn_pending));
+	XEN_HYPER_PRI(fp, len, "shared_info_evtchn_mask: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.shared_info_evtchn_mask));
+	XEN_HYPER_PRI(fp, len, "shared_info_arch: ", buf, flag,
+		(buf, "%ld\n", xen_hyper_offset_table.shared_info_arch));
 
 	XEN_HYPER_PRI(fp, len, "timer_expires: ", buf, flag,
 		(buf, "%ld\n", xen_hyper_offset_table.timer_expires));
Index: xen_hyper_global_data.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/xen_hyper_global_data.c,v
retrieving revision 1.3
retrieving revision 1.3.6.5
diff -u -r1.3 -r1.3.6.5
--- xen_hyper_global_data.c	22 Mar 2007 02:08:13 -0000	1.3
+++ xen_hyper_global_data.c	24 Apr 2007 02:07:01 -0000	1.3.6.5
@@ -131,12 +131,14 @@
 "    1. the DOMAIN-ID.",
 "    2. the struct domain pointer.",
 "    3. the domain state (SH, DY, CP, PO, PA, RU).",
-"    4. the TYPE of domain(I, 0, G).",
-"    5. displays percentage of page of max_pages member of domain",
-"       for max_page of system.",
-"    6. displays percentage of page of tot_pages member of domain" ,
-"       for max_page of system." ,
+"    4. the TYPE of domain.",
+"       (O:dom_io, X:dom_xen, I:idle domain, 0:domain 0, U:domain U).",
+"    5. displays max_pages member of domain.",
+"    6. displays tot_pages member of domain.",
 "    7. a number of vcpu that domain is assigned.",
+"    8. the shared_info pointer of domain.",
+"    9. frame containing list of mfns containing list of mfns" ,
+"       containing p2m.",
 " ",
 "  The active domain on each CPU will be highlighted by an angle ",
 "  bracket (\">\") preceding its information.",
@@ -145,11 +147,13 @@
 "\nEXAMPLES",
 "  Show the domain status of all:\n",
 "    %s> doms",
-"       DID   DOMAIN  ST T %MMEM %TMEM VCPU",
-"      32767 ffbfc080 RU I   0.0   0.0   2",
-"    >*    0 ff198080 RU 0 100.0  79.0   2",
-"          4 ffbee080 RU G   6.3   6.3   2",
-"          5 ff186080 RU G   6.3   6.3   2",
+"       DID   DOMAIN  ST T  MAXPAGE  TOTPAGE VCPU SHARED_I  P2M_MFN",
+"      32753 ffbf8080 RU O     0        0      0      0      ----",
+"      32754 ffbfa080 RU X     0        0      0      0      ----",
+"      32767 ffbfc080 RU I     0        0      2      0      ----",
+"    >*    0 ff198080 RU 0 ffffffff   32900    2  ff194000   18d0",
+"          4 ffbee080 RU U   4000     4000     2  ff18d000   3eb92",
+"          5 ff186080 RU U   4000     4000     2  ff184000   298d3",
 "    %s>",
 NULL               
 };
@@ -313,7 +317,7 @@
 char *xen_hyper_help_sched[] = {
 "pcpus",
 "display scheduler information",
-"[-r][-t] [pcpu-id] ...",
+"[-v] [pcpu-id] ...",
 "  This command displays scheduler information for selected, or all, cpus" ,
 "       pcpu-id  a physical cpu id.",
 "            -v  display verbosely scheduler information.",
