[PATCH] makedumpfile: fix module core base and size offset for kernel v4.5

Atsushi Kumagai ats-kumagai at wm.jp.nec.com
Tue Apr 19 00:41:11 PDT 2016


Hello Pratyush,

>Following commit in kernel v4.5 changed struct module, which affects offset
>calculation of core layout's base and size.
>
>commit 7523e4dc5057e157212b4741abd6256e03404cf1
>Author: Rusty Russell <rusty at rustcorp.com.au>
>Date:   Thu Nov 26 09:44:08 2015 +1030
>
>    module: use a structure to encapsulate layout.
>
>This patch fixes makedumpfile code to cater above kernel modification.
>
>Signed-off-by: Pratyush Anand <panand at redhat.com>

This patch fixes only the path for -x, but the symbols are only used for
--config(erase command) which requires vmlinux.
So we don't need to fix the VMCOREINFO path, I got it.

I'll merge this patch into v1.6.0, thanks.

Regards,
Atsushi Kumagai

>---
> makedumpfile.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
>diff --git a/makedumpfile.c b/makedumpfile.c
>index 94c969c16ccc..12227ea1fbd8 100644
>--- a/makedumpfile.c
>+++ b/makedumpfile.c
>@@ -1669,7 +1669,25 @@ get_structure_info(void)
> 	OFFSET_INIT(module.list, "module", "list");
> 	OFFSET_INIT(module.name, "module", "name");
> 	OFFSET_INIT(module.module_core, "module", "module_core");
>+	if (OFFSET(module.module_core) == NOT_FOUND_STRUCTURE) {
>+		/* for kernel version 4.5 and above */
>+		long core_layout;
>+
>+		OFFSET_INIT(module.module_core, "module", "core_layout");
>+		core_layout = OFFSET(module.module_core);
>+		OFFSET_INIT(module.module_core, "module_layout", "base");
>+		OFFSET(module.module_core) += core_layout;
>+	}
> 	OFFSET_INIT(module.core_size, "module", "core_size");
>+	if (OFFSET(module.core_size) == NOT_FOUND_STRUCTURE) {
>+		/* for kernel version 4.5 and above */
>+		long core_layout;
>+
>+		OFFSET_INIT(module.core_size, "module", "core_layout");
>+		core_layout = OFFSET(module.core_size);
>+		OFFSET_INIT(module.core_size, "module_layout", "size");
>+		OFFSET(module.core_size) += core_layout;
>+	}
> 	OFFSET_INIT(module.module_init, "module", "module_init");
> 	OFFSET_INIT(module.init_size, "module", "init_size");
>
>--
>2.5.0



More information about the kexec mailing list