Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI updates from Ingo Molnar:
"The main EFI changes in this cycle were:

- Fix the apple-properties code (Andy Shevchenko)

- Add WARN() on arm64 if UEFI Runtime Services corrupt the reserved
x18 register (Ard Biesheuvel)

- Use efi_switch_mm() on x86 instead of manipulating %cr3 directly
(Sai Praneeth)

- Fix early memremap leak in ESRT code (Ard Biesheuvel)

- Switch to L"xxx" notation for wide string literals (Ard Biesheuvel)

- ... plus misc other cleanups and bugfixes"

* 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/efi: Use efi_switch_mm() rather than manually twiddling with %cr3
x86/efi: Replace efi_pgd with efi_mm.pgd
efi: Use string literals for efi_char16_t variable initializers
efi/esrt: Fix handling of early ESRT table mapping
efi: Use efi_mm in x86 as well as ARM
efi: Make const array 'apple' static
efi/apple-properties: Use memremap() instead of ioremap()
efi: Reorder pr_notice() with add_device_randomness() call
x86/efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store()
efi/arm64: Check whether x18 is preserved by runtime services calls
efi/arm*: Stop printing addresses of virtual mappings
efi/apple-properties: Remove redundant attribute initialization from unmarshal_key_value_pairs()
efi/arm*: Only register page tables when they exist

+142 -109
+3 -1
arch/arm64/include/asm/efi.h
··· 31 31 ({ \ 32 32 efi_##f##_t *__f; \ 33 33 __f = p->f; \ 34 - __f(args); \ 34 + __efi_rt_asm_wrapper(__f, #f, args); \ 35 35 }) 36 36 37 37 #define arch_efi_call_virt_teardown() \ ··· 39 39 __efi_fpsimd_end(); \ 40 40 efi_virtmap_unload(); \ 41 41 }) 42 + 43 + efi_status_t __efi_rt_asm_wrapper(void *, const char *, ...); 42 44 43 45 #define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT) 44 46
+2 -1
arch/arm64/kernel/Makefile
··· 38 38 arm64-obj-$(CONFIG_CPU_IDLE) += cpuidle.o 39 39 arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o 40 40 arm64-obj-$(CONFIG_KGDB) += kgdb.o 41 - arm64-obj-$(CONFIG_EFI) += efi.o efi-entry.stub.o 41 + arm64-obj-$(CONFIG_EFI) += efi.o efi-entry.stub.o \ 42 + efi-rt-wrapper.o 42 43 arm64-obj-$(CONFIG_PCI) += pci.o 43 44 arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o 44 45 arm64-obj-$(CONFIG_ACPI) += acpi.o
+41
arch/arm64/kernel/efi-rt-wrapper.S
··· 1 + /* 2 + * Copyright (C) 2018 Linaro Ltd <ard.biesheuvel@linaro.org> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #include <linux/linkage.h> 10 + 11 + ENTRY(__efi_rt_asm_wrapper) 12 + stp x29, x30, [sp, #-32]! 13 + mov x29, sp 14 + 15 + /* 16 + * Register x18 is designated as the 'platform' register by the AAPCS, 17 + * which means firmware running at the same exception level as the OS 18 + * (such as UEFI) should never touch it. 19 + */ 20 + stp x1, x18, [sp, #16] 21 + 22 + /* 23 + * We are lucky enough that no EFI runtime services take more than 24 + * 5 arguments, so all are passed in registers rather than via the 25 + * stack. 26 + */ 27 + mov x8, x0 28 + mov x0, x2 29 + mov x1, x3 30 + mov x2, x4 31 + mov x3, x5 32 + mov x4, x6 33 + blr x8 34 + 35 + ldp x1, x2, [sp, #16] 36 + cmp x2, x18 37 + ldp x29, x30, [sp], #32 38 + b.ne 0f 39 + ret 40 + 0: b efi_handle_corrupted_x18 // tail call 41 + ENDPROC(__efi_rt_asm_wrapper)
+6
arch/arm64/kernel/efi.c
··· 126 126 { 127 127 return efi_enabled(EFI_RUNTIME_SERVICES); 128 128 } 129 + 130 + asmlinkage efi_status_t efi_handle_corrupted_x18(efi_status_t s, const char *f) 131 + { 132 + pr_err_ratelimited(FW_BUG "register x18 corrupted by EFI %s\n", f); 133 + return s; 134 + }
+2 -1
arch/x86/boot/compressed/eboot.c
··· 421 421 } 422 422 } 423 423 424 + static const efi_char16_t apple[] = L"Apple"; 425 + 424 426 static void setup_quirks(struct boot_params *boot_params) 425 427 { 426 - efi_char16_t const apple[] = { 'A', 'p', 'p', 'l', 'e', 0 }; 427 428 efi_char16_t *fw_vendor = (efi_char16_t *)(unsigned long) 428 429 efi_table_attr(efi_system_table, fw_vendor, sys_table); 429 430
+11 -15
arch/x86/include/asm/efi.h
··· 7 7 #include <asm/processor-flags.h> 8 8 #include <asm/tlb.h> 9 9 #include <asm/nospec-branch.h> 10 + #include <asm/mmu_context.h> 10 11 11 12 /* 12 13 * We map the EFI regions needed for runtime services non-contiguously, ··· 70 69 #define efi_call_phys(f, args...) efi_call((f), args) 71 70 72 71 /* 73 - * Scratch space used for switching the pagetable in the EFI stub 72 + * struct efi_scratch - Scratch space used while switching to/from efi_mm 73 + * @phys_stack: stack used during EFI Mixed Mode 74 + * @prev_mm: store/restore stolen mm_struct while switching to/from efi_mm 74 75 */ 75 76 struct efi_scratch { 76 - u64 r15; 77 - u64 prev_cr3; 78 - pgd_t *efi_pgt; 79 - bool use_pgd; 80 - u64 phys_stack; 77 + u64 phys_stack; 78 + struct mm_struct *prev_mm; 81 79 } __packed; 82 80 83 81 #define arch_efi_call_virt_setup() \ ··· 86 86 __kernel_fpu_begin(); \ 87 87 firmware_restrict_branch_speculation_start(); \ 88 88 \ 89 - if (efi_scratch.use_pgd) { \ 90 - efi_scratch.prev_cr3 = __read_cr3(); \ 91 - write_cr3((unsigned long)efi_scratch.efi_pgt); \ 92 - __flush_tlb_all(); \ 93 - } \ 89 + if (!efi_enabled(EFI_OLD_MEMMAP)) \ 90 + efi_switch_mm(&efi_mm); \ 94 91 }) 95 92 96 93 #define arch_efi_call_virt(p, f, args...) \ ··· 95 98 96 99 #define arch_efi_call_virt_teardown() \ 97 100 ({ \ 98 - if (efi_scratch.use_pgd) { \ 99 - write_cr3(efi_scratch.prev_cr3); \ 100 - __flush_tlb_all(); \ 101 - } \ 101 + if (!efi_enabled(EFI_OLD_MEMMAP)) \ 102 + efi_switch_mm(efi_scratch.prev_mm); \ 102 103 \ 103 104 firmware_restrict_branch_speculation_end(); \ 104 105 __kernel_fpu_end(); \ ··· 139 144 extern void __init efi_apply_memmap_quirks(void); 140 145 extern int __init efi_reuse_config(u64 tables, int nr_tables); 141 146 extern void efi_delete_dummy_variable(void); 147 + extern void efi_switch_mm(struct mm_struct *mm); 142 148 143 149 struct efi_setup_data { 144 150 u64 fw_vendor;
+3 -3
arch/x86/mm/debug_pagetables.c
··· 1 1 #include <linux/debugfs.h> 2 + #include <linux/efi.h> 2 3 #include <linux/module.h> 3 4 #include <linux/seq_file.h> 4 5 #include <asm/pgtable.h> ··· 74 73 #endif 75 74 76 75 #if defined(CONFIG_EFI) && defined(CONFIG_X86_64) 77 - extern pgd_t *efi_pgd; 78 76 static struct dentry *pe_efi; 79 77 80 78 static int ptdump_show_efi(struct seq_file *m, void *v) 81 79 { 82 - if (efi_pgd) 83 - ptdump_walk_pgd_level_debugfs(m, efi_pgd, false); 80 + if (efi_mm.pgd) 81 + ptdump_walk_pgd_level_debugfs(m, efi_mm.pgd, false); 84 82 return 0; 85 83 } 86 84
+33 -27
arch/x86/platform/efi/efi_64.c
··· 34 34 #include <linux/slab.h> 35 35 #include <linux/ucs2_string.h> 36 36 #include <linux/mem_encrypt.h> 37 + #include <linux/sched/task.h> 37 38 38 39 #include <asm/setup.h> 39 40 #include <asm/page.h> ··· 83 82 int n_pgds, i, j; 84 83 85 84 if (!efi_enabled(EFI_OLD_MEMMAP)) { 86 - save_pgd = (pgd_t *)__read_cr3(); 87 - write_cr3((unsigned long)efi_scratch.efi_pgt); 88 - goto out; 85 + efi_switch_mm(&efi_mm); 86 + return NULL; 89 87 } 90 88 91 89 early_code_mapping_set_exec(1); ··· 156 156 pud_t *pud; 157 157 158 158 if (!efi_enabled(EFI_OLD_MEMMAP)) { 159 - write_cr3((unsigned long)save_pgd); 160 - __flush_tlb_all(); 159 + efi_switch_mm(efi_scratch.prev_mm); 161 160 return; 162 161 } 163 162 ··· 190 191 early_code_mapping_set_exec(0); 191 192 } 192 193 193 - pgd_t *efi_pgd; 194 - EXPORT_SYMBOL_GPL(efi_pgd); 194 + EXPORT_SYMBOL_GPL(efi_mm); 195 195 196 196 /* 197 197 * We need our own copy of the higher levels of the page tables ··· 203 205 */ 204 206 int __init efi_alloc_page_tables(void) 205 207 { 206 - pgd_t *pgd; 208 + pgd_t *pgd, *efi_pgd; 207 209 p4d_t *p4d; 208 210 pud_t *pud; 209 211 gfp_t gfp_mask; ··· 231 233 return -ENOMEM; 232 234 } 233 235 236 + efi_mm.pgd = efi_pgd; 237 + mm_init_cpumask(&efi_mm); 238 + init_new_context(NULL, &efi_mm); 239 + 234 240 return 0; 235 241 } 236 242 ··· 247 245 pgd_t *pgd_k, *pgd_efi; 248 246 p4d_t *p4d_k, *p4d_efi; 249 247 pud_t *pud_k, *pud_efi; 248 + pgd_t *efi_pgd = efi_mm.pgd; 250 249 251 250 if (efi_enabled(EFI_OLD_MEMMAP)) 252 251 return; ··· 341 338 unsigned long pfn, text, pf; 342 339 struct page *page; 343 340 unsigned npages; 344 - pgd_t *pgd; 341 + pgd_t *pgd = efi_mm.pgd; 345 342 346 343 if (efi_enabled(EFI_OLD_MEMMAP)) 347 344 return 0; 348 - 349 - /* 350 - * Since the PGD is encrypted, set the encryption mask so that when 351 - * this value is loaded into cr3 the PGD will be decrypted during 352 - * the pagetable walk. 353 - */ 354 - efi_scratch.efi_pgt = (pgd_t *)__sme_pa(efi_pgd); 355 - pgd = efi_pgd; 356 345 357 346 /* 358 347 * It can happen that the physical address of new_memmap lands in memory ··· 358 363 pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap); 359 364 return 1; 360 365 } 361 - 362 - efi_scratch.use_pgd = true; 363 366 364 367 /* 365 368 * Certain firmware versions are way too sentimential and still believe ··· 412 419 { 413 420 unsigned long flags = _PAGE_RW; 414 421 unsigned long pfn; 415 - pgd_t *pgd = efi_pgd; 422 + pgd_t *pgd = efi_mm.pgd; 416 423 417 424 if (!(md->attribute & EFI_MEMORY_WB)) 418 425 flags |= _PAGE_PCD; ··· 516 523 static int __init efi_update_mappings(efi_memory_desc_t *md, unsigned long pf) 517 524 { 518 525 unsigned long pfn; 519 - pgd_t *pgd = efi_pgd; 526 + pgd_t *pgd = efi_mm.pgd; 520 527 int err1, err2; 521 528 522 529 /* Update the 1:1 mapping */ ··· 613 620 if (efi_enabled(EFI_OLD_MEMMAP)) 614 621 ptdump_walk_pgd_level(NULL, swapper_pg_dir); 615 622 else 616 - ptdump_walk_pgd_level(NULL, efi_pgd); 623 + ptdump_walk_pgd_level(NULL, efi_mm.pgd); 617 624 #endif 625 + } 626 + 627 + /* 628 + * Makes the calling thread switch to/from efi_mm context. Can be used 629 + * for SetVirtualAddressMap() i.e. current->active_mm == init_mm as well 630 + * as during efi runtime calls i.e current->active_mm == current_mm. 631 + * We are not mm_dropping()/mm_grabbing() any mm, because we are not 632 + * losing/creating any references. 633 + */ 634 + void efi_switch_mm(struct mm_struct *mm) 635 + { 636 + task_lock(current); 637 + efi_scratch.prev_mm = current->active_mm; 638 + current->active_mm = mm; 639 + switch_mm(efi_scratch.prev_mm, mm, NULL); 640 + task_unlock(current); 618 641 } 619 642 620 643 #ifdef CONFIG_EFI_MIXED ··· 686 677 efi_sync_low_kernel_mappings(); 687 678 local_irq_save(flags); 688 679 689 - efi_scratch.prev_cr3 = __read_cr3(); 690 - write_cr3((unsigned long)efi_scratch.efi_pgt); 691 - __flush_tlb_all(); 680 + efi_switch_mm(&efi_mm); 692 681 693 682 func = (u32)(unsigned long)phys_set_virtual_address_map; 694 683 status = efi64_thunk(func, memory_map_size, descriptor_size, 695 684 descriptor_version, virtual_map); 696 685 697 - write_cr3(efi_scratch.prev_cr3); 698 - __flush_tlb_all(); 686 + efi_switch_mm(efi_scratch.prev_mm); 699 687 local_irq_restore(flags); 700 688 701 689 return status;
+1 -1
arch/x86/platform/efi/efi_thunk_64.S
··· 33 33 * Switch to 1:1 mapped 32-bit stack pointer. 34 34 */ 35 35 movq %rsp, efi_saved_sp(%rip) 36 - movq efi_scratch+25(%rip), %rsp 36 + movq efi_scratch(%rip), %rsp 37 37 38 38 /* 39 39 * Calculate the physical address of the kernel text.
+6 -4
arch/x86/platform/efi/quirks.c
··· 75 75 u32 rsvd[2]; 76 76 }; 77 77 78 - static efi_char16_t efi_dummy_name[6] = { 'D', 'U', 'M', 'M', 'Y', 0 }; 78 + static const efi_char16_t efi_dummy_name[] = L"DUMMY"; 79 79 80 80 static bool efi_no_storage_paranoia; 81 81 ··· 105 105 */ 106 106 void efi_delete_dummy_variable(void) 107 107 { 108 - efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID, 108 + efi.set_variable((efi_char16_t *)efi_dummy_name, 109 + &EFI_DUMMY_GUID, 109 110 EFI_VARIABLE_NON_VOLATILE | 110 111 EFI_VARIABLE_BOOTSERVICE_ACCESS | 111 112 EFI_VARIABLE_RUNTIME_ACCESS, ··· 178 177 * that by attempting to use more space than is available. 179 178 */ 180 179 unsigned long dummy_size = remaining_size + 1024; 181 - void *dummy = kzalloc(dummy_size, GFP_ATOMIC); 180 + void *dummy = kzalloc(dummy_size, GFP_KERNEL); 182 181 183 182 if (!dummy) 184 183 return EFI_OUT_OF_RESOURCES; 185 184 186 - status = efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID, 185 + status = efi.set_variable((efi_char16_t *)efi_dummy_name, 186 + &EFI_DUMMY_GUID, 187 187 EFI_VARIABLE_NON_VOLATILE | 188 188 EFI_VARIABLE_BOOTSERVICE_ACCESS | 189 189 EFI_VARIABLE_RUNTIME_ACCESS,
+7 -13
drivers/firmware/efi/apple-properties.c
··· 19 19 20 20 #include <linux/bootmem.h> 21 21 #include <linux/efi.h> 22 + #include <linux/io.h> 22 23 #include <linux/platform_data/x86/apple.h> 23 24 #include <linux/property.h> 24 25 #include <linux/slab.h> ··· 52 51 u32 dev_count; 53 52 struct dev_header dev_header[0]; 54 53 }; 55 - 56 - static u8 one __initdata = 1; 57 54 58 55 static void __init unmarshal_key_value_pairs(struct dev_header *dev_header, 59 56 struct device *dev, void *ptr, ··· 94 95 key_len - sizeof(key_len)); 95 96 96 97 entry[i].name = key; 97 - entry[i].is_array = true; 98 98 entry[i].length = val_len - sizeof(val_len); 99 + entry[i].is_array = !!entry[i].length; 99 100 entry[i].pointer.raw_data = ptr + key_len + sizeof(val_len); 100 - if (!entry[i].length) { 101 - /* driver core doesn't accept empty properties */ 102 - entry[i].length = 1; 103 - entry[i].pointer.raw_data = &one; 104 - } 105 101 106 102 if (dump_properties) { 107 103 dev_info(dev, "property: %s\n", entry[i].name); ··· 190 196 191 197 pa_data = boot_params.hdr.setup_data; 192 198 while (pa_data) { 193 - data = ioremap(pa_data, sizeof(*data)); 199 + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); 194 200 if (!data) { 195 201 pr_err("cannot map setup_data header\n"); 196 202 return -ENOMEM; ··· 198 204 199 205 if (data->type != SETUP_APPLE_PROPERTIES) { 200 206 pa_data = data->next; 201 - iounmap(data); 207 + memunmap(data); 202 208 continue; 203 209 } 204 210 205 211 data_len = data->len; 206 - iounmap(data); 212 + memunmap(data); 207 213 208 - data = ioremap(pa_data, sizeof(*data) + data_len); 214 + data = memremap(pa_data, sizeof(*data) + data_len, MEMREMAP_WB); 209 215 if (!data) { 210 216 pr_err("cannot map setup_data payload\n"); 211 217 return -ENOMEM; ··· 230 236 * to avoid breaking the chain of ->next pointers. 231 237 */ 232 238 data->len = 0; 233 - iounmap(data); 239 + memunmap(data); 234 240 free_bootmem_late(pa_data + sizeof(*data), data_len); 235 241 236 242 return ret;
+4 -13
drivers/firmware/efi/arm-runtime.c
··· 31 31 32 32 extern u64 efi_system_table; 33 33 34 - static struct mm_struct efi_mm = { 35 - .mm_rb = RB_ROOT, 36 - .mm_users = ATOMIC_INIT(2), 37 - .mm_count = ATOMIC_INIT(1), 38 - .mmap_sem = __RWSEM_INITIALIZER(efi_mm.mmap_sem), 39 - .page_table_lock = __SPIN_LOCK_UNLOCKED(efi_mm.page_table_lock), 40 - .mmlist = LIST_HEAD_INIT(efi_mm.mmlist), 41 - }; 42 - 43 34 #ifdef CONFIG_ARM64_PTDUMP_DEBUGFS 44 35 #include <asm/ptdump.h> 45 36 ··· 45 54 46 55 static int __init ptdump_init(void) 47 56 { 57 + if (!efi_enabled(EFI_RUNTIME_SERVICES)) 58 + return 0; 59 + 48 60 return ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables"); 49 61 } 50 62 device_initcall(ptdump_init); ··· 74 80 return false; 75 81 76 82 ret = efi_create_mapping(&efi_mm, md); 77 - if (!ret) { 78 - pr_info(" EFI remap %pa => %p\n", 79 - &phys, (void *)(unsigned long)md->virt_addr); 80 - } else { 83 + if (ret) { 81 84 pr_warn(" EFI remap %pa: failed to create mapping (%d)\n", 82 85 &phys, ret); 83 86 return false;
+10 -1
drivers/firmware/efi/efi.c
··· 75 75 &efi.mem_attr_table, 76 76 }; 77 77 78 + struct mm_struct efi_mm = { 79 + .mm_rb = RB_ROOT, 80 + .mm_users = ATOMIC_INIT(2), 81 + .mm_count = ATOMIC_INIT(1), 82 + .mmap_sem = __RWSEM_INITIALIZER(efi_mm.mmap_sem), 83 + .page_table_lock = __SPIN_LOCK_UNLOCKED(efi_mm.page_table_lock), 84 + .mmlist = LIST_HEAD_INIT(efi_mm.mmlist), 85 + }; 86 + 78 87 static bool disable_runtime; 79 88 static int __init setup_noefi(char *arg) 80 89 { ··· 551 542 seed = early_memremap(efi.rng_seed, 552 543 sizeof(*seed) + size); 553 544 if (seed != NULL) { 545 + pr_notice("seeding entropy pool\n"); 554 546 add_device_randomness(seed->bits, seed->size); 555 547 early_memunmap(seed, sizeof(*seed) + size); 556 - pr_notice("seeding entropy pool\n"); 557 548 } else { 558 549 pr_err("Could not map UEFI random seed!\n"); 559 550 }
+5 -14
drivers/firmware/efi/esrt.c
··· 279 279 } 280 280 281 281 memcpy(&tmpesrt, va, sizeof(tmpesrt)); 282 + early_memunmap(va, size); 282 283 283 284 if (tmpesrt.fw_resource_version == 1) { 284 285 entry_size = sizeof (*v1_entries); ··· 292 291 if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) { 293 292 pr_err("ESRT memory map entry can only hold the header. (max: %zu size: %zu)\n", 294 293 max - size, entry_size); 295 - goto err_memunmap; 294 + return; 296 295 } 297 296 298 297 /* ··· 305 304 if (tmpesrt.fw_resource_count > 128) { 306 305 pr_err("ESRT says fw_resource_count has very large value %d.\n", 307 306 tmpesrt.fw_resource_count); 308 - goto err_memunmap; 307 + return; 309 308 } 310 309 311 310 /* ··· 316 315 if (max < size + entries_size) { 317 316 pr_err("ESRT does not fit on single memory map entry (size: %zu max: %zu)\n", 318 317 size, max); 319 - goto err_memunmap; 320 - } 321 - 322 - /* remap it with our (plausible) new pages */ 323 - early_memunmap(va, size); 324 - size += entries_size; 325 - va = early_memremap(efi.esrt, size); 326 - if (!va) { 327 - pr_err("early_memremap(%p, %zu) failed.\n", (void *)efi.esrt, 328 - size); 329 318 return; 330 319 } 320 + 321 + size += entries_size; 331 322 332 323 esrt_data = (phys_addr_t)efi.esrt; 333 324 esrt_data_size = size; ··· 329 336 efi_mem_reserve(esrt_data, esrt_data_size); 330 337 331 338 pr_debug("esrt-init: loaded.\n"); 332 - err_memunmap: 333 - early_memunmap(va, size); 334 339 } 335 340 336 341 static int __init register_entries(void)
+1 -1
drivers/firmware/efi/libstub/Makefile
··· 9 9 cflags-$(CONFIG_X86_64) := -mcmodel=small 10 10 cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ 11 11 -fPIC -fno-strict-aliasing -mno-red-zone \ 12 - -mno-mmx -mno-sse 12 + -mno-mmx -mno-sse -fshort-wchar 13 13 14 14 cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie 15 15 cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
+3 -9
drivers/firmware/efi/libstub/secureboot.c
··· 16 16 17 17 /* BIOS variables */ 18 18 static const efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID; 19 - static const efi_char16_t efi_SecureBoot_name[] = { 20 - 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 0 21 - }; 22 - static const efi_char16_t efi_SetupMode_name[] = { 23 - 'S', 'e', 't', 'u', 'p', 'M', 'o', 'd', 'e', 0 24 - }; 19 + static const efi_char16_t efi_SecureBoot_name[] = L"SecureBoot"; 20 + static const efi_char16_t efi_SetupMode_name[] = L"SetupMode"; 25 21 26 22 /* SHIM variables */ 27 23 static const efi_guid_t shim_guid = EFI_SHIM_LOCK_GUID; 28 - static efi_char16_t const shim_MokSBState_name[] = { 29 - 'M', 'o', 'k', 'S', 'B', 'S', 't', 'a', 't', 'e', 0 30 - }; 24 + static const efi_char16_t shim_MokSBState_name[] = L"MokSBState"; 31 25 32 26 #define get_efi_var(name, vendor, ...) \ 33 27 efi_call_runtime(get_variable, \
+2 -5
drivers/firmware/efi/libstub/tpm.c
··· 16 16 #include "efistub.h" 17 17 18 18 #ifdef CONFIG_RESET_ATTACK_MITIGATION 19 - static const efi_char16_t efi_MemoryOverWriteRequest_name[] = { 20 - 'M', 'e', 'm', 'o', 'r', 'y', 'O', 'v', 'e', 'r', 'w', 'r', 'i', 't', 21 - 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'C', 'o', 'n', 't', 'r', 'o', 22 - 'l', 0 23 - }; 19 + static const efi_char16_t efi_MemoryOverWriteRequest_name[] = 20 + L"MemoryOverwriteRequestControl"; 24 21 25 22 #define MEMORY_ONLY_RESET_CONTROL_GUID \ 26 23 EFI_GUID(0xe20939be, 0x32d4, 0x41be, 0xa1, 0x50, 0x89, 0x7f, 0x85, 0xd4, 0x98, 0x29)
+2
include/linux/efi.h
··· 966 966 unsigned long flags; 967 967 } efi; 968 968 969 + extern struct mm_struct efi_mm; 970 + 969 971 static inline int 970 972 efi_guidcmp (efi_guid_t left, efi_guid_t right) 971 973 {