From 84be7c5af430f29af3db1304c763281579b04d4f Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 6 Jan 2011 19:02:36 +0000 Subject: [PATCH] kexec: correct _domain offset info in elf-notes 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 --- xen/common/kexec.c | 6 +++++- xen/include/xen/kexec.h | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/common/kexec.c b/xen/common/kexec.c index 989907b98d..f889e5bb22 100644 --- a/xen/common/kexec.c +++ b/xen/common/kexec.c @@ -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); diff --git a/xen/include/xen/kexec.h b/xen/include/xen/kexec.h index fb1e6b59b1..9b51004c38 100644 --- a/xen/include/xen/kexec.h +++ b/xen/include/xen/kexec.h @@ -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__ */ -- 2.39.5