Skip to contentSkip to conversation

Do not fail for symbols removed in Xen4

PATCH In review Petr Tesarik 1 participant 1 message Aug 24, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 9/9 Do not fail for symbols removed in Xen4

Xen-4.0+ removes some of the symbols that were necessary to process dump files on Xen-3, and makedumpfile fails if they are not found.

Since most of these symbols are not needed for Xen4, we can simply remove the checks. The only exception is "frame_table". This used to be a global variable holding the address of the array of struct page_info. In Xen-4.0 the array is always located at a fixed address in virtual address space. Xen adds a compatibility symbol for VMCOREINFO, but a "frame_table" symbol does not exist as such, so we must use the fixed address instead.

---
 arch/ia64.c    |   41 ++++++++++++++++++++++-------------------
 arch/x86.c     |   49 ++++++++++++++++++++++++++-----------------------
 arch/x86_64.c  |   49 ++++++++++++++++++++++++++-----------------------
 makedumpfile.c |   37 ++++++++++++++++++++-----------------
 4 files changed, 94 insertions(+), 82 deletions(-)
makedumpfile.c +20 -17
@@ -5377,23 +5377,26 @@ get_xen_info(void)
 	if (!get_xen_basic_info_arch())
 		return FALSE;
 
-	if (SYMBOL(alloc_bitmap) == NOT_FOUND_SYMBOL) {
-		ERRMSG("Can't get the symbol of alloc_bitmap.\n");
-		return FALSE;
-	}
-	if (!readmem(VADDR_XEN, SYMBOL(alloc_bitmap), &info->alloc_bitmap,
-	      sizeof(info->alloc_bitmap))) {
-		ERRMSG("Can't get the value of alloc_bitmap.\n");
-		return FALSE;
-	}
-	if (SYMBOL(max_page) == NOT_FOUND_SYMBOL) {
-		ERRMSG("Can't get the symbol of max_page.\n");
-		return FALSE;
-	}
-	if (!readmem(VADDR_XEN, SYMBOL(max_page), &info->max_page,
-	    sizeof(info->max_page))) {
-		ERRMSG("Can't get the value of max_page.\n");
-		return FALSE;
+	if (!info->xen_crash_info.com ||
+	    info->xen_crash_info.com->xen_major_version < 4) {
+		if (SYMBOL(alloc_bitmap) == NOT_FOUND_SYMBOL) {
+			ERRMSG("Can't get the symbol of alloc_bitmap.\n");
+			return FALSE;
+		}
+		if (!readmem(VADDR_XEN, SYMBOL(alloc_bitmap), &info->alloc_bitmap,
+		      sizeof(info->alloc_bitmap))) {
+			ERRMSG("Can't get the value of alloc_bitmap.\n");
+			return FALSE;
+		}
+		if (SYMBOL(max_page) == NOT_FOUND_SYMBOL) {
+			ERRMSG("Can't get the symbol of max_page.\n");
+			return FALSE;
+		}
+		if (!readmem(VADDR_XEN, SYMBOL(max_page), &info->max_page,
+		    sizeof(info->max_page))) {
+			ERRMSG("Can't get the value of max_page.\n");
+			return FALSE;
+		}
 	}
 
 	/*
arch/ia64.c +0 -0
@@ -335,26 +335,29 @@ get_xen_basic_info_ia64(void)
 
 	info->frame_table_vaddr = VIRT_FRAME_TABLE_ADDR; /* "frame_table" is same 

value */

- if (SYMBOL(xenheap_phys_end) == NOT_FOUND_SYMBOL) {
- ERRMSG("Can't get the symbol of xenheap_phys_end.\n");
- return FALSE;
+ if (!info->xen_crash_info.com ||
+ info->xen_crash_info.com->xen_major_version < 4) {
+ if (SYMBOL(xenheap_phys_end) == NOT_FOUND_SYMBOL) {
+ ERRMSG("Can't get the symbol of xenheap_phys_end.\n");
+ return FALSE;
+ }
+ if (!readmem(VADDR_XEN, SYMBOL(xenheap_phys_end), &xen_end,
+ sizeof(xen_end))) {
+ ERRMSG("Can't get the value of xenheap_phys_end.\n");
+ return FALSE;
+ }
+ if (SYMBOL(xen_pstart) == NOT_FOUND_SYMBOL) {
+ ERRMSG("Can't get the symbol of xen_pstart.\n");
+ return FALSE;
+ }
+ if (!readmem(VADDR_XEN, SYMBOL(xen_pstart), &xen_start,
+ sizeof(xen_start))) {
+ ERRMSG("Can't get the value of xen_pstart.\n");
+ return FALSE;
+ }
+ info->xen_heap_start = paddr_to_pfn(xen_start);
+ info->xen_heap_end = paddr_to_pfn(xen_end);
}
- if (!readmem(VADDR_XEN, SYMBOL(xenheap_phys_end), &xen_end,
- sizeof(xen_end))) {
- ERRMSG("Can't get the value of xenheap_phys_end.\n");
- return FALSE;
- }
- if (SYMBOL(xen_pstart) == NOT_FOUND_SYMBOL) {
- ERRMSG("Can't get the symbol of xen_pstart.\n");
- return FALSE;
- }
- if (!readmem(VADDR_XEN, SYMBOL(xen_pstart), &xen_start,
- sizeof(xen_start))) {
- ERRMSG("Can't get the value of xen_pstart.\n");
- return FALSE;
- }
- info->xen_heap_start = paddr_to_pfn(xen_start);
- info->xen_heap_end = paddr_to_pfn(xen_end);

return TRUE;
}

arch/x86_64.c +26 -23

63 lines not on this page · raw message

arch/x86.c +26 -23

63 lines not on this page · raw message

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec