linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Avnish Chouhan <avnish@linux.ibm.com>
To: Hari Bathini <hbathini@linux.ibm.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, Brian King <brking@linux.ibm.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Mahesh Salgaonkar <mahesh@linux.ibm.com>
Subject: Re: [PATCH 2/2] powerpc/fadump: fix additional param memory reservation for HASH MMU
Date: Tue, 04 Feb 2025 14:07:02 +0530	[thread overview]
Message-ID: <405d82eb1ba6799b63b6ed90347d88c9@linux.ibm.com> (raw)
In-Reply-To: <fdf5cec6-54ce-4042-b8a5-2560ce7dd623@linux.ibm.com>

On 2025-02-04 11:57, Hari Bathini wrote:
> On 04/02/25 10:58 am, Avnish Chouhan wrote:
>> On 2025-01-31 20:44, Hari Bathini wrote:
>>> On 23/01/25 7:54 pm, Avnish Chouhan wrote:
>>>> On 2025-01-23 15:26, Hari Bathini wrote:
>>>>> On 20/01/25 11:05 pm, Sourabh Jain wrote:
>>>>>> Commit 683eab94da75bc ("powerpc/fadump: setup additional 
>>>>>> parameters for
>>>>>> dump capture kernel") introduced the additional parameter feature 
>>>>>> in
>>>>>> fadump for HASH MMU with the understanding that GRUB does not use 
>>>>>> the
>>>>>> memory area between 640MB and 768MB for its operation.
>>>>>> 
>>>>>> However, the patch ("powerpc: increase MIN RMA size for CAS
>>>>>> negotiation") changes the MIN RMA size to 768MB, allowing GRUB to 
>>>>>> use
>>>>>> memory up to 768MB. This makes the fadump reservation for the 
>>>>>> additional
>>>>>> parameter feature for HASH MMU unreliable.
>>>>>> 
>>>>>> To address this, adjust the memory range for the additional 
>>>>>> parameter in
>>>>>> fadump for HASH MMU. This will ensure that GRUB does not overwrite 
>>>>>> the
>>>>>> memory reserved for fadump's additional parameter in HASH MMU.
>>>>>> 
>>>>> 
>>>>>> The new policy for the memory range for the additional parameter 
>>>>>> in HASH
>>>>>> MMU is that the first memory block must be larger than the MIN_RMA 
>>>>>> size,
>>>>>> as the bootloader can use memory up to the MIN_RMA size. The range
>>>>>> should be between MIN_RMA and the RMA size (ppc64_rma_size), and 
>>>>>> it must
>>>>>> not overlap with the fadump reserved area.
>>>>> 
>>>>> IIRC, even memory above MIN_RMA is used by the bootloader except 
>>>>> for
>>>>> 640MB to 768MB (assuming RMA size is >768MB). So, how does this 
>>>>> change
>>>>> guarantee that the bootloader is not using memory reserved for 
>>>>> bootargs?
>>>>> 
>>>>> Avnish, earlier, bootloader was using RUNTIME_MIN_SPACE (128MB) 
>>>>> starting
>>>>> top-down at 768MB earlier. With MIN_RMA changed to 768MB, is 
>>>>> bootloader
>>>>> still using the concept of RUNTIME_MIN_SPACE to set aside some 
>>>>> memory
>>>>> for kernel to use. If yes, where exactly is it allocating this 
>>>>> space
>>>>> now? Also, rtas instantiates top-down at 768MB. Would that not have
>>>>> a conflict with grub allocations without RUNTIME_MIN_SPACE at 
>>>>> 768MB?
>>>>> 
>>>>> - Hari
>>>> 
>>>> Hi Hari,
>>> 
>>> Hi Avnish,
>>> 
>>>> The RUNTIME_MIN_SPACE is the space left aside by Grub is within the 
>>>> MIN_RMA size. Grub won't use memory beyond the MIN_RMA. With this 
>>>> change, we haven't changed the RUNTIME_MIN_SPACE behavior. Grub will 
>>>> still keep the 128 MB space in MIN_RMA for loading stock kernel and 
>>>> initrd.
>>> 
>>> IIUC, you mean, 640MB to 768MB is not used by Grub even if MIN_RMA
>>> is at 768MB? If that is true, this change is not needed, as fadump
>>> could still use the memory between 640MB to 768MB, right?
>>> Am I missing something here..
>> 
>> Hari,
>> 
>> No. As we are changing MIN_RMA to 768 MB, GRUB can use memory till 768 
>> MB if required.
> 
> Does that mean 'linux_rmo_save' related code in
> grub-core/kern/ieee1275/init.c is going to be dead code after this
> change. Also, does this imply, there isn't going to be any
> RUNTIME_MIN_SPACE support for linux in grub?

No Hari, there's no change in RUNTIME_MIN_SPACE as mentioned earlier nor 
the change leading to any dead code in grub. If we have MIN_RMA as 512 
MB, the grub will consider RUNTIME_MIN_SPACE region within the MIN_RMA 
as (384[512-128] to 512). And if we have MIN_RMA as 768 MB, it will be 
(640[768-128] to 768).

Grub will keep the 128 MB space in MIN_RMA for loading stock kernel and 
initrd as stated earlier.

Thank you,
Avnish Chouhan
> 
> - Hari


  reply	other threads:[~2025-02-04  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 17:34 [PATCH 0/2] powerpc/fadump: fix additional parameter for HASH MMU Sourabh Jain
2025-01-20 17:34 ` [PATCH 1/2] powerpc: export MIN RMA size Sourabh Jain
2025-01-20 17:35 ` [PATCH 2/2] powerpc/fadump: fix additional param memory reservation for HASH MMU Sourabh Jain
2025-01-23  6:58   ` Mahesh J Salgaonkar
2025-01-24  3:34     ` Sourabh Jain
2025-01-23  9:56   ` Hari Bathini
2025-01-23 14:24     ` Avnish Chouhan
2025-01-31 15:14       ` Hari Bathini
2025-02-04  5:28         ` Avnish Chouhan
2025-02-04  6:27           ` Hari Bathini
2025-02-04  8:37             ` Avnish Chouhan [this message]
2025-02-10  6:44               ` Hari Bathini

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=405d82eb1ba6799b63b6ed90347d88c9@linux.ibm.com \
    --to=avnish@linux.ibm.com \
    --cc=brking@linux.ibm.com \
    --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=sourabhjain@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;
as well as URLs for NNTP newsgroup(s).