aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/efi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-01-29 13:16:40 -0500
committerIngo Molnar <mingo@kernel.org>2015-01-29 13:16:40 -0500
commit3c01b74e818a7a3b2ee9b0d584cca0bc154a031c (patch)
treef037af086f4c31070a45760b781a2ce483ff76d5 /drivers/firmware/efi/efi.c
parentc59c961ca511dc7ee2f4f7e9c224d16f5c76ca6e (diff)
parent11629305043c513454c4ccb4fc384a1bfe610647 (diff)
Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into x86/efi
Pull EFI updates from Matt Fleming: " - Move efivarfs from the misc filesystem section to pseudo filesystem, since that's a more logical and accurate place - Leif Lindholm - Update efibootmgr URL in Kconfig help - Peter Jones - Improve accuracy of EFI guid function names - Borislav Petkov - Expose firmware platform size in sysfs for the benefit of EFI boot loader installers and other utilities - Steve McIntyre - Cleanup __init annotations for arm64/efi code - Ard Biesheuvel - Mark the UIE as unsupported for rtc-efi - Ard Biesheuvel - Fix memory leak in error code path of runtime map code - Dan Carpenter - Improve robustness of get_memory_map() by removing assumptions on the size of efi_memory_desc_t (which could change in future spec versions) and querying the firmware instead of guessing about the memmap size - Ard Biesheuvel - Remove superfluous guid unparse calls - Ivan Khoronzhuk - Delete unnecessary chosen@0 DT node FDT code since was duplicated from code in drivers/of and is entirely unnecessary - Leif Lindholm There's nothing super scary, mainly cleanups, and a merge from Ricardo who kindly picked up some patches from the linux-efi mailing list while I was out on annual leave in December. Perhaps the biggest risk is the get_memory_map() change from Ard, which changes the way that both the arm64 and x86 EFI boot stub build the early memory map. It would be good to have it bake in linux-next for a while. " Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/efi.c')
-rw-r--r--drivers/firmware/efi/efi.c17
1 files changed, 10 insertions, 7 deletions
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);
115EFI_ATTR_SHOW(runtime); 115EFI_ATTR_SHOW(runtime);
116EFI_ATTR_SHOW(config_table); 116EFI_ATTR_SHOW(config_table);
117 117
118static 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
118static struct kobj_attribute efi_attr_fw_vendor = __ATTR_RO(fw_vendor); 124static struct kobj_attribute efi_attr_fw_vendor = __ATTR_RO(fw_vendor);
119static struct kobj_attribute efi_attr_runtime = __ATTR_RO(runtime); 125static struct kobj_attribute efi_attr_runtime = __ATTR_RO(runtime);
120static struct kobj_attribute efi_attr_config_table = __ATTR_RO(config_table); 126static struct kobj_attribute efi_attr_config_table = __ATTR_RO(config_table);
127static struct kobj_attribute efi_attr_fw_platform_size =
128 __ATTR_RO(fw_platform_size);
121 129
122static struct attribute *efi_subsys_attrs[] = { 130static 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++) {