linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] kexec : add sparse memory related values to vmcore
@ 2014-05-28 13:49 Liu Hua
  2014-05-29  0:13 ` Simon Horman
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Hua @ 2014-05-28 13:49 UTC (permalink / raw)
  To: ebiederm
  Cc: kexec, kumagai-atsushi, anderson, peifeiyue, wangnan0,
	linux-kernel, liusdu, hui.geng, Liu Hua

This patch deales with sparse memory model.

For ARM32 platforms, different vendors may define different
SECTION_SIZE_BITS, which we did not write to vmcore.

For example:

  1 arch/arm/mach-clps711x/include/mach/memory.h
    #define SECTION_SIZE_BITS 24
  2 arch/arm/mach-exynos/include/mach/memory.h
    #define SECTION_SIZE_BITS 28
  3 arch/arm/mach-sa1100/include/mach/memory.h
    #define SECTION_SIZE_BITS 27

It is really a bad news for user space tools such as
makedumpfile and crash, who have to defines them as
macros. So for the same architecture, we may need to
recomile them to parse vmcores with different
SECTION_SIZE_BITS.

And if we enable LPAE, MAX_PHYSMEM_SIZE can alse
be variable.

This patch adds these SECTION_SIZE_BITS and MAX_PHYSMEM_SIZE
to vmcore. which makes user space tools more compatible.

BTW, makedumpfile has queued the related patch.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
---
 kernel/kexec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/kexec.c b/kernel/kexec.c
index bf0b929e..8b1a193 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1577,6 +1577,8 @@ static int __init crash_save_vmcoreinfo_init(void)
 	VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
 	VMCOREINFO_STRUCT_SIZE(mem_section);
 	VMCOREINFO_OFFSET(mem_section, section_mem_map);
+	VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
+	VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
 #endif
 	VMCOREINFO_STRUCT_SIZE(page);
 	VMCOREINFO_STRUCT_SIZE(pglist_data);
-- 
1.9.0


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

* Re: [RESEND PATCH] kexec : add sparse memory related values to vmcore
  2014-05-28 13:49 [RESEND PATCH] kexec : add sparse memory related values to vmcore Liu Hua
@ 2014-05-29  0:13 ` Simon Horman
  2014-05-30  8:14   ` Liu hua
  2014-06-03  1:26   ` Liu hua
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Horman @ 2014-05-29  0:13 UTC (permalink / raw)
  To: Liu Hua
  Cc: ebiederm, wangnan0, peifeiyue, liusdu, kexec, linux-kernel,
	hui.geng, kumagai-atsushi, anderson

On Wed, May 28, 2014 at 09:49:56PM +0800, Liu Hua wrote:
> This patch deales with sparse memory model.
> 
> For ARM32 platforms, different vendors may define different
> SECTION_SIZE_BITS, which we did not write to vmcore.
> 
> For example:
> 
>   1 arch/arm/mach-clps711x/include/mach/memory.h
>     #define SECTION_SIZE_BITS 24
>   2 arch/arm/mach-exynos/include/mach/memory.h
>     #define SECTION_SIZE_BITS 28
>   3 arch/arm/mach-sa1100/include/mach/memory.h
>     #define SECTION_SIZE_BITS 27

I wonder if this problem will eventually go away, or at least only
apply to older platforms, as ARM moves towards multiplatform: a single
kernel for more than one platform.

> It is really a bad news for user space tools such as
> makedumpfile and crash, who have to defines them as
> macros. So for the same architecture, we may need to
> recomile them to parse vmcores with different
> SECTION_SIZE_BITS.
> 
> And if we enable LPAE, MAX_PHYSMEM_SIZE can alse
> be variable.
> 
> This patch adds these SECTION_SIZE_BITS and MAX_PHYSMEM_SIZE
> to vmcore. which makes user space tools more compatible.
> 
> BTW, makedumpfile has queued the related patch.
> 
> Signed-off-by: Liu Hua <sdu.liu@huawei.com>
> ---
>  kernel/kexec.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index bf0b929e..8b1a193 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -1577,6 +1577,8 @@ static int __init crash_save_vmcoreinfo_init(void)
>  	VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
>  	VMCOREINFO_STRUCT_SIZE(mem_section);
>  	VMCOREINFO_OFFSET(mem_section, section_mem_map);
> +	VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
> +	VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
>  #endif
>  	VMCOREINFO_STRUCT_SIZE(page);
>  	VMCOREINFO_STRUCT_SIZE(pglist_data);
> -- 
> 1.9.0
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 

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

* Re: [RESEND PATCH] kexec : add sparse memory related values to vmcore
  2014-05-29  0:13 ` Simon Horman
@ 2014-05-30  8:14   ` Liu hua
  2014-06-02  0:01     ` Simon Horman
  2014-06-03  1:26   ` Liu hua
  1 sibling, 1 reply; 5+ messages in thread
