Commit 792fc921 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 9e87b63e 36e4fc57
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#ifndef APEI_INTERNAL_H #ifndef APEI_INTERNAL_H
#define APEI_INTERNAL_H #define APEI_INTERNAL_H
#include <linux/cper.h>
#include <linux/acpi.h> #include <linux/acpi.h>
struct apei_exec_context; struct apei_exec_context;
...@@ -130,10 +129,5 @@ static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus) ...@@ -130,10 +129,5 @@ static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
return sizeof(*estatus) + estatus->data_length; return sizeof(*estatus) + estatus->data_length;
} }
void cper_estatus_print(const char *pfx,
const struct acpi_hest_generic_status *estatus);
int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus);
int cper_estatus_check(const struct acpi_hest_generic_status *estatus);
int apei_osc_setup(void); int apei_osc_setup(void);
#endif #endif
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/cper.h>
#include <linux/io.h> #include <linux/io.h>
#include "apei-internal.h" #include "apei-internal.h"
......
...@@ -32,7 +32,8 @@ zboot-size-len-$(CONFIG_KERNEL_GZIP) := 0 ...@@ -32,7 +32,8 @@ zboot-size-len-$(CONFIG_KERNEL_GZIP) := 0
$(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE $(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE
$(call if_changed,$(zboot-method-y)) $(call if_changed,$(zboot-method-y))
OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \ # avoid eager evaluation to prevent references to non-existent build artifacts
OBJCOPYFLAGS_vmlinuz.o = -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \
--rename-section .data=.gzdata,load,alloc,readonly,contents --rename-section .data=.gzdata,load,alloc,readonly,contents
$(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE $(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
......
...@@ -1133,4 +1133,7 @@ const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record, ...@@ -1133,4 +1133,7 @@ const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record,
void efi_remap_image(unsigned long image_base, unsigned alloc_size, void efi_remap_image(unsigned long image_base, unsigned alloc_size,
unsigned long code_size); unsigned long code_size);
asmlinkage efi_status_t __efiapi
efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab);
#endif #endif
...@@ -572,4 +572,10 @@ void cper_print_proc_ia(const char *pfx, ...@@ -572,4 +572,10 @@ void cper_print_proc_ia(const char *pfx,
int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg); int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg);
int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg); int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg);
struct acpi_hest_generic_status;
void cper_estatus_print(const char *pfx,
const struct acpi_hest_generic_status *estatus);
int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus);
int cper_estatus_check(const struct acpi_hest_generic_status *estatus);
#endif #endif
...@@ -1338,4 +1338,6 @@ bool efi_config_table_is_usable(const efi_guid_t *guid, unsigned long table) ...@@ -1338,4 +1338,6 @@ bool efi_config_table_is_usable(const efi_guid_t *guid, unsigned long table)
return xen_efi_config_table_is_usable(guid, table); return xen_efi_config_table_is_usable(guid, table);
} }
umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n);
#endif /* _LINUX_EFI_H */ #endif /* _LINUX_EFI_H */
...@@ -11,25 +11,26 @@ ...@@ -11,25 +11,26 @@
#include <linux/types.h> #include <linux/types.h>
/* /*
* Linux EFI stub v1.0 adds the following functionality: * Starting from version v3.0, the major version field should be interpreted as
* - Loading initrd from the LINUX_EFI_INITRD_MEDIA_GUID device path, * a bit mask of features supported by the kernel's EFI stub:
* - Loading/starting the kernel from firmware that targets a different * - 0x1: initrd loading from the LINUX_EFI_INITRD_MEDIA_GUID device path,
* machine type, via the entrypoint exposed in the .compat PE/COFF section. * - 0x2: initrd loading using the initrd= command line option, where the file
* may be specified using device path notation, and is not required to
* reside on the same volume as the loaded kernel image.
* *
* The recommended way of loading and starting v1.0 or later kernels is to use * The recommended way of loading and starting v1.0 or later kernels is to use
* the LoadImage() and StartImage() EFI boot services, and expose the initrd * the LoadImage() and StartImage() EFI boot services, and expose the initrd
* via the LINUX_EFI_INITRD_MEDIA_GUID device path. * via the LINUX_EFI_INITRD_MEDIA_GUID device path.
* *
* Versions older than v1.0 support initrd loading via the image load options * Versions older than v1.0 may support initrd loading via the image load
* (using initrd=, limited to the volume from which the kernel itself was * options (using initrd=, limited to the volume from which the kernel itself
* loaded), or via arch specific means (bootparams, DT, etc). * was loaded), or only via arch specific means (bootparams, DT, etc).
* *
* On x86, LoadImage() and StartImage() can be omitted if the EFI handover * The minor version field must remain 0x0.
* protocol is implemented, which can be inferred from the version, * (https://lore.kernel.org/all/efd6f2d4-547c-1378-1faa-53c044dbd297@gmail.com/)
* handover_offset and xloadflags fields in the bootparams structure.
*/ */
#define LINUX_EFISTUB_MAJOR_VERSION 0x1 #define LINUX_EFISTUB_MAJOR_VERSION 0x3
#define LINUX_EFISTUB_MINOR_VERSION 0x1 #define LINUX_EFISTUB_MINOR_VERSION 0x0
/* /*
* LINUX_PE_MAGIC appears at offset 0x38 into the MS-DOS header of EFI bootable * LINUX_PE_MAGIC appears at offset 0x38 into the MS-DOS header of EFI bootable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment