LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com,
	mpe@ellerman.id.au
Cc: npiggin@gmail.com, chleroy@kernel.org, shivangu@linux.ibm.com,
	hbathini@linux.ibm.com, mahesh@linux.ibm.com,
	adityag@linux.ibm.com, venkat88@linux.ibm.com
Subject: Re: [PATCH v2 1/4] powerpc/mmu: do MMU type discovery before crashkernel reservation
Date: Mon, 13 Jul 2026 18:42:07 +0530	[thread overview]
Message-ID: <34522476-3b48-4af9-b09d-11eed8b22597@linux.ibm.com> (raw)
In-Reply-To: <1pdbwokc.ritesh.list@gmail.com>



On 10/07/26 08:14, Ritesh Harjani (IBM) wrote:
> Minor nits
>
> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>
>> Crashkernel reservation on high memory depends on the MMU type, so
>> finalize the MMU type before calling arch_reserve_crashkernel().
>>
>> With the changes introduced here, early_radix_enabled() becomes usable
>> and will be used in arch_reserve_crashkernel() in the upcoming patch.
>>
>> early_radix_enabled() depends on cur_cpu_spec->mmu_features to find
>> out if the radix MMU is enabled. The radix MMU bit in mmu_features is
>> discovered from the FDT and kernel configs. To make sure the MMU type is
>> finalized before arch_reserve_crashkernel() is called, the function that
>> scans the FDT and sets mmu_features, along with some bits from
>> mmu_early_type_finalize(), has been moved above
>> arch_reserve_crashkernel().
>>
> Can you also add a short description of why can't we move
> arch_reserve_crashkernel() to a later point instead of breaking
> mmu_early_init_devtree() and moving the xx_type_finalize() part above?

The main reason is that the crashkernel requires one large contiguous memory
block to be reserved at a specific memory offset. To ensure this 
allocation succeeds,
the crashkernel memory is reserved before any other components reserve 
memory.

> If I am not wrong, it is since move_device_tree() checks whether the FDT
> overlaps the crash kernel reservation. So arch_reserve_crashkernel()
> must be called before move_device_tree().

I think the bootloader loads the device tree and may chose a location 
that may falls
within the crashkernel region. The purpose of move_device_tree() is to 
relocate
the device tree so that it no longer occupies the crashkernel memory. 
Otherwise,
that memory region would also need to be excluded from the crashkernel
reserved area (and also need special APIs to access device tree present in
reserved memory regions), similar to the RTAS region.

- Sourabh Jain

>
>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> ---
>>   arch/powerpc/include/asm/book3s/64/mmu.h |  1 +
>>   arch/powerpc/include/asm/mmu.h           |  1 +
>>   arch/powerpc/kernel/prom.c               | 28 +++++++++++++-----------
>>   arch/powerpc/mm/init_64.c                | 27 ++++++++++++++---------
>>   4 files changed, 34 insertions(+), 23 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h
>> index 48631365b48c..7a3b2ff02041 100644
>> --- a/arch/powerpc/include/asm/book3s/64/mmu.h
>> +++ b/arch/powerpc/include/asm/book3s/64/mmu.h
>> @@ -208,6 +208,7 @@ extern int mmu_vmemmap_psize;
>>   
>>   /* MMU initialization */
>>   void mmu_early_init_devtree(void);
>> +void mmu_early_type_finalize(void);
> can you rename this as mmu_early_init_type().
>
> Otherwise the change looks good to me. With the above 2 addressed, feel
> free to add:
>
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>
>



  reply	other threads:[~2026-07-13 13:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 14:33 [PATCH v2 0/4] powerpc/kdump: Support high crashkernel reservation Sourabh Jain
2026-07-08 14:33 ` [PATCH v2 1/4] powerpc/mmu: do MMU type discovery before " Sourabh Jain
2026-07-10  2:44   ` Ritesh Harjani
2026-07-13 13:12     ` Sourabh Jain [this message]
2026-07-08 14:33 ` [PATCH v2 2/4] powerpc: move to 64-bit RTAS Sourabh Jain
2026-07-08 14:33 ` [PATCH v2 3/4] powerpc/kdump: consider high crashkernel memory if enabled Sourabh Jain
2026-07-08 14:33 ` [PATCH v2 4/4] powerpc/kdump: add support for high crashkernel reservation Sourabh Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34522476-3b48-4af9-b09d-11eed8b22597@linux.ibm.com \
    --to=sourabhjain@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=hbathini@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=shivangu@linux.ibm.com \
    --cc=venkat88@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox