Browse Source

Merge tag 'efi-2023-07-rc7' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc7

Documentation:

* Fix links to Linux kernel documentation

UEFI:

* Fix memory leak in efidebug dh subcommand
* Fix underflow when calculating remaining variable store size
* Increase default variable store size to 64 KiB
* mkeficapsule: fix efi_firmware_management_capsule_header data type
Tom Rini 11 months ago
parent
commit
8e21064cb3

+ 1 - 1
arch/x86/include/asm/bootparam.h

@@ -62,7 +62,7 @@ struct setup_indirect {
 /**
  * struct setup_header - Information needed by Linux to boot
  *
- * See https://www.kernel.org/doc/html/latest/x86/boot.html
+ * See https://www.kernel.org/doc/html/latest/arch/x86/boot.html
  */
 struct setup_header {
 	__u8	setup_sects;

+ 1 - 0
cmd/efidebug.c

@@ -486,6 +486,7 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag,
 			if (guidcmp(guid[j], &efi_guid_device_path))
 				printf("  %pUs\n", guid[j]);
 		}
+		efi_free_pool(guid);
 	}
 
 	efi_free_pool(handles);

+ 1 - 1
doc/develop/docstyle.rst

@@ -20,7 +20,7 @@ We apply the following rules:
 * For documentation we use reStructured text conforming to the requirements
   of `Sphinx <https://www.sphinx-doc.org>`_.
 * For documentation within code we follow the Linux kernel guide
-  `Writing kernel-doc comments <https://docs.kernel.org/doc-guide/kernel-doc.html>`_.
+  `Writing kernel-doc comments <https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html>`_.
 * We try to stick to 80 columns per line in documents.
 * For tables we prefer simple tables over grid tables. We avoid list tables
   as they make the reStructured text documents hard to read.

+ 1 - 1
doc/usage/blkmap.rst

@@ -19,7 +19,7 @@ wherever they might be located.
 The implementation is loosely modeled on Linux's "Device Mapper"
 subsystem, see `kernel documentation`_ for more information.
 
-.. _kernel documentation: https://docs.kernel.org/admin-guide/device-mapper/index.html
+.. _kernel documentation: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/index.html
 
 
 Example: Netbooting an Ext4 Image

+ 3 - 2
lib/efi_loader/Kconfig

@@ -96,7 +96,8 @@ endif
 
 config EFI_VAR_BUF_SIZE
 	int "Memory size of the UEFI variable store"
-	default 16384
+	default 16384 if EFI_MM_COMM_TEE
+	default 65536
 	range 4096 2147483647
 	help
 	  This defines the size in bytes of the memory area reserved for keeping
@@ -106,7 +107,7 @@ config EFI_VAR_BUF_SIZE
 	  match the value of PcdFlashNvStorageVariableSize used to compile the
 	  StandAloneMM module.
 
-	  Minimum 4096, default 16384.
+	  Minimum 4096, default 65536, or 16384 when using StandAloneMM.
 
 config EFI_GET_TIME
 	bool "GetTime() runtime service"

+ 4 - 0
lib/efi_loader/efi_var_mem.c

@@ -177,6 +177,10 @@ efi_status_t __efi_runtime efi_var_mem_ins(
 
 u64 __efi_runtime efi_var_mem_free(void)
 {
+	if (efi_var_buf->length + sizeof(struct efi_var_entry) >=
+	    EFI_VAR_BUF_SIZE)
+		return 0;
+
 	return EFI_VAR_BUF_SIZE - efi_var_buf->length -
 	       sizeof(struct efi_var_entry);
 }

+ 1 - 1
tools/eficapsule.h

@@ -63,7 +63,7 @@ struct efi_firmware_management_capsule_header {
 	uint32_t version;
 	uint16_t embedded_driver_count;
 	uint16_t payload_item_count;
-	uint32_t item_offset_list[];
+	uint64_t item_offset_list[];
 } __packed;
 
 /* image_capsule_support */