@@ -32,6 +32,7 @@ static int verify_kimage_voffset(void);
32
32
static void arm64_calc_kimage_voffset (void );
33
33
static void arm64_calc_phys_offset (void );
34
34
static void arm64_calc_virtual_memory_ranges (void );
35
+ static void arm64_get_section_size_bits (void );
35
36
static int arm64_kdump_phys_base (ulong * );
36
37
static ulong arm64_processor_speed (void );
37
38
static void arm64_init_kernel_pgd (void );
@@ -375,7 +376,8 @@ arm64_init(int when)
375
376
376
377
case POST_GDB :
377
378
arm64_calc_virtual_memory_ranges ();
378
- machdep -> section_size_bits = _SECTION_SIZE_BITS ;
379
+ arm64_get_section_size_bits ();
380
+
379
381
if (!machdep -> max_physmem_bits ) {
380
382
if ((string = pc -> read_vmcoreinfo ("NUMBER(MAX_PHYSMEM_BITS)" ))) {
381
383
machdep -> max_physmem_bits = atol (string );
@@ -1055,6 +1057,33 @@ arm64_calc_phys_offset(void)
1055
1057
fprintf (fp , "using %lx as phys_offset\n" , ms -> phys_offset );
1056
1058
}
1057
1059
1060
+ /*
1061
+ * Determine SECTION_SIZE_BITS either by reading VMCOREINFO or the kernel
1062
+ * config, otherwise use the 64-bit ARM default definiton.
1063
+ */
1064
+ static void
1065
+ arm64_get_section_size_bits (void )
1066
+ {
1067
+ int ret ;
1068
+ char * string ;
1069
+
1070
+ machdep -> section_size_bits = _SECTION_SIZE_BITS ;
1071
+
1072
+ if ((string = pc -> read_vmcoreinfo ("NUMBER(SECTION_SIZE_BITS)" ))) {
1073
+ machdep -> section_size_bits = atol (string );
1074
+ free (string );
1075
+ } else if (kt -> ikconfig_flags & IKCONFIG_AVAIL ) {
1076
+ if ((ret = get_kernel_config ("CONFIG_MEMORY_HOTPLUG" , NULL )) == IKCONFIG_Y ) {
1077
+ if ((ret = get_kernel_config ("CONFIG_HOTPLUG_SIZE_BITS" , & string )) == IKCONFIG_STR ) {
1078
+ machdep -> section_size_bits = atol (string );
1079
+ free (string );
1080
+ }
1081
+ }
1082
+ }
1083
+
1084
+ if (CRASHDEBUG (1 ))
1085
+ fprintf (fp , "SECTION_SIZE_BITS: %ld\n" , machdep -> section_size_bits );
1086
+ }
1058
1087
1059
1088
/*
1060
1089
* Determine PHYS_OFFSET either by reading VMCOREINFO or the kernel
0 commit comments