diff options
-rw-r--r-- | arch/arm64/kernel/efi-stub.c | 14 | ||||
-rw-r--r-- | block/partitions/efi.c | 2 | ||||
-rw-r--r-- | drivers/firmware/efi/Kconfig | 4 | ||||
-rw-r--r-- | drivers/firmware/efi/efi.c | 17 | ||||
-rw-r--r-- | drivers/firmware/efi/efivars.c | 6 | ||||
-rw-r--r-- | drivers/firmware/efi/libstub/Makefile | 14 | ||||
-rw-r--r-- | drivers/firmware/efi/libstub/arm-stub.c | 8 | ||||
-rw-r--r-- | drivers/firmware/efi/libstub/efi-stub-helper.c | 18 | ||||
-rw-r--r-- | drivers/firmware/efi/runtime-map.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-efi.c | 1 | ||||
-rw-r--r-- | fs/Kconfig | 2 | ||||
-rw-r--r-- | fs/efivarfs/Kconfig | 1 | ||||
-rw-r--r-- | fs/efivarfs/super.c | 2 | ||||
-rw-r--r-- | include/linux/efi.h | 2 |
14 files changed, 58 insertions, 35 deletions
diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c index d27dd982ff26..f5374065ad53 100644 --- a/arch/arm64/kernel/efi-stub.c +++ b/arch/arm64/kernel/efi-stub.c | |||
@@ -13,13 +13,13 @@ | |||
13 | #include <asm/efi.h> | 13 | #include <asm/efi.h> |
14 | #include <asm/sections.h> | 14 | #include <asm/sections.h> |
15 | 15 | ||
16 | efi_status_t handle_kernel_image(efi_system_table_t *sys_table, | 16 | efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table, |
17 | unsigned long *image_addr, | 17 | unsigned long *image_addr, |
18 | unsigned long *image_size, | 18 | unsigned long *image_size, |
19 | unsigned long *reserve_addr, | 19 | unsigned long *reserve_addr, |
20 | unsigned long *reserve_size, | 20 | unsigned long *reserve_size, |
21 | unsigned long dram_base, | 21 | unsigned long dram_base, |
22 | efi_loaded_image_t *image) | 22 | efi_loaded_image_t *image) |
23 | { | 23 | { |
24 | efi_status_t status; | 24 | efi_status_t status; |
25 | unsigned long kernel_size, kernel_memsize = 0; | 25 | unsigned long kernel_size, kernel_memsize = 0; |
diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 56d08fd75b1a..26cb624ace05 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c | |||
@@ -715,7 +715,7 @@ int efi_partition(struct parsed_partitions *state) | |||
715 | state->parts[i + 1].flags = ADDPART_FLAG_RAID; | 715 | state->parts[i + 1].flags = ADDPART_FLAG_RAID; |
716 | 716 | ||
717 | info = &state->parts[i + 1].info; | 717 | info = &state->parts[i + 1].info; |
718 | efi_guid_unparse(&ptes[i].unique_partition_guid, info->uuid); | 718 | efi_guid_to_str(&ptes[i].unique_partition_guid, info->uuid); |
719 | 719 | ||
720 | /* Naively convert UTF16-LE to 7 bits. */ | 720 | /* Naively convert UTF16-LE to 7 bits. */ |
721 | label_max = min(ARRAY_SIZE(info->volname) - 1, | 721 | label_max = min(ARRAY_SIZE(info->volname) - 1, |
diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig index f712d47f30d8..8de4da5c9ab6 100644 --- a/drivers/firmware/efi/Kconfig +++ b/drivers/firmware/efi/Kconfig | |||
@@ -12,11 +12,11 @@ config EFI_VARS | |||
12 | 12 | ||
13 | Note that using this driver in concert with efibootmgr requires | 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 | 14 | at least test release version 0.5.0-test3 or later, which is |
15 | available from Matt Domsch's website located at: | 15 | available from: |
16 | <http://linux.dell.com/efibootmgr/testing/efibootmgr-0.5.0-test3.tar.gz> | 16 | <http://linux.dell.com/efibootmgr/testing/efibootmgr-0.5.0-test3.tar.gz> |
17 | 17 | ||
18 | Subsequent efibootmgr releases may be found at: | 18 | Subsequent efibootmgr releases may be found at: |
19 | <http://linux.dell.com/efibootmgr> | 19 | <http://github.com/vathpela/efibootmgr> |
20 | 20 | ||
21 | config EFI_VARS_PSTORE | 21 | config EFI_VARS_PSTORE |
22 | tristate "Register efivars backend for pstore" | 22 | tristate "Register efivars backend for pstore" |
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 9035c1b74d58..fccb464928c3 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c | |||
@@ -115,15 +115,24 @@ EFI_ATTR_SHOW(fw_vendor); | |||
115 | EFI_ATTR_SHOW(runtime); | 115 | EFI_ATTR_SHOW(runtime); |
116 | EFI_ATTR_SHOW(config_table); | 116 | EFI_ATTR_SHOW(config_table); |
117 | 117 | ||
118 | static ssize_t fw_platform_size_show(struct kobject *kobj, | ||
119 | struct kobj_attribute *attr, char *buf) | ||
120 | { | ||
121 | return sprintf(buf, "%d\n", efi_enabled(EFI_64BIT) ? 64 : 32); | ||
122 | } | ||
123 | |||
118 | static struct kobj_attribute efi_attr_fw_vendor = __ATTR_RO(fw_vendor); | 124 | static struct kobj_attribute efi_attr_fw_vendor = __ATTR_RO(fw_vendor); |
119 | static struct kobj_attribute efi_attr_runtime = __ATTR_RO(runtime); | 125 | static struct kobj_attribute efi_attr_runtime = __ATTR_RO(runtime); |
120 | static struct kobj_attribute efi_attr_config_table = __ATTR_RO(config_table); | 126 | static struct kobj_attribute efi_attr_config_table = __ATTR_RO(config_table); |
127 | static struct kobj_attribute efi_attr_fw_platform_size = | ||
128 | __ATTR_RO(fw_platform_size); | ||
121 | 129 | ||
122 | static struct attribute *efi_subsys_attrs[] = { | 130 | static struct attribute *efi_subsys_attrs[] = { |
123 | &efi_attr_systab.attr, | 131 | &efi_attr_systab.attr, |
124 | &efi_attr_fw_vendor.attr, | 132 | &efi_attr_fw_vendor.attr, |
125 | &efi_attr_runtime.attr, | 133 | &efi_attr_runtime.attr, |
126 | &efi_attr_config_table.attr, | 134 | &efi_attr_config_table.attr, |
135 | &efi_attr_fw_platform_size.attr, | ||
127 | NULL, | 136 | NULL, |
128 | }; | 137 | }; |
129 | 138 | ||
@@ -272,15 +281,10 @@ static __init int match_config_table(efi_guid_t *guid, | |||
272 | unsigned long table, | 281 | unsigned long table, |
273 | efi_config_table_type_t *table_types) | 282 | efi_config_table_type_t *table_types) |
274 | { | 283 | { |
275 | u8 str[EFI_VARIABLE_GUID_LEN + 1]; | ||
276 | int i; | 284 | int i; |
277 | 285 | ||
278 | if (table_types) { | 286 | if (table_types) { |
279 | efi_guid_unparse(guid, str); | ||
280 | |||
281 | for (i = 0; efi_guidcmp(table_types[i].guid, NULL_GUID); i++) { | 287 | for (i = 0; efi_guidcmp(table_types[i].guid, NULL_GUID); i++) { |
282 | efi_guid_unparse(&table_types[i].guid, str); | ||
283 | |||
284 | if (!efi_guidcmp(*guid, table_types[i].guid)) { | 288 | if (!efi_guidcmp(*guid, table_types[i].guid)) { |
285 | *(table_types[i].ptr) = table; | 289 | *(table_types[i].ptr) = table; |
286 | pr_cont(" %s=0x%lx ", | 290 | pr_cont(" %s=0x%lx ", |
@@ -403,8 +407,7 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, | |||
403 | u64 val; | 407 | u64 val; |
404 | int i, len; | 408 | int i, len; |
405 | 409 | ||
406 | if (depth != 1 || | 410 | if (depth != 1 || strcmp(uname, "chosen") != 0) |
407 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) | ||
408 | return 0; | 411 | return 0; |
409 | 412 | ||
410 | for (i = 0; i < ARRAY_SIZE(dt_params); i++) { | 413 | for (i = 0; i < ARRAY_SIZE(dt_params); i++) { |
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c index f256ecd8a176..7b2e0496e0c0 100644 --- a/drivers/firmware/efi/efivars.c +++ b/drivers/firmware/efi/efivars.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * fix locking per Peter Chubb's findings | 39 | * fix locking per Peter Chubb's findings |
40 | * | 40 | * |
41 | * 25 Mar 2002 - Matt Domsch <Matt_Domsch@dell.com> | 41 | * 25 Mar 2002 - Matt Domsch <Matt_Domsch@dell.com> |
42 | * move uuid_unparse() to include/asm-ia64/efi.h:efi_guid_unparse() | 42 | * move uuid_unparse() to include/asm-ia64/efi.h:efi_guid_to_str() |
43 | * | 43 | * |
44 | * 12 Feb 2002 - Matt Domsch <Matt_Domsch@dell.com> | 44 | * 12 Feb 2002 - Matt Domsch <Matt_Domsch@dell.com> |
45 | * use list_for_each_safe when deleting vars. | 45 | * use list_for_each_safe when deleting vars. |
@@ -128,7 +128,7 @@ efivar_guid_read(struct efivar_entry *entry, char *buf) | |||
128 | if (!entry || !buf) | 128 | if (!entry || !buf) |
129 | return 0; | 129 | return 0; |
130 | 130 | ||
131 | efi_guid_unparse(&var->VendorGuid, str); | 131 | efi_guid_to_str(&var->VendorGuid, str); |
132 | str += strlen(str); | 132 | str += strlen(str); |
133 | str += sprintf(str, "\n"); | 133 | str += sprintf(str, "\n"); |
134 | 134 | ||
@@ -569,7 +569,7 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var) | |||
569 | private variables from another's. */ | 569 | private variables from another's. */ |
570 | 570 | ||
571 | *(short_name + strlen(short_name)) = '-'; | 571 | *(short_name + strlen(short_name)) = '-'; |
572 | efi_guid_unparse(&new_var->var.VendorGuid, | 572 | efi_guid_to_str(&new_var->var.VendorGuid, |
573 | short_name + strlen(short_name)); | 573 | short_name + strlen(short_name)); |
574 | 574 | ||
575 | new_var->kobj.kset = efivars_kset; | 575 | new_var->kobj.kset = efivars_kset; |
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index b14bc2b9fb4d..8902f52e0998 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile | |||
@@ -24,3 +24,17 @@ lib-y := efi-stub-helper.o | |||
24 | lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o | 24 | lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o |
25 | 25 | ||
26 | CFLAGS_fdt.o += -I$(srctree)/scripts/dtc/libfdt/ | 26 | CFLAGS_fdt.o += -I$(srctree)/scripts/dtc/libfdt/ |
27 | |||
28 | # | ||
29 | # arm64 puts the stub in the kernel proper, which will unnecessarily retain all | ||
30 | # code indefinitely unless it is annotated as __init/__initdata/__initconst etc. | ||
31 | # So let's apply the __init annotations at the section level, by prefixing | ||
32 | # the section names directly. This will ensure that even all the inline string | ||
33 | # literals are covered. | ||
34 | # | ||
35 | extra-$(CONFIG_ARM64) := $(lib-y) | ||
36 | lib-$(CONFIG_ARM64) := $(patsubst %.o,%.init.o,$(lib-y)) | ||
37 | |||
38 | OBJCOPYFLAGS := --prefix-alloc-sections=.init | ||
39 | $(obj)/%.init.o: $(obj)/%.o FORCE | ||
40 | $(call if_changed,objcopy) | ||
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index eb48a1a1a576..2b3814702dcf 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c | |||
@@ -17,10 +17,10 @@ | |||
17 | 17 | ||
18 | #include "efistub.h" | 18 | #include "efistub.h" |
19 | 19 | ||
20 | static int __init efi_secureboot_enabled(efi_system_table_t *sys_table_arg) | 20 | static int efi_secureboot_enabled(efi_system_table_t *sys_table_arg) |
21 | { | 21 | { |
22 | static efi_guid_t const var_guid __initconst = EFI_GLOBAL_VARIABLE_GUID; | 22 | static efi_guid_t const var_guid = EFI_GLOBAL_VARIABLE_GUID; |
23 | static efi_char16_t const var_name[] __initconst = { | 23 | static efi_char16_t const var_name[] = { |
24 | 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 0 }; | 24 | 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 0 }; |
25 | 25 | ||
26 | efi_get_variable_t *f_getvar = sys_table_arg->runtime->get_variable; | 26 | efi_get_variable_t *f_getvar = sys_table_arg->runtime->get_variable; |
@@ -164,7 +164,7 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, | |||
164 | * for both archictectures, with the arch-specific code provided in the | 164 | * for both archictectures, with the arch-specific code provided in the |
165 | * handle_kernel_image() function. | 165 | * handle_kernel_image() function. |
166 | */ | 166 | */ |
167 | unsigned long __init efi_entry(void *handle, efi_system_table_t *sys_table, | 167 | unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, |
168 | unsigned long *image_addr) | 168 | unsigned long *image_addr) |
169 | { | 169 | { |
170 | efi_loaded_image_t *image; | 170 | efi_loaded_image_t *image; |
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index a920fec8fe88..d073e3946383 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c | |||
@@ -66,25 +66,29 @@ efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, | |||
66 | unsigned long key; | 66 | unsigned long key; |
67 | u32 desc_version; | 67 | u32 desc_version; |
68 | 68 | ||
69 | *map_size = sizeof(*m) * 32; | 69 | *map_size = 0; |
70 | again: | 70 | *desc_size = 0; |
71 | key = 0; | ||
72 | status = efi_call_early(get_memory_map, map_size, NULL, | ||
73 | &key, desc_size, &desc_version); | ||
74 | if (status != EFI_BUFFER_TOO_SMALL) | ||
75 | return EFI_LOAD_ERROR; | ||
76 | |||
71 | /* | 77 | /* |
72 | * Add an additional efi_memory_desc_t because we're doing an | 78 | * Add an additional efi_memory_desc_t because we're doing an |
73 | * allocation which may be in a new descriptor region. | 79 | * allocation which may be in a new descriptor region. |
74 | */ | 80 | */ |
75 | *map_size += sizeof(*m); | 81 | *map_size += *desc_size; |
76 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, | 82 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, |
77 | *map_size, (void **)&m); | 83 | *map_size, (void **)&m); |
78 | if (status != EFI_SUCCESS) | 84 | if (status != EFI_SUCCESS) |
79 | goto fail; | 85 | goto fail; |
80 | 86 | ||
81 | *desc_size = 0; | ||
82 | key = 0; | ||
83 | status = efi_call_early(get_memory_map, map_size, m, | 87 | status = efi_call_early(get_memory_map, map_size, m, |
84 | &key, desc_size, &desc_version); | 88 | &key, desc_size, &desc_version); |
85 | if (status == EFI_BUFFER_TOO_SMALL) { | 89 | if (status == EFI_BUFFER_TOO_SMALL) { |
86 | efi_call_early(free_pool, m); | 90 | efi_call_early(free_pool, m); |
87 | goto again; | 91 | return EFI_LOAD_ERROR; |
88 | } | 92 | } |
89 | 93 | ||
90 | if (status != EFI_SUCCESS) | 94 | if (status != EFI_SUCCESS) |
@@ -101,7 +105,7 @@ fail: | |||
101 | } | 105 | } |
102 | 106 | ||
103 | 107 | ||
104 | unsigned long __init get_dram_base(efi_system_table_t *sys_table_arg) | 108 | unsigned long get_dram_base(efi_system_table_t *sys_table_arg) |
105 | { | 109 | { |
106 | efi_status_t status; | 110 | efi_status_t status; |
107 | unsigned long map_size; | 111 | unsigned long map_size; |
diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c index 018c29a26615..87b8e3b900d2 100644 --- a/drivers/firmware/efi/runtime-map.c +++ b/drivers/firmware/efi/runtime-map.c | |||
@@ -191,7 +191,7 @@ int __init efi_runtime_map_init(struct kobject *efi_kobj) | |||
191 | 191 | ||
192 | return 0; | 192 | return 0; |
193 | out_add_entry: | 193 | out_add_entry: |
194 | for (j = i - 1; j > 0; j--) { | 194 | for (j = i - 1; j >= 0; j--) { |
195 | entry = *(map_entries + j); | 195 | entry = *(map_entries + j); |
196 | kobject_put(&entry->kobj); | 196 | kobject_put(&entry->kobj); |
197 | } | 197 | } |
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index b37b0c80bd5a..cb989cd00b14 100644 --- a/drivers/rtc/rtc-efi.c +++ b/drivers/rtc/rtc-efi.c | |||
@@ -218,6 +218,7 @@ static int __init efi_rtc_probe(struct platform_device *dev) | |||
218 | if (IS_ERR(rtc)) | 218 | if (IS_ERR(rtc)) |
219 | return PTR_ERR(rtc); | 219 | return PTR_ERR(rtc); |
220 | 220 | ||
221 | rtc->uie_unsupported = 1; | ||
221 | platform_set_drvdata(dev, rtc); | 222 | platform_set_drvdata(dev, rtc); |
222 | 223 | ||
223 | return 0; | 224 | return 0; |
diff --git a/fs/Kconfig b/fs/Kconfig index 664991afe0c0..a6bb530b1ec5 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -165,6 +165,7 @@ config HUGETLB_PAGE | |||
165 | def_bool HUGETLBFS | 165 | def_bool HUGETLBFS |
166 | 166 | ||
167 | source "fs/configfs/Kconfig" | 167 | source "fs/configfs/Kconfig" |
168 | source "fs/efivarfs/Kconfig" | ||
168 | 169 | ||
169 | endmenu | 170 | endmenu |
170 | 171 | ||
@@ -209,7 +210,6 @@ source "fs/sysv/Kconfig" | |||
209 | source "fs/ufs/Kconfig" | 210 | source "fs/ufs/Kconfig" |
210 | source "fs/exofs/Kconfig" | 211 | source "fs/exofs/Kconfig" |
211 | source "fs/f2fs/Kconfig" | 212 | source "fs/f2fs/Kconfig" |
212 | source "fs/efivarfs/Kconfig" | ||
213 | 213 | ||
214 | endif # MISC_FILESYSTEMS | 214 | endif # MISC_FILESYSTEMS |
215 | 215 | ||
diff --git a/fs/efivarfs/Kconfig b/fs/efivarfs/Kconfig index 367bbb10c543..c2499ef174a2 100644 --- a/fs/efivarfs/Kconfig +++ b/fs/efivarfs/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config EFIVAR_FS | 1 | config EFIVAR_FS |
2 | tristate "EFI Variable filesystem" | 2 | tristate "EFI Variable filesystem" |
3 | depends on EFI | 3 | depends on EFI |
4 | default m | ||
4 | help | 5 | help |
5 | efivarfs is a replacement filesystem for the old EFI | 6 | efivarfs is a replacement filesystem for the old EFI |
6 | variable support via sysfs, as it doesn't suffer from the | 7 | variable support via sysfs, as it doesn't suffer from the |
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 6dad1176ec52..ddbce42548c9 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c | |||
@@ -140,7 +140,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor, | |||
140 | 140 | ||
141 | name[len] = '-'; | 141 | name[len] = '-'; |
142 | 142 | ||
143 | efi_guid_unparse(&entry->var.VendorGuid, name + len + 1); | 143 | efi_guid_to_str(&entry->var.VendorGuid, name + len + 1); |
144 | 144 | ||
145 | name[len + EFI_VARIABLE_GUID_LEN+1] = '\0'; | 145 | name[len + EFI_VARIABLE_GUID_LEN+1] = '\0'; |
146 | 146 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index 0238d612750e..b674837e2b98 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -848,7 +848,7 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) | |||
848 | } | 848 | } |
849 | 849 | ||
850 | static inline char * | 850 | static inline char * |
851 | efi_guid_unparse(efi_guid_t *guid, char *out) | 851 | efi_guid_to_str(efi_guid_t *guid, char *out) |
852 | { | 852 | { |
853 | sprintf(out, "%pUl", guid->b); | 853 | sprintf(out, "%pUl", guid->b); |
854 | return out; | 854 | return out; |