Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'efi-fixes-for-v6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:
"A few minor fixes for EFI, one of which fixes the reported boot
regression when booting x86 kernels using the BIOS based loader built
into the hypervisor framework on macOS.

- fix harmless warning in zboot code on 'make clean'

- add some missing prototypes

- fix boot regressions triggered by PE/COFF header image minor
version bump"

* tag 'efi-fixes-for-v6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
efi: Bump stub image version for macOS HVF compatibility
efi: fix missing prototype warnings
efi/libstub: zboot: Avoid eager evaluation of objcopy flags

+27 -19
-6
drivers/acpi/apei/apei-internal.h
··· 7 7 #ifndef APEI_INTERNAL_H 8 8 #define APEI_INTERNAL_H 9 9 10 - #include <linux/cper.h> 11 10 #include <linux/acpi.h> 12 11 13 12 struct apei_exec_context; ··· 128 129 else 129 130 return sizeof(*estatus) + estatus->data_length; 130 131 } 131 - 132 - void cper_estatus_print(const char *pfx, 133 - const struct acpi_hest_generic_status *estatus); 134 - int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus); 135 - int cper_estatus_check(const struct acpi_hest_generic_status *estatus); 136 132 137 133 int apei_osc_setup(void); 138 134 #endif
+1
drivers/acpi/apei/bert.c
··· 23 23 #include <linux/module.h> 24 24 #include <linux/init.h> 25 25 #include <linux/acpi.h> 26 + #include <linux/cper.h> 26 27 #include <linux/io.h> 27 28 28 29 #include "apei-internal.h"
+2 -1
drivers/firmware/efi/libstub/Makefile.zboot
··· 32 32 $(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE 33 33 $(call if_changed,$(zboot-method-y)) 34 34 35 - OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \ 35 + # avoid eager evaluation to prevent references to non-existent build artifacts 36 + OBJCOPYFLAGS_vmlinuz.o = -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \ 36 37 --rename-section .data=.gzdata,load,alloc,readonly,contents 37 38 $(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE 38 39 $(call if_changed,objcopy)
+3
drivers/firmware/efi/libstub/efistub.h
··· 1133 1133 void efi_remap_image(unsigned long image_base, unsigned alloc_size, 1134 1134 unsigned long code_size); 1135 1135 1136 + asmlinkage efi_status_t __efiapi 1137 + efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab); 1138 + 1136 1139 #endif
+6
include/linux/cper.h
··· 572 572 int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg); 573 573 int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg); 574 574 575 + struct acpi_hest_generic_status; 576 + void cper_estatus_print(const char *pfx, 577 + const struct acpi_hest_generic_status *estatus); 578 + int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus); 579 + int cper_estatus_check(const struct acpi_hest_generic_status *estatus); 580 + 575 581 #endif
+2
include/linux/efi.h
··· 1338 1338 return xen_efi_config_table_is_usable(guid, table); 1339 1339 } 1340 1340 1341 + umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n); 1342 + 1341 1343 #endif /* _LINUX_EFI_H */
+13 -12
include/linux/pe.h
··· 11 11 #include <linux/types.h> 12 12 13 13 /* 14 - * Linux EFI stub v1.0 adds the following functionality: 15 - * - Loading initrd from the LINUX_EFI_INITRD_MEDIA_GUID device path, 16 - * - Loading/starting the kernel from firmware that targets a different 17 - * machine type, via the entrypoint exposed in the .compat PE/COFF section. 14 + * Starting from version v3.0, the major version field should be interpreted as 15 + * a bit mask of features supported by the kernel's EFI stub: 16 + * - 0x1: initrd loading from the LINUX_EFI_INITRD_MEDIA_GUID device path, 17 + * - 0x2: initrd loading using the initrd= command line option, where the file 18 + * may be specified using device path notation, and is not required to 19 + * reside on the same volume as the loaded kernel image. 18 20 * 19 21 * The recommended way of loading and starting v1.0 or later kernels is to use 20 22 * the LoadImage() and StartImage() EFI boot services, and expose the initrd 21 23 * via the LINUX_EFI_INITRD_MEDIA_GUID device path. 22 24 * 23 - * Versions older than v1.0 support initrd loading via the image load options 24 - * (using initrd=, limited to the volume from which the kernel itself was 25 - * loaded), or via arch specific means (bootparams, DT, etc). 25 + * Versions older than v1.0 may support initrd loading via the image load 26 + * options (using initrd=, limited to the volume from which the kernel itself 27 + * was loaded), or only via arch specific means (bootparams, DT, etc). 26 28 * 27 - * On x86, LoadImage() and StartImage() can be omitted if the EFI handover 28 - * protocol is implemented, which can be inferred from the version, 29 - * handover_offset and xloadflags fields in the bootparams structure. 29 + * The minor version field must remain 0x0. 30 + * (https://lore.kernel.org/all/efd6f2d4-547c-1378-1faa-53c044dbd297@gmail.com/) 30 31 */ 31 - #define LINUX_EFISTUB_MAJOR_VERSION 0x1 32 - #define LINUX_EFISTUB_MINOR_VERSION 0x1 32 + #define LINUX_EFISTUB_MAJOR_VERSION 0x3 33 + #define LINUX_EFISTUB_MINOR_VERSION 0x0 33 34 34 35 /* 35 36 * LINUX_PE_MAGIC appears at offset 0x38 into the MS-DOS header of EFI bootable