Skip to contentSkip to conversation

riscv: efi: Bump number of memregions

PATCH In review Andrew Jones 2 participants 2 messages Jan 29, 2025

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

PATCH 1/1 riscv: efi: Bump number of memregions

There may be a bunch of EFI memory regions in the EFI memory map, which we convert to k-u-t memregions. Bump the number we allow to ensure we don't hit the assert in memregions_add().

---

I noticed that the gitlab CI started failing the riscv EFI tests. It looks like the edk2 used by CI has been updated to a version later than what I was using locally and the newer one has several more memory regions.

 lib/riscv/setup.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/riscv/setup.c +4 -0
index 211945448b0f..a30aa0c4cb80 100644
@@ -31,7 +31,11 @@
 #endif
 
 #define MAX_DT_MEM_REGIONS	16
+#ifdef CONFIG_EFI
+#define NR_MEM_REGIONS		(MAX_DT_MEM_REGIONS + 128)
+#else
 #define NR_MEM_REGIONS		(MAX_DT_MEM_REGIONS + 16)
+#endif
 
 extern unsigned long _etext;
 
Signature · 7 lines
2.48.1


-- 
kvm-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kvm-riscv
#1 lore raw
Quoted 34 lines · Andrew Jones

There may be a bunch of EFI memory regions in the EFI memory map, which we convert to k-u-t memregions. Bump the number we allow to ensure we don't hit the assert in memregions_add().

---

I noticed that the gitlab CI started failing the riscv EFI tests. It looks like the edk2 used by CI has been updated to a version later than what I was using locally and the newer one has several more memory regions.

 lib/riscv/setup.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/riscv/setup.c +4 -0
index 211945448b0f..a30aa0c4cb80 100644
@@ -31,7 +31,11 @@
 #endif
 
 #define MAX_DT_MEM_REGIONS	16
+#ifdef CONFIG_EFI
+#define NR_MEM_REGIONS		(MAX_DT_MEM_REGIONS + 128)
+#else
 #define NR_MEM_REGIONS		(MAX_DT_MEM_REGIONS + 16)
+#endif
 
 extern unsigned long _etext;
 
Signature · 1 line
2.48.1

Merged.

Signature · 3 lines
kvm-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kvm-riscv