All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix module module_init/init_size offsets for v4.5 kernel
@ 2016-10-28  5:07 Kamalesh Babulal
  2016-10-28  6:17 ` Pratyush Anand
  2016-10-28  6:18 ` Pratyush Anand
  0 siblings, 2 replies; 6+ messages in thread
From: Kamalesh Babulal @ 2016-10-28  5:07 UTC (permalink / raw)
  To: kexec; +Cc: Pratyush Anand, Kamalesh Babulal

Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
encapsulates core_layout and init_layout into module_layout structure.

commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
fixes offset value calculation for core layout's base and size, whereas
Kernel v4.5 module changes also needs fixing of module init_size and
module_init for the makedumpfile to read the correct module address.

This patch fixes calculation of offsets values for module init_size and
module_init.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Pratyush Anand <panand@redhat.com>
---
 makedumpfile.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/makedumpfile.c b/makedumpfile.c
index 853b999..f33a90d 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -1689,7 +1689,25 @@ get_structure_info(void)
 		OFFSET(module.core_size) += core_layout;
 	}
 	OFFSET_INIT(module.module_init, "module", "module_init");
+	if (OFFSET(module.module_init) == NOT_FOUND_STRUCTURE) {
+		/* for kernel version 4.5 and above */
+		long init_layout;
+
+		OFFSET_INIT(module.module_init, "module", "init_layout");
+		init_layout = OFFSET(module.module_init);
+		OFFSET_INIT(module.module_init, "module_layout", "base");
+		OFFSET(module.module_init) += init_layout;
+	}
 	OFFSET_INIT(module.init_size, "module", "init_size");
+	if (OFFSET(module.init_size) == NOT_FOUND_STRUCTURE) {
+		/* for kernel version 4.5 and above */
+		long init_layout;
+
+		OFFSET_INIT(module.init_size, "module", "init_layout");
+		init_layout = OFFSET(module.init_size);
+		OFFSET_INIT(module.init_size, "module_layout", "size");
+		OFFSET(module.init_size) += init_layout;
+	}
 
 	ENUM_NUMBER_INIT(NR_FREE_PAGES, "NR_FREE_PAGES");
 	ENUM_NUMBER_INIT(N_ONLINE, "N_ONLINE");
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix module module_init/init_size offsets for v4.5 kernel
  2016-10-28  5:07 [PATCH] Fix module module_init/init_size offsets for v4.5 kernel Kamalesh Babulal
@ 2016-10-28  6:17 ` Pratyush Anand
  2016-10-28  6:18 ` Pratyush Anand
  1 sibling, 0 replies; 6+ messages in thread
From: Pratyush Anand @ 2016-10-28  6:17 UTC (permalink / raw)
  To: Kamalesh Babulal, kexec



On Friday 28 October 2016 10:37 AM, Kamalesh Babulal wrote:
> Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
> encapsulates core_layout and init_layout into module_layout structure.
>
> commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
> fixes offset value calculation for core layout's base and size, whereas
> Kernel v4.5 module changes also needs fixing of module init_size and
> module_init for the makedumpfile to read the correct module address.
>
> This patch fixes calculation of offsets values for module init_size and
> module_init.
>
> Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
> Cc: Pratyush Anand <panand@redhat.com>

Reviewed-by: Pratyush Anand <panand@redhat.com>

