Skip to content

powerpc/mm: Align memory_limit value specified using mem= kernel parameter

Joel Savitz requested to merge jsavitz/centos-stream-9:RHEL-8591.post into main

Upstream status: Linux

ppc64le systems fail to boot when using a value for the mem= kernel parameter that is not 16mb aligned, so by aligning the argument to 16mb before use, we fix the bug and systems boot succesfully.

To test: pass 'mem=4198400K' to the kernel cmdline on a ppc64le system. The kernel should boot.

JIRA: https://issues.redhat.com/browse/RHEL-8591

commit 5ca096161cdccfa328acf6704a4615528471d309 Author: Aneesh Kumar K.V (IBM) aneesh.kumar@kernel.org Date: Wed Apr 3 14:06:09 2024 +0530

powerpc/mm: Align memory_limit value specified using mem= kernel parameter

The value specified for the memory limit is used to set a restriction on
memory usage. It is important to ensure that this restriction is within
the linear map kernel address space range. The hash page table
translation uses a 16MB page size to map the kernel linear map address
space. htab_bolt_mapping() function aligns down the size of the range
while mapping kernel linear address space. Since the memblock limit is
enforced very early during boot, before we can detect the type of memory
translation (radix vs hash), we align the memory limit value specified
as a kernel parameter to 16MB. This alignment value will work for both
hash and radix translations.

Signed-off-by: Joel Savitz jsavitz@redhat.com

Merge request reports