Skip to content

Commit 792fc92

Browse files
committed
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
2 parents 9e87b63 + 36e4fc5 commit 792fc92

File tree

7 files changed

+27
-19
lines changed

7 files changed

+27
-19
lines changed

drivers/acpi/apei/apei-internal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#ifndef APEI_INTERNAL_H
88
#define APEI_INTERNAL_H
99

10-
#include <linux/cper.h>
1110
#include <linux/acpi.h>
1211

1312
struct apei_exec_context;
@@ -130,10 +129,5 @@ static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
130129
return sizeof(*estatus) + estatus->data_length;
131130
}
132131

133-
void cper_estatus_print(const char *pfx,
134-
const struct acpi_hest_generic_status *estatus);
135-
int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus);
136-
int cper_estatus_check(const struct acpi_hest_generic_status *estatus);
137-
138132
int apei_osc_setup(void);
139133
#endif

drivers/acpi/apei/bert.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/module.h>
2424
#include <linux/init.h>
2525
#include <linux/acpi.h>
26+
#include <linux/cper.h>
2627
#include <linux/io.h>
2728

2829
#include "apei-internal.h"

drivers/firmware/efi/libstub/Makefile.zboot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ zboot-size-len-$(CONFIG_KERNEL_GZIP) := 0
3232
$(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE
3333
$(call if_changed,$(zboot-method-y))
3434

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) \
3637
--rename-section .data=.gzdata,load,alloc,readonly,contents
3738
$(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
3839
$(call if_changed,objcopy)

drivers/firmware/efi/libstub/efistub.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,4 +1133,7 @@ const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record,
11331133
void efi_remap_image(unsigned long image_base, unsigned alloc_size,
11341134
unsigned long code_size);
11351135

1136+
asmlinkage efi_status_t __efiapi
1137+
efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab);
1138+
11361139
#endif

include/linux/cper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,4 +572,10 @@ void cper_print_proc_ia(const char *pfx,
572572
int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg);
573573
int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg);
574574

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+
575581
#endif

include/linux/efi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,4 +1338,6 @@ bool efi_config_table_is_usable(const efi_guid_t *guid, unsigned long table)
13381338
return xen_efi_config_table_is_usable(guid, table);
13391339
}
13401340

1341+
umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n);
1342+
13411343
#endif /* _LINUX_EFI_H */

include/linux/pe.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,26 @@
1111
#include <linux/types.h>
1212

1313
/*
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.
1820
*
1921
* The recommended way of loading and starting v1.0 or later kernels is to use
2022
* the LoadImage() and StartImage() EFI boot services, and expose the initrd
2123
* via the LINUX_EFI_INITRD_MEDIA_GUID device path.
2224
*
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).
2628
*
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/[email protected]/)
3031
*/
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
3334

3435
/*
3536
* LINUX_PE_MAGIC appears at offset 0x38 into the MS-DOS header of EFI bootable

0 commit comments

Comments
 (0)