]> xenbits.xensource.com Git - xen.git/commitdiff
kexec: correct _domain offset info in elf-notes
authorKeir Fraser <keir@xen.org>
Thu, 6 Jan 2011 19:02:36 +0000 (19:02 +0000)
committerKeir Fraser <keir@xen.org>
Thu, 6 Jan 2011 19:02:36 +0000 (19:02 +0000)
The hypervisor writes some data structure infos into the elf note
section of the vmcore to enable interpretation of the xen structures
by kexec/kdump.

The info of the offset of _domain in page_info was just wrong on
non-ia64 systems.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
xen/common/kexec.c
xen/include/xen/kexec.h

index 989907b98d33243ac1dd3ef753226402112f23fb..f889e5bb22c3bb5877e617ac598d43c098269362 100644 (file)
@@ -465,7 +465,11 @@ static void crash_save_vmcoreinfo(void)
     VMCOREINFO_STRUCT_SIZE(domain);
 
     VMCOREINFO_OFFSET(page_info, count_info);
-    VMCOREINFO_OFFSET_ALIAS(page_info, u, _domain);
+#ifdef __ia64__
+    VMCOREINFO_OFFSET_SUB(page_info, u.inuse, _domain);
+#else
+    VMCOREINFO_OFFSET_SUB(page_info, v.inuse, _domain);
+#endif
     VMCOREINFO_OFFSET(domain, domain_id);
     VMCOREINFO_OFFSET(domain, next_in_list);
 
index fb1e6b59b1a492f94f516f0fc28a222d62ebee6b..9b51004c38452ee118306a44419595fa9b4c5a54 100644 (file)
@@ -52,9 +52,9 @@ void vmcoreinfo_append_str(const char *fmt, ...)
 #define VMCOREINFO_OFFSET(name, field) \
        vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
                              (unsigned long)offsetof(struct name, field))
-#define VMCOREINFO_OFFSET_ALIAS(name, field, alias) \
-       vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #alias, \
-                             (unsigned long)offsetof(struct name, field))
+#define VMCOREINFO_OFFSET_SUB(name, sub, field) \
+       vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
+                             (unsigned long)offsetof(struct name, sub.field))
 
 #endif /* __XEN_KEXEC_H__ */