Skip to content

Commit

Permalink
arm64: Update SECTION_SIZE_BITS for kernels >= 5.12
Browse files Browse the repository at this point in the history
Update the default SECTION_SIZE_BITS value for arm64 Linux 5.12
and later kernels that contain kernel commit f0b13ee23241
("arm64/sparsemem: reduce SECTION_SIZE_BITS").

Reported-by: Ankur Bansal <[email protected]>
Signed-off-by: Kazuhito Hagio <[email protected]>
  • Loading branch information
k-hagio authored and lian-bo committed Nov 15, 2021
1 parent 01d20ca commit 8246dce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,13 @@ arm64_get_section_size_bits(void)
int ret;
char *string;

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

if ((string = pc->read_vmcoreinfo("NUMBER(SECTION_SIZE_BITS)"))) {
machdep->section_size_bits = atol(string);
Expand Down
4 changes: 3 additions & 1 deletion defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3261,7 +3261,9 @@ typedef signed int s32;
#define ARM64_STACK_SIZE (16384)
#define ARM64_IRQ_STACK_SIZE ARM64_STACK_SIZE

#define _SECTION_SIZE_BITS 30
#define _SECTION_SIZE_BITS 30
#define _SECTION_SIZE_BITS_5_12 27
#define _SECTION_SIZE_BITS_5_12_64K 29
#define _MAX_PHYSMEM_BITS 40
#define _MAX_PHYSMEM_BITS_3_17 48
#define _MAX_PHYSMEM_BITS_52 52
Expand Down

0 comments on commit 8246dce

Please sign in to comment.