Re: [PATCH] powerpc: align memory_limit to 16MB in early_parse_mem

From: Aneesh Kumar K.V
Date: Mon Mar 04 2024 - 01:58:38 EST


On 3/2/24 4:53 AM, Michael Ellerman wrote:
> Hi Joel,
>
> Joel Savitz <jsavitz@xxxxxxxxxx> writes:
>> On 64-bit powerpc, usage of a non-16MB-aligned value for the mem= kernel
>> cmdline parameter results in a system hang at boot.
>
> Can you give us any more details on that? It might be a bug we can fix.
>
>> For example, using 'mem=4198400K' will always reproduce this issue.
>>
>> This patch fixes the problem by aligning any argument to mem= to 16MB
>> corresponding with the large page size on powerpc.
>
> The large page size depends on the MMU, with Radix it's 2MB or 1GB. So
> depending on what's happening 16MB may not be enough.
>
> What system are you testing on?
>

htab_bolt_mapping should have aligned things to a lower value that is 16MB aligned.

/* Carefully map only the possible range */
vaddr = ALIGN(vstart, step);
paddr = ALIGN(pstart, step);
vend = ALIGN_DOWN(vend, step);



-aneesh