[Crash-utility] ARM support for CONFIG_SPARSEMEM: (was Re: DD image)

Karlsson, Jan Jan.Karlsson at sonyericsson.com
Wed May 25 06:07:25 UTC 2011


Hi Mika,

The patch you give below is equal to the code I have been running for the last half year. I did not supply this as a patch, as I did not know how to set _MAX_PHYSMEM_BITS. I just tried a few values until everything seemed to work.

Jan

-----Original Message-----
From: crash-utility-bounces at redhat.com [mailto:crash-utility-bounces at redhat.com] On Behalf Of Mika Westerberg
Sent: tisdag den 24 maj 2011 20:54
To: Discussion list for crash utility usage, maintenance and development
Cc: amer4554 at gmail.com
Subject: Re: [Crash-utility] ARM support for CONFIG_SPARSEMEM: (was Re: DD image)

[ dropped my Nokia address from the CC list, since I'm not working for Nokia
  anymore ]

On Tue, May 24, 2011 at 09:58:48AM -0400, Dave Anderson wrote:
> 
> BTW, I await any patches from the ARM folks to set these bits
> appropriately.  Currently there is this for ARM in defs.h:
> 
>   #ifdef ARM
>   ... [ cut ] ...
> 
>   #define _SECTION_SIZE_BITS      28
>   #define _MAX_PHYSMEM_BITS       32
> 
>   #endif  /* ARM */
> 
> Yet you state above that you're using 22 for _SECTION_SIZE_BITS.

This varies between different SoCs and it is not used by others. Since it is
not stored in a crashdump IIRC, we really cannot set that value dynamically.

So I see two options:

	1) leave it as is and make crash to complain when it detects such
	   situation or
	2) guess the values and try to do the right thing (TM)

My preference goes with 2) provided that we can get it working on majority of
the ARM SoCs.

We could try to stick with _SECTION_SIZE_BITS=28, as it seems to be largest
currently used section size amongst different ARM SoCs, and hope that it works
with others where this is smaller.

Jan, Takuo: maybe you could try whether following patch works? I don't have
any hardware which use SPARSEMEM so I'm unable to test it.

Regards,
MW

diff --git a/arm.c b/arm.c
index 0347166..9d4afcc 100644
--- a/arm.c
+++ b/arm.c
@@ -260,6 +260,9 @@ arm_init(int when)
 		    STRUCT_EXISTS("pteval_t"))
 			machdep->flags |= PGTABLE_V2;
 
+		machdep->section_size_bits = _SECTION_SIZE_BITS;
+		machdep->max_physmem_bits = _MAX_PHYSMEM_BITS;
+
 		if (symbol_exists("irq_desc"))
 			ARRAY_LENGTH_INIT(machdep->nr_irqs, irq_desc,
 					  "irq_desc", NULL, 0);

--
Crash-utility mailing list
Crash-utility at redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility




More information about the Crash-utility mailing list