Skip to contentSkip to conversation

kexec: Increase the upper limit for RAM segments

PATCH Superseded Sameer Goel 3 participants 4 messages Nov 11, 2016 – Nov 14, 2016

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kexec: Increase the upper limit for RAM segments

On a newer UEFI based Qualcomm target the number of system ram regions retrieved from /proc/iomem are ~40. So increasing the current hardcoded values to 64 from 16.

---
 kexec/arch/arm64/kexec-arm64.h | 2 +-
 kexec/kexec-syscall.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kexec/arch/arm64/kexec-arm64.h +1 -1
index bac62f8..bd4c20e 100644
@@ -11,7 +11,7 @@
 #include "image-header.h"
 #include "kexec.h"
 
-#define KEXEC_SEGMENT_MAX 16
+#define KEXEC_SEGMENT_MAX 64
 
 #define BOOT_BLOCK_VERSION 17
 #define BOOT_BLOCK_LAST_COMP_VERSION 16
kexec/kexec-syscall.h +1 -1
index c0d0bea..f84c937 100644
@@ -115,7 +115,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
 #define KEXEC_ARCH_MIPS    ( 8 << 16)
 #define KEXEC_ARCH_CRIS    (76 << 16)
 
-#define KEXEC_MAX_SEGMENTS 16
+#define KEXEC_MAX_SEGMENTS 64
 
 #ifdef __i386__
 #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_386
Signature · 7 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 3 lines · Sameer Goel

On a newer UEFI based Qualcomm target the number of system ram regions retrieved from /proc/iomem are ~40. So increasing the current hardcoded values to 64 from 16.

There is below uapi in kernel:
include/uapi/linux/kexec.h:#define KEXEC_SEGMENT_MAX 16

So you should fix it in kernel first and update the kexec-tools to use the kernel header file instead.

Thanks
Dave

Quoted 41 lines
---
 kexec/arch/arm64/kexec-arm64.h | 2 +-
 kexec/kexec-syscall.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kexec/arch/arm64/kexec-arm64.h +1 -1
index bac62f8..bd4c20e 100644
@@ -11,7 +11,7 @@
 #include "image-header.h"
 #include "kexec.h"
 
-#define KEXEC_SEGMENT_MAX 16
+#define KEXEC_SEGMENT_MAX 64
 
 #define BOOT_BLOCK_VERSION 17
 #define BOOT_BLOCK_LAST_COMP_VERSION 16
kexec/kexec-syscall.h +1 -1
index c0d0bea..f84c937 100644
@@ -115,7 +115,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
 #define KEXEC_ARCH_MIPS    ( 8 << 16)
 #define KEXEC_ARCH_CRIS    (76 << 16)
 
-#define KEXEC_MAX_SEGMENTS 16
+#define KEXEC_MAX_SEGMENTS 64
 
 #ifdef __i386__
 #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_386
Signature · 7 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.


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

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

#2 lore raw
In reply to Sameer Goel
Quoted 3 lines · Sameer Goel

On a newer UEFI based Qualcomm target the number of system ram regions retrieved from /proc/iomem are ~40. So increasing the current hardcoded values to 64 from 16.

I am a little confused, memory regions from /proc/iomem should be MAX_MEMORY_RANGES used as the elfcorehdr, while KEXEC_SEGMENT_MAX stands for the kexec segments passed to the kexec syscall, like kernel image, initrd image, purgatory, etc.

Do you mean KEXEC_SEGMENT_MAX or MAX_MEMORY_RANGES?

Regards,
Xunlei

Quoted 25 lines
---
 kexec/arch/arm64/kexec-arm64.h | 2 +-
 kexec/kexec-syscall.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kexec/arch/arm64/kexec-arm64.h +1 -1
index bac62f8..bd4c20e 100644
@@ -11,7 +11,7 @@
 #include "image-header.h"
 #include "kexec.h"
 
-#define KEXEC_SEGMENT_MAX 16
+#define KEXEC_SEGMENT_MAX 64
 
 #define BOOT_BLOCK_VERSION 17
 #define BOOT_BLOCK_LAST_COMP_VERSION 16
kexec/kexec-syscall.h +0 -0
index c0d0bea..f84c937 100644

kexec/kexec-syscall.h static inline long kexec_file_load(int kernel_fd, int initrd_fd, · line 121

Quoted 8 lines
kexec/kexec-syscall.h +1 -1
@@ -115,7 +115,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
 #define KEXEC_ARCH_MIPS    ( 8 << 16)
 #define KEXEC_ARCH_CRIS    (76 << 16)
 
-#define KEXEC_MAX_SEGMENTS 16
+#define KEXEC_MAX_SEGMENTS 64
 
 #ifdef __i386__
 #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_386

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

#3 lore raw

I meant MAX_MEMORY_RANGES. Updated KEXEC_SEGMENT_MAX to just match this. I can revert KEXEC_SEGMENT_MAX.

Thanks,
Sameer

Quoted 49 lines · Xunlei Pang
Quoted 3 lines · Sameer Goel

On a newer UEFI based Qualcomm target the number of system ram regions retrieved from /proc/iomem are ~40. So increasing the current hardcoded values to 64 from 16.

I am a little confused, memory regions from /proc/iomem should be MAX_MEMORY_RANGES used as the elfcorehdr, while KEXEC_SEGMENT_MAX stands for the kexec segments passed to the kexec syscall, like kernel image, initrd image, purgatory, etc.

Do you mean KEXEC_SEGMENT_MAX or MAX_MEMORY_RANGES?

Regards,
Xunlei

Quoted 33 lines
---
 kexec/arch/arm64/kexec-arm64.h | 2 +-
 kexec/kexec-syscall.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kexec/arch/arm64/kexec-arm64.h +1 -1
index bac62f8..bd4c20e 100644
@@ -11,7 +11,7 @@
 #include "image-header.h"
 #include "kexec.h"
 
-#define KEXEC_SEGMENT_MAX 16
+#define KEXEC_SEGMENT_MAX 64
 
 #define BOOT_BLOCK_VERSION 17
 #define BOOT_BLOCK_LAST_COMP_VERSION 16
kexec/kexec-syscall.h +1 -1
index c0d0bea..f84c937 100644
@@ -115,7 +115,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
 #define KEXEC_ARCH_MIPS    ( 8 << 16)
 #define KEXEC_ARCH_CRIS    (76 << 16)
 
-#define KEXEC_MAX_SEGMENTS 16
+#define KEXEC_MAX_SEGMENTS 64
 
 #ifdef __i386__
 #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_386
Signature · 8 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

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