Skip to contentSkip to conversation

ppc64: remove rma_top limit

PATCH In review Sourabh Jain 4 participants 8 messages Sep 15, 2022 – Oct 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc64: remove rma_top limit

Restricting kexec tool to allocate hole for kexec segments below 768MB may not be relavent now since first memory block size can be 1024MB and more.

Removing rma_top restriction will give more space to find holes for kexec segments and existing in-place checks make sure that kexec segment allocation doesn't cross the first memory block because every kexec segment has to be within first memory block for kdump kernel to boot properly.

---
 kexec/arch/ppc64/kexec-ppc64.c | 2 --
 1 file changed, 2 deletions(-)
kexec/arch/ppc64/kexec-ppc64.c +0 -2
index 5b17740..611809f 100644
@@ -717,8 +717,6 @@ static int get_devtree_details(unsigned long kexec_flags)
 			if (base < rma_base) {
 				rma_base = base;
 				rma_top = base + be64_to_cpu(((uint64_t *)buf)[1]);
-				if (rma_top > 0x30000000UL)
-					rma_top = 0x30000000UL;
 			}
 
 			fclose(file);
Signature · 7 lines
2.37.3


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Sourabh Jain

Restricting kexec tool to allocate hole for kexec segments below 768MB may not be relavent now since first memory block size can be 1024MB and more.

Removing rma_top restriction will give more space to find holes for kexec segments and existing in-place checks make sure that kexec segment allocation doesn't cross the first memory block because every kexec segment has to be within first memory block for kdump kernel to boot properly.

Yeah. The restriction seems arbitrary. Even more so since commit 47478ea66d43 ("kexec-tools: ppc64: fix how RMA top is deduced") with which kexec_load was sure to place all segments within the first memory block. So, the change looks good to me.

Quoted 9 lines
---
  kexec/arch/ppc64/kexec-ppc64.c | 2 --
  1 file changed, 2 deletions(-)
kexec/arch/ppc64/kexec-ppc64.c +0 -0
index 5b17740..611809f 100644

kexec/arch/ppc64/kexec-ppc64.c static int get_devtree_details(unsigned long kexec_flags) · line 722

Quoted 8 lines
kexec/arch/ppc64/kexec-ppc64.c +0 -2
@@ -717,8 +717,6 @@ static int get_devtree_details(unsigned long kexec_flags)
  			if (base < rma_base) {
  				rma_base = base;
  				rma_top = base + be64_to_cpu(((uint64_t *)buf)[1]);
-				if (rma_top > 0x30000000UL)
-					rma_top = 0x30000000UL;
  			}
 
  			fclose(file);

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 12 lines · Hari Bathini
Quoted 9 lines · Sourabh Jain

Restricting kexec tool to allocate hole for kexec segments below 768MB may not be relavent now since first memory block size can be 1024MB and more.

Removing rma_top restriction will give more space to find holes for kexec segments and existing in-place checks make sure that kexec segment allocation doesn't cross the first memory block because every kexec segment has to be within first memory block for kdump kernel to boot properly.

Quoted 8 lines
Quoted 1 line

Yeah. The restriction seems arbitrary. Even more so since commit 47478ea66d43 ("kexec-tools: ppc64: fix how RMA top is deduced") with which kexec_load was sure to place all segments within the first memory block. So, the change looks good to me.

Thank you!

Sourabh Jain

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
In reply to Sourabh Jain

Hi,

I'm curious to ask which bug this patch is going to fix. I tested it yesterday and it doesn't fix
https://bugzilla.redhat.com/show_bug.cgi?id=2126409.

Quoted 36 lines · Sourabh Jain

Restricting kexec tool to allocate hole for kexec segments below 768MB may not be relavent now since first memory block size can be 1024MB and more.

Removing rma_top restriction will give more space to find holes for kexec segments and existing in-place checks make sure that kexec segment allocation doesn't cross the first memory block because every kexec segment has to be within first memory block for kdump kernel to boot properly.

---
kexec/arch/ppc64/kexec-ppc64.c | 2 --

1 file changed, 2 deletions(-)
kexec/arch/ppc64/kexec-ppc64.c +0 -2
index 5b17740..611809f 100644
@@ -717,8 +717,6 @@ static int get_devtree_details(unsigned long kexec_flags)
 			if (base < rma_base) {
 				rma_base = base;
 				rma_top = base + be64_to_cpu(((uint64_t *)buf)[1]);
-				if (rma_top > 0x30000000UL)
-					rma_top = 0x30000000UL;
 			}
 
 			fclose(file);
Signature · 7 lines
2.37.3


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Signature · 8 lines
Best regards,
Coiby


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#4 lore raw

Hi Sourabh,

could you address this question?
It would be good to know before applying this patch.

Thanks in advance,
Simon

Quoted 38 lines · Coiby Xu

Hi,

I'm curious to ask which bug this patch is going to fix. I tested it yesterday and it doesn't fix
https://bugzilla.redhat.com/show_bug.cgi?id=2126409.

Quoted 31 lines · Sourabh Jain

Restricting kexec tool to allocate hole for kexec segments below 768MB may not be relavent now since first memory block size can be 1024MB and more.

Removing rma_top restriction will give more space to find holes for kexec segments and existing in-place checks make sure that kexec segment allocation doesn't cross the first memory block because every kexec segment has to be within first memory block for kdump kernel to boot properly.

---
kexec/arch/ppc64/kexec-ppc64.c | 2 --

1 file changed, 2 deletions(-)
kexec/arch/ppc64/kexec-ppc64.c +0 -2
index 5b17740..611809f 100644
@@ -717,8 +717,6 @@ static int get_devtree_details(unsigned long kexec_flags)
 			if (base < rma_base) {
 				rma_base = base;
 				rma_top = base + be64_to_cpu(((uint64_t *)buf)[1]);
-				if (rma_top > 0x30000000UL)
-					rma_top = 0x30000000UL;
 			}
 
 			fclose(file);
Signature · 1 line
2.37.3
Quoted 16 lines
Quoted 5 lines

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Signature · 8 lines
Best regards,
Coiby


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#6 lore raw
Quoted 8 lines · Sourabh Jain

Hello Simon,

Quoted 4 lines · Simon Horman

Hi Sourabh,

could you address this question?
It would be good to know before applying this patch.

Apologies for the delayed response, query is answered now.

Thanks, and likewise sorry for the delay.

I've applied this patch.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#7 lore raw
In reply to Coiby Xu

Hello Coiby,

Quoted 5 lines

Hi,

I'm curious to ask which bug this patch is going to fix. I tested it yesterday and it doesn't fix
https://bugzilla.redhat.com/show_bug.cgi?id=2126409.

This patch doesn't fix the above bug, instead it enables kexec tool to look for memory holes for kexec segments beyond 768MB (an arbitrary limit).

It is helpful for the case where the segments could not accommodated below 768MB due to bigger kernel/initrd/FDT size.

Thanks,
Sourabh Jain

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec