Commit 17baa442 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'efi-urgent-2020-07-25' of...

Merge tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master

Pull EFI fixes from Ingo Molnar:
 "Various EFI fixes:

   - Fix the layering violation in the use of the EFI runtime services
     availability mask in users of the 'efivars' abstraction

   - Revert build fix for GCC v4.8 which is no longer supported

   - Clean up some x86 EFI stub details, some of which are borderline
     bugs that copy around garbage into padding fields - let's fix these
     out of caution.

   - Fix build issues while working on RISC-V support

   - Avoid --whole-archive when linking the stub on arm64"

* tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi: Revert "efi/x86: Fix build with gcc 4"
  efi/efivars: Expose RT service availability via efivars abstraction
  efi/libstub: Move the function prototypes to header file
  efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds
  efi/libstub/arm64: link stub lib.a conditionally
  efi/x86: Only copy upto the end of setup_header
  efi/x86: Remove unused variables
parents 7cb3a5c5 74f85551
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ export TEXT_OFFSET

core-y		+= arch/arm64/
libs-y		:= arch/arm64/lib/ $(libs-y)
core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a

# Default target when executing plain make
boot		:= arch/arm64/boot
+1 −4
Original line number Diff line number Diff line
@@ -356,10 +356,7 @@ static struct pstore_info efi_pstore_info = {

static __init int efivars_pstore_init(void)
{
	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES))
		return 0;

	if (!efivars_kobject())
	if (!efivars_kobject() || !efivar_supports_writes())
		return 0;

	if (efivars_pstore_disable)
+8 −4
Original line number Diff line number Diff line
@@ -176,11 +176,13 @@ static struct efivar_operations generic_ops;
static int generic_ops_register(void)
{
	generic_ops.get_variable = efi.get_variable;
	generic_ops.set_variable = efi.set_variable;
	generic_ops.set_variable_nonblocking = efi.set_variable_nonblocking;
	generic_ops.get_next_variable = efi.get_next_variable;
	generic_ops.query_variable_store = efi_query_variable_store;

	if (efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE)) {
		generic_ops.set_variable = efi.set_variable;
		generic_ops.set_variable_nonblocking = efi.set_variable_nonblocking;
	}
	return efivars_register(&generic_efivars, &generic_ops, efi_kobj);
}

@@ -382,7 +384,8 @@ static int __init efisubsys_init(void)
		return -ENOMEM;
	}

	if (efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES)) {
	if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
				      EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
		efivar_ssdt_load();
		error = generic_ops_register();
		if (error)
@@ -416,7 +419,8 @@ static int __init efisubsys_init(void)
err_remove_group:
	sysfs_remove_group(efi_kobj, &efi_subsys_attr_group);
err_unregister:
	if (efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES))
	if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
				      EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME))
		generic_ops_unregister();
err_put:
	kobject_put(efi_kobj);
+1 −4
Original line number Diff line number Diff line
@@ -680,11 +680,8 @@ int efivars_sysfs_init(void)
	struct kobject *parent_kobj = efivars_kobject();
	int error = 0;

	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES))
		return -ENODEV;

	/* No efivars has been registered yet */
	if (!parent_kobj)
	if (!parent_kobj || !efivar_supports_writes())
		return 0;

	printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,
+1 −2
Original line number Diff line number Diff line
@@ -6,8 +6,7 @@
# enabled, even if doing so doesn't break the build.
#
cflags-$(CONFIG_X86_32)		:= -march=i386
cflags-$(CONFIG_X86_64)		:= -mcmodel=small \
				   $(call cc-option,-maccumulate-outgoing-args)
cflags-$(CONFIG_X86_64)		:= -mcmodel=small
cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ \
				   -fPIC -fno-strict-aliasing -mno-red-zone \
				   -mno-mmx -mno-sse -fshort-wchar \
Loading