Skip to content

Commit b9394d8

Browse files
committed
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/efi changes from Peter Anvin: "The bulk of these changes are cleaning up the efivars handling and breaking it up into a tree of files. There are a number of fixes as well. The entire changeset is pretty big, but most of it is code movement. Several of these commits are quite new; the history got very messed up due to a mismerge with the urgent changes for rc8 which completely broke IA64, and so Ingo requested that we rebase it to straighten it out." * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: remove "kfree(NULL)" efi: locking fix in efivar_entry_set_safe() efi, pstore: Read data from variable store before memcpy() efi, pstore: Remove entry from list when erasing efi, pstore: Initialise 'entry' before iterating efi: split efisubsystem from efivars efivarfs: Move to fs/efivarfs efivars: Move pstore code into the new EFI directory efivars: efivar_entry API efivars: Keep a private global pointer to efivars efi: move utf16 string functions to efi.h x86, efi: Make efi_memblock_x86_reserve_range more readable efivarfs: convert to use simple_open()
2 parents 126de6b + 7b2dd6d commit b9394d8

22 files changed

Lines changed: 2796 additions & 2190 deletions

File tree

‎MAINTAINERS‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,9 +3025,18 @@ F: arch/ia64/kernel/efi.c
30253025
F: arch/x86/boot/compressed/eboot.[ch]
30263026
F: arch/x86/include/asm/efi.h
30273027
F: arch/x86/platform/efi/*
3028-
F: drivers/firmware/efivars.c
3028+
F: drivers/firmware/efi/*
30293029
F: include/linux/efi*.h
30303030

3031+
EFI VARIABLE FILESYSTEM
3032+
M: Matthew Garrett <matthew.garrett@nebula.com>
3033+
M: Jeremy Kerr <jk@ozlabs.org>
3034+
M: Matt Fleming <matt.fleming@intel.com>
3035+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
3036+
L: linux-efi@vger.kernel.org
3037+
S: Maintained
3038+
F: fs/efivarfs/
3039+
30313040
EFIFB FRAMEBUFFER DRIVER
30323041
L: linux-fbdev@vger.kernel.org
30333042
M: Peter Jones <pjones@redhat.com>
@@ -6391,7 +6400,7 @@ S: Maintained
63916400
T: git git://git.infradead.org/users/cbou/linux-pstore.git
63926401
F: fs/pstore/
63936402
F: include/linux/pstore*
6394-
F: drivers/firmware/efivars.c
6403+
F: drivers/firmware/efi/efi-pstore.c
63956404
F: drivers/acpi/apei/erst.c
63966405

63976406
PTP HARDWARE CLOCK SUPPORT

‎arch/ia64/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ config DMI
110110

111111
config EFI
112112
bool
113+
select UCS2_STRING
113114
default y
114115

115116
config SCHED_OMIT_FRAME_POINTER

‎arch/x86/platform/efi/efi.c‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -453,24 +453,25 @@ static void __init do_add_efi_memmap(void)
453453

454454
int __init efi_memblock_x86_reserve_range(void)
455455
{
456+
struct efi_info *e = &boot_params.efi_info;
456457
unsigned long pmap;
457458

458459
#ifdef CONFIG_X86_32
459460
/* Can't handle data above 4GB at this time */
460-
if (boot_params.efi_info.efi_memmap_hi) {
461+
if (e->efi_memmap_hi) {
461462
pr_err("Memory map is above 4GB, disabling EFI.\n");
462463
return -EINVAL;
463464
}
464-
pmap = boot_params.efi_info.efi_memmap;
465+
pmap = e->efi_memmap;
465466
#else
466-
pmap = (boot_params.efi_info.efi_memmap |
467-
((__u64)boot_params.efi_info.efi_memmap_hi<<32));
467+
pmap = (e->efi_memmap | ((__u64)e->efi_memmap_hi << 32));
468468
#endif
469-
memmap.phys_map = (void *)pmap;
470-
memmap.nr_map = boot_params.efi_info.efi_memmap_size /
471-
boot_params.efi_info.efi_memdesc_size;
472-
memmap.desc_version = boot_params.efi_info.efi_memdesc_version;
473-
memmap.desc_size = boot_params.efi_info.efi_memdesc_size;
469+
memmap.phys_map = (void *)pmap;
470+
memmap.nr_map = e->efi_memmap_size /
471+
e->efi_memdesc_size;
472+
memmap.desc_size = e->efi_memdesc_size;
473+
memmap.desc_version = e->efi_memdesc_version;
474+
474475
memblock_reserve(pmap, memmap.nr_map * memmap.desc_size);
475476

476477
return 0;

‎drivers/firmware/Kconfig‎

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,6 @@ config FIRMWARE_MEMMAP
3636

3737
See also Documentation/ABI/testing/sysfs-firmware-memmap.
3838

39-
config EFI_VARS
40-
tristate "EFI Variable Support via sysfs"
41-
depends on EFI
42-
select UCS2_STRING
43-
default n
44-
help
45-
If you say Y here, you are able to get EFI (Extensible Firmware
46-
Interface) variable information via sysfs. You may read,
47-
write, create, and destroy EFI variables through this interface.
48-
49-
Note that using this driver in concert with efibootmgr requires
50-
at least test release version 0.5.0-test3 or later, which is
51-
available from Matt Domsch's website located at:
52-
<http://linux.dell.com/efibootmgr/testing/efibootmgr-0.5.0-test3.tar.gz>
53-
54-
Subsequent efibootmgr releases may be found at:
55-
<http://linux.dell.com/efibootmgr>
56-
57-
config EFI_VARS_PSTORE
58-
bool "Register efivars backend for pstore"
59-
depends on EFI_VARS && PSTORE
60-
default y
61-
help
62-
Say Y here to enable use efivars as a backend to pstore. This
63-
will allow writing console messages, crash dumps, or anything
64-
else supported by pstore to EFI variables.
65-
66-
config EFI_VARS_PSTORE_DEFAULT_DISABLE
67-
bool "Disable using efivars as a pstore backend by default"
68-
depends on EFI_VARS_PSTORE
69-
default n
70-
help
71-
Saying Y here will disable the use of efivars as a storage
72-
backend for pstore by default. This setting can be overridden
73-
using the efivars module's pstore_disable parameter.
74-
7539
config EFI_PCDP
7640
bool "Console device selection via EFI PCDP or HCDP table"
7741
depends on ACPI && EFI && IA64
@@ -165,5 +129,6 @@ config ISCSI_IBFT
165129
Otherwise, say N.
166130

167131
source "drivers/firmware/google/Kconfig"
132+
source "drivers/firmware/efi/Kconfig"
168133

169134
endmenu

‎drivers/firmware/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
obj-$(CONFIG_DMI) += dmi_scan.o
55
obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o
66
obj-$(CONFIG_EDD) += edd.o
7-
obj-$(CONFIG_EFI_VARS) += efivars.o
87
obj-$(CONFIG_EFI_PCDP) += pcdp.o
98
obj-$(CONFIG_DELL_RBU) += dell_rbu.o
109
obj-$(CONFIG_DCDBAS) += dcdbas.o
@@ -14,3 +13,4 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
1413
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
1514

1615
obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
16+
obj-$(CONFIG_EFI) += efi/

‎drivers/firmware/efi/Kconfig‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
menu "EFI (Extensible Firmware Interface) Support"
2+
depends on EFI
3+
4+
config EFI_VARS
5+
tristate "EFI Variable Support via sysfs"
6+
depends on EFI
7+
default n
8+
help
9+
If you say Y here, you are able to get EFI (Extensible Firmware
10+
Interface) variable information via sysfs. You may read,
11+
write, create, and destroy EFI variables through this interface.
12+
13+
Note that using this driver in concert with efibootmgr requires
14+
at least test release version 0.5.0-test3 or later, which is
15+
available from Matt Domsch's website located at:
16+
<http://linux.dell.com/efibootmgr/testing/efibootmgr-0.5.0-test3.tar.gz>
17+
18+
Subsequent efibootmgr releases may be found at:
19+
<http://linux.dell.com/efibootmgr>
20+
21+
config EFI_VARS_PSTORE
22+
tristate "Register efivars backend for pstore"
23+
depends on EFI_VARS && PSTORE
24+
default y
25+
help
26+
Say Y here to enable use efivars as a backend to pstore. This
27+
will allow writing console messages, crash dumps, or anything
28+
else supported by pstore to EFI variables.
29+
30+
config EFI_VARS_PSTORE_DEFAULT_DISABLE
31+
bool "Disable using efivars as a pstore backend by default"
32+
depends on EFI_VARS_PSTORE
33+
default n
34+
help
35+
Saying Y here will disable the use of efivars as a storage
36+
backend for pstore by default. This setting can be overridden
37+
using the efivars module's pstore_disable parameter.
38+
39+
endmenu

‎drivers/firmware/efi/Makefile‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# Makefile for linux kernel
3+
#
4+
obj-y += efi.o vars.o
5+
obj-$(CONFIG_EFI_VARS) += efivars.o
6+
obj-$(CONFIG_EFI_VARS_PSTORE) += efi-pstore.o

0 commit comments

Comments
 (0)