linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Add iomem resource for kernel bss section.
@ 2017-10-12 19:50 David Daney
  2017-11-13 18:21 ` James Hogan
  0 siblings, 1 reply; 2+ messages in thread
From: David Daney @ 2017-10-12 19:50 UTC (permalink / raw)
  To: linux-mips, ralf, James Hogan; +Cc: linux-kernel, Steven J. Hill, David Daney

The kexec/kdump tools need to know where the .bss is so it can be
included in the core dump.  This allows vmcore-dmesg to have access to
the dmesg buffers of the crashed kernel as well as allowing the
debugger to examine variables in the bss section.

Add a request for the bss resource in addition to the already
requested code and data sections.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/kernel/setup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index fe39397..702c678 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -80,6 +80,7 @@ EXPORT_SYMBOL(mips_io_port_base);
 
 static struct resource code_resource = { .name = "Kernel code", };
 static struct resource data_resource = { .name = "Kernel data", };
+static struct resource bss_resource = { .name = "Kernel bss", };
 
 static void *detect_magic __initdata = detect_memory_region;
 
@@ -927,6 +928,8 @@ static void __init resource_init(void)
 	code_resource.end = __pa_symbol(&_etext) - 1;
 	data_resource.start = __pa_symbol(&_etext);
 	data_resource.end = __pa_symbol(&_edata) - 1;
+	bss_resource.start = __pa_symbol(&__bss_start);
+	bss_resource.end = __pa_symbol(&__bss_stop) - 1;
 
 	for (i = 0; i < boot_mem_map.nr_map; i++) {
 		struct resource *res;
@@ -966,6 +969,7 @@ static void __init resource_init(void)
 		 */
 		request_resource(res, &code_resource);
 		request_resource(res, &data_resource);
+		request_resource(res, &bss_resource);
 		request_crashkernel(res);
 	}
 }
-- 
2.9.5

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

* Re: [PATCH] MIPS: Add iomem resource for kernel bss section.
  2017-10-12 19:50 [PATCH] MIPS: Add iomem resource for kernel bss section David Daney
@ 2017-11-13 18:21 ` James Hogan
  0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2017-11-13 18:21 UTC (permalink / raw)
  To: David Daney; +Cc: linux-mips, ralf, linux-kernel, Steven J. Hill

On Thu, Oct 12, 2017 at 12:50:34PM -0700, David Daney wrote:
> The kexec/kdump tools need to know where the .bss is so it can be
> included in the core dump.  This allows vmcore-dmesg to have access to
> the dmesg buffers of the crashed kernel as well as allowing the
> debugger to examine variables in the bss section.
> 
> Add a request for the bss resource in addition to the already
> requested code and data sections.
> 
> Signed-off-by: David Daney <david.daney@cavium.com>

Thanks, applied.

Cheers
James

> ---
>  arch/mips/kernel/setup.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index fe39397..702c678 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -80,6 +80,7 @@ EXPORT_SYMBOL(mips_io_port_base);
>  
>  static struct resource code_resource = { .name = "Kernel code", };
>  static struct resource data_resource = { .name = "Kernel data", };
> +static struct resource bss_resource = { .name = "Kernel bss", };
>  
>  static void *detect_magic __initdata = detect_memory_region;
>  
> @@ -927,6 +928,8 @@ static void __init resource_init(void)
>  	code_resource.end = __pa_symbol(&_etext) - 1;
>  	data_resource.start = __pa_symbol(&_etext);
>  	data_resource.end = __pa_symbol(&_edata) - 1;
> +	bss_resource.start = __pa_symbol(&__bss_start);
> +	bss_resource.end = __pa_symbol(&__bss_stop) - 1;
>  
>  	for (i = 0; i < boot_mem_map.nr_map; i++) {
>  		struct resource *res;
> @@ -966,6 +969,7 @@ static void __init resource_init(void)
>  		 */
>  		request_resource(res, &code_resource);
>  		request_resource(res, &data_resource);
> +		request_resource(res, &bss_resource);
>  		request_crashkernel(res);
>  	}
>  }
> -- 
> 2.9.5
> 

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

end of thread, other threads:[~2017-11-13 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 19:50 [PATCH] MIPS: Add iomem resource for kernel bss section David Daney
2017-11-13 18:21 ` James Hogan

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).