From: Liu hua @ 2014-05-30  8:14 UTC (permalink / raw)
  To: Simon Horman
  Cc: wangnan0, peifeiyue, liusdu, kexec, linux-kernel, hui.geng,
	kumagai-atsushi, ebiederm, anderson, linux-arm-kernel

On 2014/5/29 8:13, Simon Horman wrote:
> On Wed, May 28, 2014 at 09:49:56PM +0800, Liu Hua wrote:
>> This patch deales with sparse memory model.
>>
>> For ARM32 platforms, different vendors may define different
>> SECTION_SIZE_BITS, which we did not write to vmcore.
>>
>> For example:
>>
>>   1 arch/arm/mach-clps711x/include/mach/memory.h
>>     #define SECTION_SIZE_BITS 24
>>   2 arch/arm/mach-exynos/include/mach/memory.h
>>     #define SECTION_SIZE_BITS 28
>>   3 arch/arm/mach-sa1100/include/mach/memory.h
>>     #define SECTION_SIZE_BITS 27
> 
> I wonder if this problem will eventually go away, or at least only
> apply to older platforms, as ARM moves towards multiplatform: a single
> kernel for more than one platform.

For ARM32 platform, it may cost a long time. And when glancing over
the commit log of kernel, we can find this macro changed several times.
The user space tools must take care of all these changed for compatibility.

> 
>> It is really a bad news for user space tools such as
>> makedumpfile and crash, who have to defines them as
>> macros. So for the same architecture, we may need to
>> recomile them to parse vmcores with different
>> SECTION_SIZE_BITS.
>>
>> And if we enable LPAE, MAX_PHYSMEM_SIZE can alse
>> be variable.
>>
>> This patch adds these SECTION_SIZE_BITS and MAX_PHYSMEM_SIZE
>> to vmcore. which makes user space tools more compatible.
>>
>> BTW, makedumpfile has queued the related patch.
>>
>> Signed-off-by: Liu Hua <sdu.liu@huawei.com>
>> ---
>>  kernel/kexec.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/kexec.c b/kernel/kexec.c
>> index bf0b929e..8b1a193 100644
>> --- a/kernel/kexec.c
>> +++ b/kernel/kexec.c
>> @@ -1577,6 +1577,8 @@ static int __init crash_save_vmcoreinfo_init(void)
>>  	VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
>>  	VMCOREINFO_STRUCT_SIZE(mem_section);
>>  	VMCOREINFO_OFFSET(mem_section, section_mem_map);
>> +	VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
>> +	VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
>>  #endif
>>  	VMCOREINFO_STRUCT_SIZE(page);
>>  	VMCOREINFO_STRUCT_SIZE(pglist_data);
>> -- 
>> 1.9.0
>>
>>
>> _______________________________________________
>> 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] 5+ messages in thread

* Re: [RESEND PATCH] kexec : add sparse memory related values to vmcore
  2014-05-30  8:14   ` Liu hua
@ 2014-06-02  0:01     ` Simon Horman
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2014-06-02  0:01 UTC (permalink / raw)
  To: Liu hua
  Cc: wangnan0, peifeiyue, liusdu, kexec, linux-kernel, hui.geng,
	kumagai-atsushi, ebiederm, anderson, linux-arm-kernel

On Fri, May 30, 2014 at 04:14:33PM +0800, Liu hua wrote:
> On 2014/5/29 8:13, Simon Horman wrote:
> > On Wed, May 28, 2014 at 09:49:56PM +0800, Liu Hua wrote:
> >> This patch deales with sparse memory model.
> >>
> >> For ARM32 platforms, different vendors may define different
> >> SECTION_SIZE_BITS, which we did not write to vmcore.
> >>
> >> For example:
> >>
> >>   1 arch/arm/mach-clps711x/include/mach/memory.h
> >>     #define SECTION_SIZE_BITS 24
> >>   2 arch/arm/mach-exynos/include/mach/memory.h
> >>     #define SECTION_SIZE_BITS 28
> >>   3 arch/arm/mach-sa1100/include/mach/memory.h
> >>     #define SECTION_SIZE_BITS 27
> > 
> > I wonder if this problem will eventually go away, or at least only
> > apply to older platforms, as ARM moves towards multiplatform: a single
> > kernel for more than one platform.
> 
> For ARM32 platform, it may cost a long time. And when glancing over
> the commit log of kernel, we can find this macro changed several times.
> The user space tools must take care of all these changed for compatibility.

Sure, that reasoning is fine by me.

> >> It is really a bad news for user space tools such as
> >> makedumpfile and crash, who have to defines them as
> >> macros. So for the same architecture, we may need to
> >> recomile them to parse vmcores with different
> >> SECTION_SIZE_BITS.
> >>
> >> And if we enable LPAE, MAX_PHYSMEM_SIZE can alse
> >> be variable.
> >>
> >> This patch adds these SECTION_SIZE_BITS and MAX_PHYSMEM_SIZE
> >> to vmcore. which makes user space tools more compatible.
> >>
> >> BTW, makedumpfile has queued the related patch.
> >>
> >> Signed-off-by: Liu Hua <sdu.liu@huawei.com>
> >> ---
> >>  kernel/kexec.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/kernel/kexec.c b/kernel/kexec.c
> >> index bf0b929e..8b1a193 100644
> >> --- a/kernel/kexec.c
> >> +++ b/kernel/kexec.c
> >> @@ -1577,6 +1577,8 @@ static int __init crash_save_vmcoreinfo_init(void)
> >>  	VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
> >>  	VMCOREINFO_STRUCT_SIZE(mem_section);
> >>  	VMCOREINFO_OFFSET(mem_section, section_mem_map);
> >> +	VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
> >> +	VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
> >>  #endif
> >>  	VMCOREINFO_STRUCT_SIZE(page);
> >>  	VMCOREINFO_STRUCT_SIZE(pglist_data);
> >> -- 
> >> 1.9.0
> >>
> >>
> >> _______________________________________________
> >> 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
> > 
> > .
> > 
> 
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 

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

* Re: [RESEND PATCH] kexec : add sparse memory related values to vmcore
  2014-05-29  0:13 ` Simon Horman
  2014-05-30  8:14   ` Liu hua
@ 2014-06-03  1:26   ` Liu hua
  1 sibling, 0 replies; 5+ messages in thread
From: Liu hua @ 2014-06-03  1:26 UTC (permalink / raw)
  To: Simon Horman
  Cc: wangnan0, peifeiyue, liusdu, kexec, linux-kernel, hui.geng,
	kumagai-atsushi, ebiederm, anderson

On 2014/5/29 8:13, Simon Horman 写道:
> On Wed, May 28, 2014 at 09:49:56PM +0800, Liu Hua wrote:
>> This patch deales with sparse memory model.
>>
>> For ARM32 platforms, different vendors may define different
>> SECTION_SIZE_BITS, which we did not write to vmcore.
>>
>> For example:
>>
>>   1 arch/arm/mach-clps711x/include/mach/memory.h
>>     #define SECTION_SIZE_BITS 24
>>   2 arch/arm/mach-exynos/include/mach/memory.h
>>     #define SECTION_SIZE_BITS 28
>>   3 arch/arm/mach-sa1100/include/mach/memory.h
>>     #define SECTION_SIZE_BITS 27
> 
> I wonder if this problem will eventually go away, or at least only
> apply to older platforms, as ARM moves towards multiplatform: a single
> kernel for more than one platform.


>> It is really a bad news for user space tools such as
>> makedumpfile and crash, who have to defines them as
>> macros. So for the same architecture, we may need to
>> recomile them to parse vmcores with different
>> SECTION_SIZE_BITS.
>>
>> And if we enable LPAE, MAX_PHYSMEM_SIZE can alse
>> be variable.
>>
>> This patch adds these SECTION_SIZE_BITS and MAX_PHYSMEM_SIZE
>> to vmcore. which makes user space tools more compatible.
>>
>> BTW, makedumpfile has queued the related patch.
>>
>> Signed-off-by: Liu Hua <sdu.liu@huawei.com>
>> ---
>>  kernel/kexec.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/kexec.c b/kernel/kexec.c
>> index bf0b929e..8b1a193 100644
>> --- a/kernel/kexec.c
>> +++ b/kernel/kexec.c
>> @@ -1577,6 +1577,8 @@ static int __init crash_save_vmcoreinfo_init(void)
>>  	VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
>>  	VMCOREINFO_STRUCT_SIZE(mem_section);
>>  	VMCOREINFO_OFFSET(mem_section, section_mem_map);
>> +	VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
>> +	VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
>>  #endif
>>  	VMCOREINFO_STRUCT_SIZE(page);
>>  	VMCOREINFO_STRUCT_SIZE(pglist_data);
>> -- 
>> 1.9.0
>>
>>
>> _______________________________________________
>> 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] 5+ messages in thread

end of thread, other threads:[~2014-06-03  1:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-28 13:49 [RESEND PATCH] kexec : add sparse memory related values to vmcore Liu Hua
2014-05-29  0:13 ` Simon Horman
2014-05-30  8:14   ` Liu hua
2014-06-02  0:01     ` Simon Horman
2014-06-03  1:26   ` Liu hua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).