> ---
>  makedumpfile.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/makedumpfile.c b/makedumpfile.c
> index 853b999..f33a90d 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -1689,7 +1689,25 @@ get_structure_info(void)
>  		OFFSET(module.core_size) += core_layout;
>  	}
>  	OFFSET_INIT(module.module_init, "module", "module_init");
> +	if (OFFSET(module.module_init) == NOT_FOUND_STRUCTURE) {
> +		/* for kernel version 4.5 and above */
> +		long init_layout;
> +
> +		OFFSET_INIT(module.module_init, "module", "init_layout");
> +		init_layout = OFFSET(module.module_init);
> +		OFFSET_INIT(module.module_init, "module_layout", "base");
> +		OFFSET(module.module_init) += init_layout;
> +	}
>  	OFFSET_INIT(module.init_size, "module", "init_size");
> +	if (OFFSET(module.init_size) == NOT_FOUND_STRUCTURE) {
> +		/* for kernel version 4.5 and above */
> +		long init_layout;
> +
> +		OFFSET_INIT(module.init_size, "module", "init_layout");
> +		init_layout = OFFSET(module.init_size);
> +		OFFSET_INIT(module.init_size, "module_layout", "size");
> +		OFFSET(module.init_size) += init_layout;
> +	}
>
>  	ENUM_NUMBER_INIT(NR_FREE_PAGES, "NR_FREE_PAGES");
>  	ENUM_NUMBER_INIT(N_ONLINE, "N_ONLINE");
>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix module module_init/init_size offsets for v4.5 kernel
  2016-10-28  5:07 [PATCH] Fix module module_init/init_size offsets for v4.5 kernel Kamalesh Babulal
  2016-10-28  6:17 ` Pratyush Anand
@ 2016-10-28  6:18 ` Pratyush Anand
  2016-10-28  6:36   ` Atsushi Kumagai
  1 sibling, 1 reply; 6+ messages in thread
From: Pratyush Anand @ 2016-10-28  6:18 UTC (permalink / raw)
  To: Kamalesh Babulal, kexec



On Friday 28 October 2016 10:37 AM, Kamalesh Babulal wrote:
> Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
> encapsulates core_layout and init_layout into module_layout structure.
>
> commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
> fixes offset value calculation for core layout's base and size, whereas
> Kernel v4.5 module changes also needs fixing of module init_size and
> module_init for the makedumpfile to read the correct module address.
>
> This patch fixes calculation of offsets values for module init_size and
> module_init.
>
> Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
> Cc: Pratyush Anand <panand@redhat.com>

Reviewed-by: Pratyush Anand <panand@redhat.com>

> ---
>  makedumpfile.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/makedumpfile.c b/makedumpfile.c
> index 853b999..f33a90d 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -1689,7 +1689,25 @@ get_structure_info(void)
>  		OFFSET(module.core_size) += core_layout;
>  	}
>  	OFFSET_INIT(module.module_init, "module", "module_init");
> +	if (OFFSET(module.module_init) == NOT_FOUND_STRUCTURE) {
> +		/* for kernel version 4.5 and above */
> +		long init_layout;
> +
> +		OFFSET_INIT(module.module_init, "module", "init_layout");
> +		init_layout = OFFSET(module.module_init);
> +		OFFSET_INIT(module.module_init, "module_layout", "base");
> +		OFFSET(module.module_init) += init_layout;
> +	}
>  	OFFSET_INIT(module.init_size, "module", "init_size");
> +	if (OFFSET(module.init_size) == NOT_FOUND_STRUCTURE) {
> +		/* for kernel version 4.5 and above */
> +		long init_layout;
> +
> +		OFFSET_INIT(module.init_size, "module", "init_layout");
> +		init_layout = OFFSET(module.init_size);
> +		OFFSET_INIT(module.init_size, "module_layout", "size");
> +		OFFSET(module.init_size) += init_layout;
> +	}
>
>  	ENUM_NUMBER_INIT(NR_FREE_PAGES, "NR_FREE_PAGES");
>  	ENUM_NUMBER_INIT(N_ONLINE, "N_ONLINE");
>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] Fix module module_init/init_size offsets for v4.5 kernel
  2016-10-28  6:18 ` Pratyush Anand
@ 2016-10-28  6:36   ` Atsushi Kumagai
  2016-10-28 12:17     ` Kamalesh Babulal
  0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Kumagai @ 2016-10-28  6:36 UTC (permalink / raw)
  To: Pratyush Anand, Kamalesh Babulal; +Cc: kexec

Hello Kamalesh and Pratyush,

>On Friday 28 October 2016 10:37 AM, Kamalesh Babulal wrote:
>> Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
>> encapsulates core_layout and init_layout into module_layout structure.
>>
>> commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
>> fixes offset value calculation for core layout's base and size, whereas
>> Kernel v4.5 module changes also needs fixing of module init_size and
>> module_init for the makedumpfile to read the correct module address.
>>
>> This patch fixes calculation of offsets values for module init_size and
>> module_init.
>>
>> Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
>> Cc: Pratyush Anand <panand@redhat.com>
>
>Reviewed-by: Pratyush Anand <panand@redhat.com>

Thanks, but I think Guenther posted the same fix which you can see
in the devel branch:

commit 32dd46803944959f78e01e7c4847c465efca99a6
Author: Guenther Hutzl <hutzl@linux.vnet.ibm.com>
Date:   Wed Jul 6 20:00:54 2016 +0900

    [PATCH] Fix module init base and size offset for kernel v4.5

    This is a follow-up patch on the patch provided in post:

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


Thanks,
Atsushi Kumagai


