Commit ae8b53aa authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'efi-next-for-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI updates from Ard Biesheuvel:

 - Increase the headroom in the EFI memory map allocation created by the
   EFI stub. This is needed because event callbacks called during
   ExitBootServices() may cause fragmentation, and reallocation is not
   allowed after that.

 - Drop obsolete UGA graphics code and switch to a more ergonomic API to
   traverse handle buffers. Simplify some error paths using a __free()
   helper while at it.

 - Fix some W=1 warnings when CONFIG_EFI=n

 - Rely on the dentry cache to keep track of the contents of the
   efivarfs filesystem, rather than using a separate linked list.

 - Improve and extend efivarfs test cases.

 - Synchronize efivarfs with underlying variable store on resume from
   hibernation - this is needed because the firmware itself or another
   OS running on the same machine may have modified it.

 - Fix x86 EFI stub build with GCC 15.

 - Fix kexec/x86 false positive warning in EFI memory attributes table
   sanity check.

* tag 'efi-next-for-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: (23 commits)
  x86/efi: skip memattr table on kexec boot
  efivarfs: add variable resync after hibernation
  efivarfs: abstract initial variable creation routine
  efi: libstub: Use '-std=gnu11' to fix build with GCC 15
  selftests/efivarfs: add concurrent update tests
  selftests/efivarfs: fix tests for failed write removal
  efivarfs: fix error on write to new variable leaving remnants
  efivarfs: remove unused efivarfs_list
  efivarfs: move variable lifetime management into the inodes
  selftests/efivarfs: add check for disallowing file truncation
  efivarfs: prevent setting of zero size on the inodes in the cache
  efi: sysfb_efi: fix W=1 warnings when EFI is not set
  efi/libstub: Use __free() helper for pool deallocations
  efi/libstub: Use cleanup helpers for freeing copies of the memory map
  efi/libstub: Simplify PCI I/O handle buffer traversal
  efi/libstub: Refactor and clean up GOP resolution picker code
  efi/libstub: Simplify GOP handling code
  efi/libstub: Use C99-style for loop to traverse handle buffer
  x86/efistub: Drop long obsolete UGA support
  efivarfs: make variable_is_present use dcache lookup
  ...
parents f345fc7a 64b45dd4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -250,6 +250,9 @@ static inline u32 efi64_convert_status(efi_status_t status)
#define __efi64_argmap_allocate_pool(type, size, buffer)		\
	((type), (size), efi64_zero_upper(buffer))

#define __efi64_argmap_locate_handle_buffer(type, proto, key, num, buf)	\
	((type), (proto), (key), efi64_zero_upper(num), efi64_zero_upper(buf))

#define __efi64_argmap_create_event(type, tpl, f, c, event)		\
	((type), (tpl), (f), (c), efi64_zero_upper(event))

+0 −10
Original line number Diff line number Diff line
@@ -54,13 +54,11 @@
#include <asm/uv/uv.h>

static unsigned long efi_systab_phys __initdata;
static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR;
static unsigned long efi_runtime, efi_nr_tables;

unsigned long efi_fw_vendor, efi_config_table;

static const efi_config_table_type_t arch_tables[] __initconst = {
	{UGA_IO_PROTOCOL_GUID,		&uga_phys,		"UGA"		},
#ifdef CONFIG_X86_UV
	{UV_SYSTEM_TABLE_GUID,		&uv_systab_phys,	"UVsystab"	},
#endif
@@ -72,7 +70,6 @@ static const unsigned long * const efi_tables[] = {
	&efi.acpi20,
	&efi.smbios,
	&efi.smbios3,
	&uga_phys,
#ifdef CONFIG_X86_UV
	&uv_systab_phys,
#endif
@@ -891,13 +888,6 @@ bool efi_is_table_address(unsigned long phys_addr)
	return false;
}

char *efi_systab_show_arch(char *str)
{
	if (uga_phys != EFI_INVALID_TABLE_ADDR)
		str += sprintf(str, "UGA=0x%lx\n", uga_phys);
	return str;
}

#define EFI_FIELD(var) efi_ ## var

#define EFI_ATTR_SHOW(name) \
+5 −0
Original line number Diff line number Diff line
@@ -561,6 +561,11 @@ int __init efi_reuse_config(u64 tables, int nr_tables)

		if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID))
			((efi_config_table_64_t *)p)->table = data->smbios;

		/* Do not bother to play with mem attr table across kexec */
		if (!efi_guidcmp(guid, EFI_MEMORY_ATTRIBUTES_TABLE_GUID))
			((efi_config_table_64_t *)p)->table = EFI_INVALID_TABLE_ADDR;

		p += sz;
	}
	early_memunmap(tablep, nr_tables * sz);
+0 −3
Original line number Diff line number Diff line
@@ -148,9 +148,6 @@ static ssize_t systab_show(struct kobject *kobj,
	if (efi.smbios != EFI_INVALID_TABLE_ADDR)
		str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);

	if (IS_ENABLED(CONFIG_X86))
		str = efi_systab_show_arch(str);

	return str - buf;
}

+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ cflags-y := $(KBUILD_CFLAGS)

cflags-$(CONFIG_X86_32)		:= -march=i386
cflags-$(CONFIG_X86_64)		:= -mcmodel=small
cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ \
cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ -std=gnu11 \
				   -fPIC -fno-strict-aliasing -mno-red-zone \
				   -mno-mmx -mno-sse -fshort-wchar \
				   -Wno-pointer-sign \
Loading