* [PATCH] powerpc: increase MIN RMA size for CAS negotiation
@ 2024-12-05 10:10 Avnish Chouhan
2024-12-05 12:05 ` Madhavan Srinivasan
0 siblings, 1 reply; 8+ messages in thread
From: Avnish Chouhan @ 2024-12-05 10:10 UTC (permalink / raw)
To: linuxppc-dev
Cc: mpe, brking, meghanaprakash, sourabhjain, maddy, Avnish Chouhan
Change RMA size from 512 MB to 768 MB which will result
in more RMA at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
load the necessary. Sometimes even usage of CDROM which requires more
memory for installation along with the options mentioned above troubles
the boot memory and result in boot failures. Increasing the RMA size
will resolves multiple out of memory issues observed in PowerPC.
Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
---
arch/powerpc/kernel/prom_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index fbb68fc28ed3..c42fd5a826c0 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1061,7 +1061,7 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
.virt_base = cpu_to_be32(0xffffffff),
.virt_size = cpu_to_be32(0xffffffff),
.load_base = cpu_to_be32(0xffffffff),
- .min_rma = cpu_to_be32(512), /* 512MB min RMA */
+ .min_rma = cpu_to_be32(768), /* 768MB min RMA */
.min_load = cpu_to_be32(0xffffffff), /* full client load */
.min_rma_percent = 0, /* min RMA percentage of total RAM */
.max_pft_size = 48, /* max log_2(hash table size) */
--
2.43.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: increase MIN RMA size for CAS negotiation
2024-12-05 10:10 Avnish Chouhan
@ 2024-12-05 12:05 ` Madhavan Srinivasan
0 siblings, 0 replies; 8+ messages in thread
From: Madhavan Srinivasan @ 2024-12-05 12:05 UTC (permalink / raw)
To: Avnish Chouhan, linuxppc-dev; +Cc: mpe, brking, meghanaprakash, sourabhjain
On 12/5/24 3:40 PM, Avnish Chouhan wrote:
> Change RMA size from 512 MB to 768 MB which will result
> in more RMA at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
> Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
> booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
> load the necessary. Sometimes even usage of CDROM which requires more
> memory for installation along with the options mentioned above troubles
> the boot memory and result in boot failures. Increasing the RMA size
> will resolves multiple out of memory issues observed in PowerPC.
Can you add more on the failure details here list a stack trace or dump,
also is there a selftest to verify the fix in qemu or lpar?
>
>
> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
> ---
> arch/powerpc/kernel/prom_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index fbb68fc28ed3..c42fd5a826c0 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -1061,7 +1061,7 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
> .virt_base = cpu_to_be32(0xffffffff),
> .virt_size = cpu_to_be32(0xffffffff),
> .load_base = cpu_to_be32(0xffffffff),
> - .min_rma = cpu_to_be32(512), /* 512MB min RMA */
> + .min_rma = cpu_to_be32(768), /* 768MB min RMA */
> .min_load = cpu_to_be32(0xffffffff), /* full client load */
> .min_rma_percent = 0, /* min RMA percentage of total RAM */
> .max_pft_size = 48, /* max log_2(hash table size) */
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] powerpc: increase MIN RMA size for CAS negotiation
@ 2025-01-15 12:16 Avnish Chouhan
2025-02-06 7:30 ` Michael Chang via Grub-devel
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Avnish Chouhan @ 2025-01-15 12:16 UTC (permalink / raw)
To: grub-devel
Cc: daniel.kiper, brking, meghanaprakash, mchauras, mamatha4,
Avnish Chouhan
Change RMA size from 512 MB to 768 MB which will result
in more memory at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
load the necessary. Sometimes even usage of CDROM which requires more
memory for installation along with the options mentioned above troubles
the boot memory and result in boot failures. Increasing the RMA size
will resolves multiple out of memory issues observed in PowerPC.
Failure details (GRUB2 debugs):
kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 1
kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
space
kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 0
kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
space
kern/file.c:215: Closing `/ppc/ppc64/initrd.img' ...
kern/disk.c:297: Closing
`ieee1275//vdevice/v-scsi
@30000067/disk@8300000000000000'...
kern/disk.c:311: Closing
`ieee1275//vdevice/v-scsi
@30000067/disk@8300000000000000' succeeded.
kern/file.c:225: Closing `/ppc/ppc64/initrd.img' failed with 3.
kern/file.c:148: Opening `/ppc/ppc64/initrd.img' succeeded.
error: ../../grub-core/kern/mm.c:552:out of memory.
Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
---
grub-core/kern/ieee1275/init.c | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index dfbd0b8..502ebf1 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -852,7 +852,7 @@ grub_ieee1275_ibm_cas (void)
.vec1 = 0x80, /* ignore */
.vec2_size = 1 + sizeof (struct option_vector2) - 2,
.vec2 = {
- 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
+ 0, 0, -1, -1, -1, -1, -1, 768, -1, 0, 48
},
.vec3_size = 2 - 1,
.vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */
@@ -889,6 +889,10 @@ grub_claim_heap (void)
{
grub_err_t err;
grub_uint32_t total = HEAP_MAX_SIZE;
+#if defined(__powerpc__)
+ grub_uint32_t ibm_ca_support_reboot;
+ grub_ssize_t actual;
+#endif
err = grub_ieee1275_total_mem (&rmo_top);
@@ -901,11 +905,32 @@ grub_claim_heap (void)
grub_mm_add_region_fn = grub_ieee1275_mm_add_region;
#if defined(__powerpc__)
+ /* Check if it's a CAS reboot with below property. If so, we will skip CAS call */
+ ibm_ca_support_reboot = 0;
+ if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
+ "ibm,client-architecture-support-reboot",
+ &ibm_ca_support_reboot,
+ sizeof (ibm_ca_support_reboot),
+ &actual) >= 0)
+ grub_dprintf ("ieee1275", "ibm,client-architecture-support-reboot: %u\n",
+ ibm_ca_support_reboot);
+
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY))
{
- /* if we have an error, don't call CAS, just hope for the best */
- if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024))
- grub_ieee1275_ibm_cas ();
+ /*
+ * If we have an error or the reboot is detected as CAS reboot,
+ * don't call CAS, just hope for the best.
+ * Along with the above, if the rmo_top is 512 MB or above. We
+ * will skip the CAS call. Though if we call CAS, the rmo_top will
+ * be set to 768 MB via CAS Vector2. This condition is required to avoid the
+ * issue where the older Linux kernels are still using rmo_top as 512 MB.
+ * Calling CAS when rmo_top is less then 768 MB will result in a issue
+ * where we won't be able to boot to a newer kernel and continue to
+ * boot with older kernel having rmo_top as 512 MB.
+ */
+ if (!ibm_ca_support_reboot && err == GRUB_ERR_NONE
+ && rmo_top < (512 * 1024 * 1024))
+ grub_ieee1275_ibm_cas ();
}
#endif
--
2.39.3
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: increase MIN RMA size for CAS negotiation
2025-01-15 12:16 [PATCH] powerpc: increase MIN RMA size for CAS negotiation Avnish Chouhan
@ 2025-02-06 7:30 ` Michael Chang via Grub-devel
2025-02-06 8:39 ` Avnish Chouhan
2025-02-17 18:43 ` Mukesh Kumar Chaurasiya
2025-02-28 14:32 ` Daniel Kiper
2 siblings, 1 reply; 8+ messages in thread
From: Michael Chang via Grub-devel @ 2025-02-06 7:30 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: Michael Chang, daniel.kiper, brking, meghanaprakash, mchauras,
mamatha4, Avnish Chouhan
On Wed, Jan 15, 2025 at 05:46:05PM +0530, Avnish Chouhan wrote:
> Change RMA size from 512 MB to 768 MB which will result
> in more memory at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
> Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
> booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
> load the necessary. Sometimes even usage of CDROM which requires more
> memory for installation along with the options mentioned above troubles
> the boot memory and result in boot failures. Increasing the RMA size
> will resolves multiple out of memory issues observed in PowerPC.
How often does the CAS reboot to claim additional RMA memory? Does this
occur only once, or during every cold boot/reboot?
I hope it happens only once, because doing it repeatedly could
complicate the configuration of the TPM PCR policy.
Thanks,
Michael
>
> Failure details (GRUB2 debugs):
>
> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 1
> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
> space
> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 0
> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
> space
> kern/file.c:215: Closing `/ppc/ppc64/initrd.img' ...
> kern/disk.c:297: Closing
> `ieee1275//vdevice/v-scsi
> @30000067/disk@8300000000000000'...
> kern/disk.c:311: Closing
> `ieee1275//vdevice/v-scsi
> @30000067/disk@8300000000000000' succeeded.
> kern/file.c:225: Closing `/ppc/ppc64/initrd.img' failed with 3.
> kern/file.c:148: Opening `/ppc/ppc64/initrd.img' succeeded.
> error: ../../grub-core/kern/mm.c:552:out of memory.
>
> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
> ---
> grub-core/kern/ieee1275/init.c | 33 +++++++++++++++++++++++++++++----
> 1 file changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
> index dfbd0b8..502ebf1 100644
> --- a/grub-core/kern/ieee1275/init.c
> +++ b/grub-core/kern/ieee1275/init.c
> @@ -852,7 +852,7 @@ grub_ieee1275_ibm_cas (void)
> .vec1 = 0x80, /* ignore */
> .vec2_size = 1 + sizeof (struct option_vector2) - 2,
> .vec2 = {
> - 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
> + 0, 0, -1, -1, -1, -1, -1, 768, -1, 0, 48
> },
> .vec3_size = 2 - 1,
> .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */
> @@ -889,6 +889,10 @@ grub_claim_heap (void)
> {
> grub_err_t err;
> grub_uint32_t total = HEAP_MAX_SIZE;
> +#if defined(__powerpc__)
> + grub_uint32_t ibm_ca_support_reboot;
> + grub_ssize_t actual;
> +#endif
>
> err = grub_ieee1275_total_mem (&rmo_top);
>
> @@ -901,11 +905,32 @@ grub_claim_heap (void)
> grub_mm_add_region_fn = grub_ieee1275_mm_add_region;
>
> #if defined(__powerpc__)
> + /* Check if it's a CAS reboot with below property. If so, we will skip CAS call */
> + ibm_ca_support_reboot = 0;
> + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
> + "ibm,client-architecture-support-reboot",
> + &ibm_ca_support_reboot,
> + sizeof (ibm_ca_support_reboot),
> + &actual) >= 0)
> + grub_dprintf ("ieee1275", "ibm,client-architecture-support-reboot: %u\n",
> + ibm_ca_support_reboot);
> +
> if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY))
> {
> - /* if we have an error, don't call CAS, just hope for the best */
> - if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024))
> - grub_ieee1275_ibm_cas ();
> + /*
> + * If we have an error or the reboot is detected as CAS reboot,
> + * don't call CAS, just hope for the best.
> + * Along with the above, if the rmo_top is 512 MB or above. We
> + * will skip the CAS call. Though if we call CAS, the rmo_top will
> + * be set to 768 MB via CAS Vector2. This condition is required to avoid the
> + * issue where the older Linux kernels are still using rmo_top as 512 MB.
> + * Calling CAS when rmo_top is less then 768 MB will result in a issue
> + * where we won't be able to boot to a newer kernel and continue to
> + * boot with older kernel having rmo_top as 512 MB.
> + */
> + if (!ibm_ca_support_reboot && err == GRUB_ERR_NONE
> + && rmo_top < (512 * 1024 * 1024))
> + grub_ieee1275_ibm_cas ();
> }
> #endif
>
> --
> 2.39.3
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: increase MIN RMA size for CAS negotiation
2025-02-06 7:30 ` Michael Chang via Grub-devel
@ 2025-02-06 8:39 ` Avnish Chouhan
0 siblings, 0 replies; 8+ messages in thread
From: Avnish Chouhan @ 2025-02-06 8:39 UTC (permalink / raw)
To: The development of GNU GRUB, mchang
Cc: daniel.kiper, brking, meghanaprakash, mchauras, mamatha4
On 2025-02-06 13:00, Michael Chang wrote:
> On Wed, Jan 15, 2025 at 05:46:05PM +0530, Avnish Chouhan wrote:
>> Change RMA size from 512 MB to 768 MB which will result
>> in more memory at boot time for PowerPC. When PowerPC LPAR use/uses
>> vTPM,
>> Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
>> booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
>> load the necessary. Sometimes even usage of CDROM which requires more
>> memory for installation along with the options mentioned above
>> troubles
>> the boot memory and result in boot failures. Increasing the RMA size
>> will resolves multiple out of memory issues observed in PowerPC.
>
> How often does the CAS reboot to claim additional RMA memory? Does this
> occur only once, or during every cold boot/reboot?
>
> I hope it happens only once, because doing it repeatedly could
> complicate the configuration of the TPM PCR policy.
>
> Thanks,
> Michael
>
Hi Michael,
The CAS call to claim additional RMA memory will happen only once.
Thank you!
Regards,
Avnish Chouhan
>>
>> Failure details (GRUB2 debugs):
>>
>> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 1
>> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum
>> runtime
>> space
>> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 0
>> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum
>> runtime
>> space
>> kern/file.c:215: Closing `/ppc/ppc64/initrd.img' ...
>> kern/disk.c:297: Closing
>> `ieee1275//vdevice/v-scsi
>> @30000067/disk@8300000000000000'...
>> kern/disk.c:311: Closing
>> `ieee1275//vdevice/v-scsi
>> @30000067/disk@8300000000000000' succeeded.
>> kern/file.c:225: Closing `/ppc/ppc64/initrd.img' failed with 3.
>> kern/file.c:148: Opening `/ppc/ppc64/initrd.img' succeeded.
>> error: ../../grub-core/kern/mm.c:552:out of memory.
>>
>> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
>> ---
>> grub-core/kern/ieee1275/init.c | 33 +++++++++++++++++++++++++++++----
>> 1 file changed, 29 insertions(+), 4 deletions(-)
>>
>> diff --git a/grub-core/kern/ieee1275/init.c
>> b/grub-core/kern/ieee1275/init.c
>> index dfbd0b8..502ebf1 100644
>> --- a/grub-core/kern/ieee1275/init.c
>> +++ b/grub-core/kern/ieee1275/init.c
>> @@ -852,7 +852,7 @@ grub_ieee1275_ibm_cas (void)
>> .vec1 = 0x80, /* ignore */
>> .vec2_size = 1 + sizeof (struct option_vector2) - 2,
>> .vec2 = {
>> - 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
>> + 0, 0, -1, -1, -1, -1, -1, 768, -1, 0, 48
>> },
>> .vec3_size = 2 - 1,
>> .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if
>> unsatisfied */
>> @@ -889,6 +889,10 @@ grub_claim_heap (void)
>> {
>> grub_err_t err;
>> grub_uint32_t total = HEAP_MAX_SIZE;
>> +#if defined(__powerpc__)
>> + grub_uint32_t ibm_ca_support_reboot;
>> + grub_ssize_t actual;
>> +#endif
>>
>> err = grub_ieee1275_total_mem (&rmo_top);
>>
>> @@ -901,11 +905,32 @@ grub_claim_heap (void)
>> grub_mm_add_region_fn = grub_ieee1275_mm_add_region;
>>
>> #if defined(__powerpc__)
>> + /* Check if it's a CAS reboot with below property. If so, we will
>> skip CAS call */
>> + ibm_ca_support_reboot = 0;
>> + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
>> +
>> "ibm,client-architecture-support-reboot",
>> + &ibm_ca_support_reboot,
>> + sizeof
>> (ibm_ca_support_reboot),
>> + &actual) >= 0)
>> + grub_dprintf ("ieee1275",
>> "ibm,client-architecture-support-reboot: %u\n",
>> + ibm_ca_support_reboot);
>> +
>> if (grub_ieee1275_test_flag
>> (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY))
>> {
>> - /* if we have an error, don't call CAS, just hope for the best
>> */
>> - if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024))
>> - grub_ieee1275_ibm_cas ();
>> + /*
>> + * If we have an error or the reboot is detected as CAS reboot,
>> + * don't call CAS, just hope for the best.
>> + * Along with the above, if the rmo_top is 512 MB or above. We
>> + * will skip the CAS call. Though if we call CAS, the rmo_top
>> will
>> + * be set to 768 MB via CAS Vector2. This condition is required
>> to avoid the
>> + * issue where the older Linux kernels are still using rmo_top
>> as 512 MB.
>> + * Calling CAS when rmo_top is less then 768 MB will result in
>> a issue
>> + * where we won't be able to boot to a newer kernel and
>> continue to
>> + * boot with older kernel having rmo_top as 512 MB.
>> + */
>> + if (!ibm_ca_support_reboot && err == GRUB_ERR_NONE
>> + && rmo_top < (512 * 1024 * 1024))
>> + grub_ieee1275_ibm_cas ();
>> }
>> #endif
>>
>> --
>> 2.39.3
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: increase MIN RMA size for CAS negotiation
2025-01-15 12:16 [PATCH] powerpc: increase MIN RMA size for CAS negotiation Avnish Chouhan
2025-02-06 7:30 ` Michael Chang via Grub-devel
@ 2025-02-17 18:43 ` Mukesh Kumar Chaurasiya
2025-02-18 20:14 ` Leo Sandoval
2025-02-28 14:32 ` Daniel Kiper
2 siblings, 1 reply; 8+ messages in thread
From: Mukesh Kumar Chaurasiya @ 2025-02-17 18:43 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: daniel.kiper, brking, meghanaprakash, mamatha4, Avnish Chouhan
On Wed, Jan 15, 2025 at 05:46:05PM +0530, Avnish Chouhan wrote:
> Change RMA size from 512 MB to 768 MB which will result
> in more memory at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
> Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
> booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
> load the necessary. Sometimes even usage of CDROM which requires more
> memory for installation along with the options mentioned above troubles
> the boot memory and result in boot failures. Increasing the RMA size
> will resolves multiple out of memory issues observed in PowerPC.
>
> Failure details (GRUB2 debugs):
>
> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 1
> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
> space
> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 0
> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
> space
> kern/file.c:215: Closing `/ppc/ppc64/initrd.img' ...
> kern/disk.c:297: Closing
> `ieee1275//vdevice/v-scsi
> @30000067/disk@8300000000000000'...
> kern/disk.c:311: Closing
> `ieee1275//vdevice/v-scsi
> @30000067/disk@8300000000000000' succeeded.
> kern/file.c:225: Closing `/ppc/ppc64/initrd.img' failed with 3.
> kern/file.c:148: Opening `/ppc/ppc64/initrd.img' succeeded.
> error: ../../grub-core/kern/mm.c:552:out of memory.
>
> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
> ---
> grub-core/kern/ieee1275/init.c | 33 +++++++++++++++++++++++++++++----
> 1 file changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
> index dfbd0b8..502ebf1 100644
> --- a/grub-core/kern/ieee1275/init.c
> +++ b/grub-core/kern/ieee1275/init.c
> @@ -852,7 +852,7 @@ grub_ieee1275_ibm_cas (void)
> .vec1 = 0x80, /* ignore */
> .vec2_size = 1 + sizeof (struct option_vector2) - 2,
> .vec2 = {
> - 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
> + 0, 0, -1, -1, -1, -1, -1, 768, -1, 0, 48
> },
> .vec3_size = 2 - 1,
> .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */
> @@ -889,6 +889,10 @@ grub_claim_heap (void)
> {
> grub_err_t err;
> grub_uint32_t total = HEAP_MAX_SIZE;
> +#if defined(__powerpc__)
> + grub_uint32_t ibm_ca_support_reboot;
> + grub_ssize_t actual;
> +#endif
>
> err = grub_ieee1275_total_mem (&rmo_top);
>
> @@ -901,11 +905,32 @@ grub_claim_heap (void)
> grub_mm_add_region_fn = grub_ieee1275_mm_add_region;
>
> #if defined(__powerpc__)
> + /* Check if it's a CAS reboot with below property. If so, we will skip CAS call */
> + ibm_ca_support_reboot = 0;
> + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
> + "ibm,client-architecture-support-reboot",
> + &ibm_ca_support_reboot,
> + sizeof (ibm_ca_support_reboot),
> + &actual) >= 0)
> + grub_dprintf ("ieee1275", "ibm,client-architecture-support-reboot: %u\n",
> + ibm_ca_support_reboot);
> +
> if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY))
> {
> - /* if we have an error, don't call CAS, just hope for the best */
> - if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024))
> - grub_ieee1275_ibm_cas ();
> + /*
> + * If we have an error or the reboot is detected as CAS reboot,
> + * don't call CAS, just hope for the best.
> + * Along with the above, if the rmo_top is 512 MB or above. We
> + * will skip the CAS call. Though if we call CAS, the rmo_top will
> + * be set to 768 MB via CAS Vector2. This condition is required to avoid the
> + * issue where the older Linux kernels are still using rmo_top as 512 MB.
> + * Calling CAS when rmo_top is less then 768 MB will result in a issue
> + * where we won't be able to boot to a newer kernel and continue to
> + * boot with older kernel having rmo_top as 512 MB.
> + */
> + if (!ibm_ca_support_reboot && err == GRUB_ERR_NONE
> + && rmo_top < (512 * 1024 * 1024))
> + grub_ieee1275_ibm_cas ();
> }
> #endif
>
> --
> 2.39.3
>
>
LGTM
Reviewed-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: increase MIN RMA size for CAS negotiation
2025-02-17 18:43 ` Mukesh Kumar Chaurasiya
@ 2025-02-18 20:14 ` Leo Sandoval
0 siblings, 0 replies; 8+ messages in thread
From: Leo Sandoval @ 2025-02-18 20:14 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: daniel.kiper, brking, meghanaprakash, mamatha4, Avnish Chouhan
[-- Attachment #1.1: Type: text/plain, Size: 5168 bytes --]
LGTM
Reviewed-by: Leo Sandoval <lsandova@redhat.com>
On Mon, Feb 17, 2025 at 12:44 PM Mukesh Kumar Chaurasiya <
mchauras@linux.ibm.com> wrote:
> On Wed, Jan 15, 2025 at 05:46:05PM +0530, Avnish Chouhan wrote:
> > Change RMA size from 512 MB to 768 MB which will result
> > in more memory at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
> > Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
> > booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
> > load the necessary. Sometimes even usage of CDROM which requires more
> > memory for installation along with the options mentioned above troubles
> > the boot memory and result in boot failures. Increasing the RMA size
> > will resolves multiple out of memory issues observed in PowerPC.
> >
> > Failure details (GRUB2 debugs):
> >
> > kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 1
> > kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum
> runtime
> > space
> > kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 0
> > kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum
> runtime
> > space
> > kern/file.c:215: Closing `/ppc/ppc64/initrd.img' ...
> > kern/disk.c:297: Closing
> > `ieee1275//vdevice/v-scsi
> > @30000067/disk@8300000000000000'...
> > kern/disk.c:311: Closing
> > `ieee1275//vdevice/v-scsi
> > @30000067/disk@8300000000000000' succeeded.
> > kern/file.c:225: Closing `/ppc/ppc64/initrd.img' failed with 3.
> > kern/file.c:148: Opening `/ppc/ppc64/initrd.img' succeeded.
> > error: ../../grub-core/kern/mm.c:552:out of memory.
> >
> > Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
> > ---
> > grub-core/kern/ieee1275/init.c | 33 +++++++++++++++++++++++++++++----
> > 1 file changed, 29 insertions(+), 4 deletions(-)
> >
> > diff --git a/grub-core/kern/ieee1275/init.c
> b/grub-core/kern/ieee1275/init.c
> > index dfbd0b8..502ebf1 100644
> > --- a/grub-core/kern/ieee1275/init.c
> > +++ b/grub-core/kern/ieee1275/init.c
> > @@ -852,7 +852,7 @@ grub_ieee1275_ibm_cas (void)
> > .vec1 = 0x80, /* ignore */
> > .vec2_size = 1 + sizeof (struct option_vector2) - 2,
> > .vec2 = {
> > - 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
> > + 0, 0, -1, -1, -1, -1, -1, 768, -1, 0, 48
> > },
> > .vec3_size = 2 - 1,
> > .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if
> unsatisfied */
> > @@ -889,6 +889,10 @@ grub_claim_heap (void)
> > {
> > grub_err_t err;
> > grub_uint32_t total = HEAP_MAX_SIZE;
> > +#if defined(__powerpc__)
> > + grub_uint32_t ibm_ca_support_reboot;
> > + grub_ssize_t actual;
> > +#endif
> >
> > err = grub_ieee1275_total_mem (&rmo_top);
> >
> > @@ -901,11 +905,32 @@ grub_claim_heap (void)
> > grub_mm_add_region_fn = grub_ieee1275_mm_add_region;
> >
> > #if defined(__powerpc__)
> > + /* Check if it's a CAS reboot with below property. If so, we will
> skip CAS call */
> > + ibm_ca_support_reboot = 0;
> > + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
> > +
> "ibm,client-architecture-support-reboot",
> > + &ibm_ca_support_reboot,
> > + sizeof
> (ibm_ca_support_reboot),
> > + &actual) >= 0)
> > + grub_dprintf ("ieee1275", "ibm,client-architecture-support-reboot:
> %u\n",
> > + ibm_ca_support_reboot);
> > +
> > if (grub_ieee1275_test_flag
> (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY))
> > {
> > - /* if we have an error, don't call CAS, just hope for the best */
> > - if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024))
> > - grub_ieee1275_ibm_cas ();
> > + /*
> > + * If we have an error or the reboot is detected as CAS reboot,
> > + * don't call CAS, just hope for the best.
> > + * Along with the above, if the rmo_top is 512 MB or above. We
> > + * will skip the CAS call. Though if we call CAS, the rmo_top will
> > + * be set to 768 MB via CAS Vector2. This condition is required
> to avoid the
> > + * issue where the older Linux kernels are still using rmo_top as
> 512 MB.
> > + * Calling CAS when rmo_top is less then 768 MB will result in a
> issue
> > + * where we won't be able to boot to a newer kernel and continue
> to
> > + * boot with older kernel having rmo_top as 512 MB.
> > + */
> > + if (!ibm_ca_support_reboot && err == GRUB_ERR_NONE
> > + && rmo_top < (512 * 1024 * 1024))
> > + grub_ieee1275_ibm_cas ();
> > }
> > #endif
> >
> > --
> > 2.39.3
> >
> >
> LGTM
> Reviewed-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #1.2: Type: text/html, Size: 6822 bytes --]
[-- Attachment #2: Type: text/plain, Size: 141 bytes --]
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: increase MIN RMA size for CAS negotiation
2025-01-15 12:16 [PATCH] powerpc: increase MIN RMA size for CAS negotiation Avnish Chouhan
2025-02-06 7:30 ` Michael Chang via Grub-devel
2025-02-17 18:43 ` Mukesh Kumar Chaurasiya
@ 2025-02-28 14:32 ` Daniel Kiper
2 siblings, 0 replies; 8+ messages in thread
From: Daniel Kiper @ 2025-02-28 14:32 UTC (permalink / raw)
To: Avnish Chouhan
Cc: grub-devel, daniel.kiper, brking, meghanaprakash, mchauras,
mamatha4
On Wed, Jan 15, 2025 at 05:46:05PM +0530, Avnish Chouhan wrote:
> Change RMA size from 512 MB to 768 MB which will result
> in more memory at boot time for PowerPC. When PowerPC LPAR use/uses vTPM,
s#use/uses#uses#?
> Secure Boot or FADump, the 512 MB RMA memory is not sufficient for
> booting. With this 512 MB RMA, GRUB2 run out of memory and unable to
> load the necessary. Sometimes even usage of CDROM which requires more
"necessary" what?
> memory for installation along with the options mentioned above troubles
> the boot memory and result in boot failures. Increasing the RMA size
> will resolves multiple out of memory issues observed in PowerPC.
>
> Failure details (GRUB2 debugs):
>
> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 1
> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
> space
Could you fix line wraps in this console dump, i.e., full message in one
line should be in one line? And I suggest to add two space indention to
this dump to make commit message more readable...
> kern/ieee1275/init.c:550: mm requested region of size 8513000, flags 0
> kern/ieee1275/init.c:563: Cannot satisfy allocation and retain minimum runtime
> space
Ditto...
> kern/file.c:215: Closing `/ppc/ppc64/initrd.img' ...
> kern/disk.c:297: Closing
> `ieee1275//vdevice/v-scsi
> @30000067/disk@8300000000000000'...
> kern/disk.c:311: Closing
> `ieee1275//vdevice/v-scsi
> @30000067/disk@8300000000000000' succeeded.
And probably here...
> kern/file.c:225: Closing `/ppc/ppc64/initrd.img' failed with 3.
> kern/file.c:148: Opening `/ppc/ppc64/initrd.img' succeeded.
> error: ../../grub-core/kern/mm.c:552:out of memory.
>
> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
> ---
> grub-core/kern/ieee1275/init.c | 33 +++++++++++++++++++++++++++++----
> 1 file changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
> index dfbd0b8..502ebf1 100644
> --- a/grub-core/kern/ieee1275/init.c
> +++ b/grub-core/kern/ieee1275/init.c
> @@ -852,7 +852,7 @@ grub_ieee1275_ibm_cas (void)
> .vec1 = 0x80, /* ignore */
> .vec2_size = 1 + sizeof (struct option_vector2) - 2,
> .vec2 = {
> - 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48
> + 0, 0, -1, -1, -1, -1, -1, 768, -1, 0, 48
> },
> .vec3_size = 2 - 1,
> .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */
> @@ -889,6 +889,10 @@ grub_claim_heap (void)
> {
> grub_err_t err;
> grub_uint32_t total = HEAP_MAX_SIZE;
> +#if defined(__powerpc__)
> + grub_uint32_t ibm_ca_support_reboot;
> + grub_ssize_t actual;
> +#endif
>
> err = grub_ieee1275_total_mem (&rmo_top);
>
> @@ -901,11 +905,32 @@ grub_claim_heap (void)
> grub_mm_add_region_fn = grub_ieee1275_mm_add_region;
>
> #if defined(__powerpc__)
> + /* Check if it's a CAS reboot with below property. If so, we will skip CAS call */
I suppose this comment should be before the "if" below...
> + ibm_ca_support_reboot = 0;
Initialize this at definition.
> + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
> + "ibm,client-architecture-support-reboot",
> + &ibm_ca_support_reboot,
> + sizeof (ibm_ca_support_reboot),
> + &actual) >= 0)
> + grub_dprintf ("ieee1275", "ibm,client-architecture-support-reboot: %u\n",
> + ibm_ca_support_reboot);
> +
> if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY))
> {
> - /* if we have an error, don't call CAS, just hope for the best */
> - if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024))
> - grub_ieee1275_ibm_cas ();
> + /*
> + * If we have an error or the reboot is detected as CAS reboot,
> + * don't call CAS, just hope for the best.
> + * Along with the above, if the rmo_top is 512 MB or above. We
> + * will skip the CAS call. Though if we call CAS, the rmo_top will
> + * be set to 768 MB via CAS Vector2. This condition is required to avoid the
> + * issue where the older Linux kernels are still using rmo_top as 512 MB.
> + * Calling CAS when rmo_top is less then 768 MB will result in a issue
> + * where we won't be able to boot to a newer kernel and continue to
> + * boot with older kernel having rmo_top as 512 MB.
The last sentence does not parse. Could you rephrase it?
> + */
> + if (!ibm_ca_support_reboot && err == GRUB_ERR_NONE
> + && rmo_top < (512 * 1024 * 1024))
Please do not wrap this line.
> + grub_ieee1275_ibm_cas ();
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-02-28 14:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-15 12:16 [PATCH] powerpc: increase MIN RMA size for CAS negotiation Avnish Chouhan
2025-02-06 7:30 ` Michael Chang via Grub-devel
2025-02-06 8:39 ` Avnish Chouhan
2025-02-17 18:43 ` Mukesh Kumar Chaurasiya
2025-02-18 20:14 ` Leo Sandoval
2025-02-28 14:32 ` Daniel Kiper
-- strict thread matches above, loose matches on Subject: below --
2024-12-05 10:10 Avnish Chouhan
2024-12-05 12:05 ` Madhavan Srinivasan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.