Re: [PATCH] arm64 : Update the section_size_bits for latest kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ankur,

Thanks for the patch.

-----Original Message-----
> 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=f0b13ee23241846f6f6cd0d
> 119a8ac8059416ec4
> (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)

Considering dumpfiles without vmcoreinfo and IKCONFIG too, it will be better
to switch the default value of section_size_bits.  We can use machdep->pagesize
here, so how about this?

-	machdep->section_size_bits = _SECTION_SIZE_BITS;
+	if (THIS_KERNEL_VERSION >= LINUX(5,12,0)) {
+		if (machdep->pagesize == 65536)
+			machdep->section_size_bits = 29;
+		else
+			machdep->section_size_bits = 27;
+	} else
+		machdep->section_size_bits = _SECTION_SIZE_BITS;

Thanks,
Kazu


--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux