[Crash-utility] [PATCH] arm64 : Update the section_size_bits for latest kernel

Ankur Bansal er.ankurbansal at gmail.com
Tue Nov 2 05:09:56 UTC 2021


correct the section_size_bits for kernel version >= 5.12
becuase of linux upstream change
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f0b13ee23241846f6f6cd0d119a8ac8059416ec4
(arm64/sparsemem: reduce SECTION_SIZE_BITS)

Change-Id: I31b66fbfe421a02aa9f370ce7a615fbc70efcf2f
---
 arm64.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arm64.c b/arm64.c
index 3dcbcc6..4a207fc 100644
--- a/arm64.c
+++ b/arm64.c
@@ -1123,9 +1123,15 @@ arm64_get_section_size_bits(void)
 		free(string);
 	} else if (kt->ikconfig_flags & IKCONFIG_AVAIL) {
 		if ((ret = get_kernel_config("CONFIG_MEMORY_HOTPLUG", NULL)) == IKCONFIG_Y) {
-			if ((ret = get_kernel_config("CONFIG_HOTPLUG_SIZE_BITS", &string)) == IKCONFIG_STR)
+			if (THIS_KERNEL_VERSION >= LINUX(5,12,0)){
+				if((ret = get_kernel_config("CONFIG_ARM64_64K_PAGES", NULL)) == IKCONFIG_Y)
+					machdep->section_size_bits = 29;
+				else
+					machdep->section_size_bits = 27;
+			}
+			else if ((ret = get_kernel_config("CONFIG_HOTPLUG_SIZE_BITS", &string)) == IKCONFIG_STR)
 				machdep->section_size_bits = atol(string);
-		} 
+		}
 	}
 
 	if (CRASHDEBUG(1))
-- 
2.7.4




More information about the Crash-utility mailing list