>> ---
>>  makedumpfile.c | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/makedumpfile.c b/makedumpfile.c
>> index 853b999..f33a90d 100644
>> --- a/makedumpfile.c
>> +++ b/makedumpfile.c
>> @@ -1689,7 +1689,25 @@ get_structure_info(void)
>>  		OFFSET(module.core_size) += core_layout;
>>  	}
>>  	OFFSET_INIT(module.module_init, "module", "module_init");
>> +	if (OFFSET(module.module_init) == NOT_FOUND_STRUCTURE) {
>> +		/* for kernel version 4.5 and above */
>> +		long init_layout;
>> +
>> +		OFFSET_INIT(module.module_init, "module", "init_layout");
>> +		init_layout = OFFSET(module.module_init);
>> +		OFFSET_INIT(module.module_init, "module_layout", "base");
>> +		OFFSET(module.module_init) += init_layout;
>> +	}
>>  	OFFSET_INIT(module.init_size, "module", "init_size");
>> +	if (OFFSET(module.init_size) == NOT_FOUND_STRUCTURE) {
>> +		/* for kernel version 4.5 and above */
>> +		long init_layout;
>> +
>> +		OFFSET_INIT(module.init_size, "module", "init_layout");
>> +		init_layout = OFFSET(module.init_size);
>> +		OFFSET_INIT(module.init_size, "module_layout", "size");
>> +		OFFSET(module.init_size) += init_layout;
>> +	}
>>
>>  	ENUM_NUMBER_INIT(NR_FREE_PAGES, "NR_FREE_PAGES");
>>  	ENUM_NUMBER_INIT(N_ONLINE, "N_ONLINE");
>>
>
>_______________________________________________
>kexec mailing list
>kexec@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix module module_init/init_size offsets for v4.5 kernel
  2016-10-28  6:36   ` Atsushi Kumagai
@ 2016-10-28 12:17     ` Kamalesh Babulal
  2016-10-31  6:17       ` Atsushi Kumagai
  0 siblings, 1 reply; 6+ messages in thread
From: Kamalesh Babulal @ 2016-10-28 12:17 UTC (permalink / raw)
  To: Atsushi Kumagai, Pratyush Anand; +Cc: kexec



On Friday 28 October 2016 12:06 PM, Atsushi Kumagai wrote:
>> >On Friday 28 October 2016 10:37 AM, Kamalesh Babulal wrote:
>>> >>Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
>>> >>encapsulates core_layout and init_layout into module_layout structure.
>>> >>
>>> >>commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
>>> >>fixes offset value calculation for core layout's base and size, whereas
>>> >>Kernel v4.5 module changes also needs fixing of module init_size and
>>> >>module_init for the makedumpfile to read the correct module address.
>>> >>
>>> >>This patch fixes calculation of offsets values for module init_size and
>>> >>module_init.
>>> >>
>>> >>Signed-off-by: Kamalesh Babulal<kamalesh@linux.vnet.ibm.com>
>>> >>Cc: Pratyush Anand<panand@redhat.com>
>> >
>> >Reviewed-by: Pratyush Anand<panand@redhat.com>
> Thanks, but I think Guenther posted the same fix which you can see
> in the devel branch:
>
> commit 32dd46803944959f78e01e7c4847c465efca99a6
> Author: Guenther Hutzl<hutzl@linux.vnet.ibm.com>
> Date:   Wed Jul 6 20:00:54 2016 +0900
>
>      [PATCH] Fix module init base and size offset for kernel v4.5

Thank you for pointing out the commit. Should I rebase future patch
against devel branch.

Thanks,
Kamalesh.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] Fix module module_init/init_size offsets for v4.5 kernel
  2016-10-28 12:17     ` Kamalesh Babulal
@ 2016-10-31  6:17       ` Atsushi Kumagai
  0 siblings, 0 replies; 6+ messages in thread
From: Atsushi Kumagai @ 2016-10-31  6:17 UTC (permalink / raw)
  To: Kamalesh Babulal; +Cc: Pratyush Anand, kexec

>On Friday 28 October 2016 12:06 PM, Atsushi Kumagai wrote:
>>> >On Friday 28 October 2016 10:37 AM, Kamalesh Babulal wrote:
>>>> >>Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
>>>> >>encapsulates core_layout and init_layout into module_layout structure.
>>>> >>
>>>> >>commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
>>>> >>fixes offset value calculation for core layout's base and size, whereas
>>>> >>Kernel v4.5 module changes also needs fixing of module init_size and
>>>> >>module_init for the makedumpfile to read the correct module address.
>>>> >>
>>>> >>This patch fixes calculation of offsets values for module init_size and
>>>> >>module_init.
>>>> >>
>>>> >>Signed-off-by: Kamalesh Babulal<kamalesh@linux.vnet.ibm.com>
>>>> >>Cc: Pratyush Anand<panand@redhat.com>
>>> >
>>> >Reviewed-by: Pratyush Anand<panand@redhat.com>
>> Thanks, but I think Guenther posted the same fix which you can see
>> in the devel branch:
>>
>> commit 32dd46803944959f78e01e7c4847c465efca99a6
>> Author: Guenther Hutzl<hutzl@linux.vnet.ibm.com>
>> Date:   Wed Jul 6 20:00:54 2016 +0900
>>
>>      [PATCH] Fix module init base and size offset for kernel v4.5
>
>Thank you for pointing out the commit. Should I rebase future patch
>against devel branch.

Yes, I recommend that. It's better also for me to review.

Thanks,
Atsushi Kumagai

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-31  6:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28  5:07 [PATCH] Fix module module_init/init_size offsets for v4.5 kernel Kamalesh Babulal
2016-10-28  6:17 ` Pratyush Anand
2016-10-28  6:18 ` Pratyush Anand
2016-10-28  6:36   ` Atsushi Kumagai
2016-10-28 12:17     ` Kamalesh Babulal
2016-10-31  6:17       ` Atsushi Kumagai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.