Skip to contentSkip to conversation

efi: bump up EFI_MMAP_NR_SLACK_SLOTS to 32

PATCH In review Hamza Mahfooz 3 participants 5 messages Dec 9, 2024 – Jan 7, 2025 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: bump up EFI_MMAP_NR_SLACK_SLOTS to 32

Recent platforms require more slack slots than the current value of EFI_MMAP_NR_SLACK_SLOTS, otherwise they fail to boot. The current workaround is to append efi=disable_early_pci_dma to the kernel's cmdline. So, bump up EFI_MMAP_NR_SLACK_SLOTS to 32 to allow those platforms to boot with the aforementioned workaround.

---
 drivers/firmware/efi/libstub/efistub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/libstub/efistub.h +1 -1
index 76e44c185f29..e95ce6ae5c26 100644
@@ -171,7 +171,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
  * the EFI memory map. Other related structures, e.g. x86 e820ext, need
  * to factor in this headroom requirement as well.
  */
-#define EFI_MMAP_NR_SLACK_SLOTS	8
+#define EFI_MMAP_NR_SLACK_SLOTS	32
 
 typedef struct efi_generic_dev_path efi_device_path_protocol_t;
 
Signature · 1 line
2.47.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Hamza Mahfooz

Recent platforms require more slack slots than the current value of EFI_MMAP_NR_SLACK_SLOTS, otherwise they fail to boot. The current workaround is to append efi=disable_early_pci_dma to the kernel's cmdline. So, bump up EFI_MMAP_NR_SLACK_SLOTS to 32 to allow those platforms to boot with the aforementioned workaround.

---
 drivers/firmware/efi/libstub/efistub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/libstub/efistub.h +0 -0
index 76e44c185f29..e95ce6ae5c26 100644

drivers/firmware/efi/libstub/efistub.h void efi_set_u64_split(u64 data, u32 *lo, u32 *hi) · line 177

Quoted 8 lines
drivers/firmware/efi/libstub/efistub.h +1 -1
@@ -171,7 +171,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
  * the EFI memory map. Other related structures, e.g. x86 e820ext, need
  * to factor in this headroom requirement as well.
  */
-#define EFI_MMAP_NR_SLACK_SLOTS        8
+#define EFI_MMAP_NR_SLACK_SLOTS        32
 
 typedef struct efi_generic_dev_path efi_device_path_protocol_t;
 
maintainer
#2 lore raw
Quoted 30 lines · Ard Biesheuvel
Quoted 27 lines · Hamza Mahfooz

Recent platforms require more slack slots than the current value of EFI_MMAP_NR_SLACK_SLOTS, otherwise they fail to boot. The current workaround is to append efi=disable_early_pci_dma to the kernel's cmdline. So, bump up EFI_MMAP_NR_SLACK_SLOTS to 32 to allow those platforms to boot with the aforementioned workaround.

---
 drivers/firmware/efi/libstub/efistub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/libstub/efistub.h +1 -1
index 76e44c185f29..e95ce6ae5c26 100644
@@ -171,7 +171,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
  * the EFI memory map. Other related structures, e.g. x86 e820ext, need
  * to factor in this headroom requirement as well.
  */
-#define EFI_MMAP_NR_SLACK_SLOTS        8
+#define EFI_MMAP_NR_SLACK_SLOTS        32
 
Quoted 4 lines

drivers/firmware/efi/libstub/efistub.h void efi_set_u64_split(u64 data, u32 *lo, u32 *hi) · line 177

Quoted 2 lines
drivers/firmware/efi/libstub/efistub.h +0 -0
 typedef struct efi_generic_dev_path efi_device_path_protocol_t;
 

I've queued this up for v6.14 now - once we are confident it does not cause any regressions, we can backport it to stable branches too.

#3 lore raw
Quoted 32 lines · Ard Biesheuvel
Quoted 30 lines · Ard Biesheuvel
Quoted 27 lines · Hamza Mahfooz

Recent platforms require more slack slots than the current value of EFI_MMAP_NR_SLACK_SLOTS, otherwise they fail to boot. The current workaround is to append efi=disable_early_pci_dma to the kernel's cmdline. So, bump up EFI_MMAP_NR_SLACK_SLOTS to 32 to allow those platforms to boot with the aforementioned workaround.

---
 drivers/firmware/efi/libstub/efistub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/libstub/efistub.h +1 -1
index 76e44c185f29..e95ce6ae5c26 100644
@@ -171,7 +171,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
  * the EFI memory map. Other related structures, e.g. x86 e820ext, need
  * to factor in this headroom requirement as well.
  */
-#define EFI_MMAP_NR_SLACK_SLOTS        8
+#define EFI_MMAP_NR_SLACK_SLOTS        32
 
Quoted 8 lines
Quoted 4 lines

drivers/firmware/efi/libstub/efistub.h void efi_set_u64_split(u64 data, u32 *lo, u32 *hi) · line 177

Quoted 2 lines
drivers/firmware/efi/libstub/efistub.h +0 -0
 typedef struct efi_generic_dev_path efi_device_path_protocol_t;
 

I've queued this up for v6.14 now - once we are confident it does not cause any regressions, we can backport it to stable branches too.

Hi. I had this issue three years ago, suggested the bump and then missed the reply.
We bumped it to 16 and have not had any issue or side effects in three years.

maintainer
#4 lore raw
Quoted 39 lines · Víctor Gonzalo
Quoted 37 lines · Ard Biesheuvel
Quoted 34 lines · Ard Biesheuvel
Quoted 21 lines · Hamza Mahfooz

Recent platforms require more slack slots than the current value of EFI_MMAP_NR_SLACK_SLOTS, otherwise they fail to boot. The current workaround is to append efi=disable_early_pci_dma to the kernel's cmdline. So, bump up EFI_MMAP_NR_SLACK_SLOTS to 32 to allow those platforms to boot with the aforementioned workaround.

---
 drivers/firmware/efi/libstub/efistub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/libstub/efistub.h +0 -0
index 76e44c185f29..e95ce6ae5c26 100644

drivers/firmware/efi/libstub/efistub.h void efi_set_u64_split(u64 data, u32 *lo, u32 *hi) · line 177

Quoted 8 lines
drivers/firmware/efi/libstub/efistub.h +1 -1
@@ -171,7 +171,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
  * the EFI memory map. Other related structures, e.g. x86 e820ext, need
  * to factor in this headroom requirement as well.
  */
-#define EFI_MMAP_NR_SLACK_SLOTS        8
+#define EFI_MMAP_NR_SLACK_SLOTS        32
 
 typedef struct efi_generic_dev_path efi_device_path_protocol_t;
 
Quoted 7 lines
Quoted 3 lines

I've queued this up for v6.14 now - once we are confident it does not cause any regressions, we can backport it to stable branches too.

Hi. I had this issue three years ago, suggested the bump and then missed the reply.
We bumped it to 16 and have not had any issue or side effects in three years.

Thanks for the data point.