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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull x86 fixes from Ingo Molnar:
"This has:

- EFI revert to fix a boot regression
- early_ioremap() fix for boot failure
- KASLR fix for possible boot failures
- EFI fix for corrupted string printing
- remove a misleading EFI bootup 'failed!' error message

Unfortunately it's all rather close to the merge window"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/efi: Truncate 64-bit values when calling 32-bit OutputString()
x86/efi: Delete misleading efi_printk() error message
Revert "efi/x86: efistub: Move shared dependencies to <asm/efi.h>"
x86/kaslr: Avoid the setup_data area when picking location
x86 early_ioremap: Increase FIX_BTMAPS_SLOTS to 8

+62 -48
+1 -2
arch/x86/boot/compressed/Makefile
··· 33 33 $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone 34 34 35 35 ifeq ($(CONFIG_EFI_STUB), y) 36 - VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \ 37 - $(objtree)/drivers/firmware/efi/libstub/lib.a 36 + VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o 38 37 endif 39 38 40 39 $(obj)/vmlinux: $(VMLINUX_OBJS) FORCE
+15
arch/x86/boot/compressed/aslr.c
··· 183 183 static bool mem_avoid_overlap(struct mem_vector *img) 184 184 { 185 185 int i; 186 + struct setup_data *ptr; 186 187 187 188 for (i = 0; i < MEM_AVOID_MAX; i++) { 188 189 if (mem_overlaps(img, &mem_avoid[i])) 189 190 return true; 191 + } 192 + 193 + /* Avoid all entries in the setup_data linked list. */ 194 + ptr = (struct setup_data *)(unsigned long)real_mode->hdr.setup_data; 195 + while (ptr) { 196 + struct mem_vector avoid; 197 + 198 + avoid.start = (u64)ptr; 199 + avoid.size = sizeof(*ptr) + ptr->len; 200 + 201 + if (mem_overlaps(img, &avoid)) 202 + return true; 203 + 204 + ptr = (struct setup_data *)(unsigned long)ptr->next; 190 205 } 191 206 192 207 return false;
+26 -18
arch/x86/boot/compressed/eboot.c
··· 19 19 20 20 static efi_system_table_t *sys_table; 21 21 22 - struct efi_config *efi_early; 22 + static struct efi_config *efi_early; 23 + 24 + #define efi_call_early(f, ...) \ 25 + efi_early->call(efi_early->f, __VA_ARGS__); 23 26 24 27 #define BOOT_SERVICES(bits) \ 25 28 static void setup_boot_services##bits(struct efi_config *c) \ ··· 268 265 269 266 offset = offsetof(typeof(*out), output_string); 270 267 output_string = efi_early->text_output + offset; 268 + out = (typeof(out))(unsigned long)efi_early->text_output; 271 269 func = (u64 *)output_string; 272 270 273 - efi_early->call(*func, efi_early->text_output, str); 271 + efi_early->call(*func, out, str); 274 272 } else { 275 273 struct efi_simple_text_output_protocol_32 *out; 276 274 u32 *func; 277 275 278 276 offset = offsetof(typeof(*out), output_string); 279 277 output_string = efi_early->text_output + offset; 278 + out = (typeof(out))(unsigned long)efi_early->text_output; 280 279 func = (u32 *)output_string; 281 280 282 - efi_early->call(*func, efi_early->text_output, str); 281 + efi_early->call(*func, out, str); 283 282 } 284 283 } 284 + 285 + #include "../../../../drivers/firmware/efi/libstub/efi-stub-helper.c" 285 286 286 287 static void find_bits(unsigned long mask, u8 *pos, u8 *size) 287 288 { ··· 367 360 return status; 368 361 } 369 362 370 - static efi_status_t 363 + static void 371 364 setup_efi_pci32(struct boot_params *params, void **pci_handle, 372 365 unsigned long size) 373 366 { ··· 410 403 data = (struct setup_data *)rom; 411 404 412 405 } 413 - 414 - return status; 415 406 } 416 407 417 408 static efi_status_t ··· 468 463 469 464 } 470 465 471 - static efi_status_t 466 + static void 472 467 setup_efi_pci64(struct boot_params *params, void **pci_handle, 473 468 unsigned long size) 474 469 { ··· 511 506 data = (struct setup_data *)rom; 512 507 513 508 } 514 - 515 - return status; 516 509 } 517 510 518 - static efi_status_t setup_efi_pci(struct boot_params *params) 511 + /* 512 + * There's no way to return an informative status from this function, 513 + * because any analysis (and printing of error messages) needs to be 514 + * done directly at the EFI function call-site. 515 + * 516 + * For example, EFI_INVALID_PARAMETER could indicate a bug or maybe we 517 + * just didn't find any PCI devices, but there's no way to tell outside 518 + * the context of the call. 519 + */ 520 + static void setup_efi_pci(struct boot_params *params) 519 521 { 520 522 efi_status_t status; 521 523 void **pci_handle = NULL; ··· 539 527 size, (void **)&pci_handle); 540 528 541 529 if (status != EFI_SUCCESS) 542 - return status; 530 + return; 543 531 544 532 status = efi_call_early(locate_handle, 545 533 EFI_LOCATE_BY_PROTOCOL, &pci_proto, ··· 550 538 goto free_handle; 551 539 552 540 if (efi_early->is64) 553 - status = setup_efi_pci64(params, pci_handle, size); 541 + setup_efi_pci64(params, pci_handle, size); 554 542 else 555 - status = setup_efi_pci32(params, pci_handle, size); 543 + setup_efi_pci32(params, pci_handle, size); 556 544 557 545 free_handle: 558 546 efi_call_early(free_pool, pci_handle); 559 - return status; 560 547 } 561 548 562 549 static void ··· 1391 1380 1392 1381 setup_graphics(boot_params); 1393 1382 1394 - status = setup_efi_pci(boot_params); 1395 - if (status != EFI_SUCCESS) { 1396 - efi_printk(sys_table, "setup_efi_pci() failed!\n"); 1397 - } 1383 + setup_efi_pci(boot_params); 1398 1384 1399 1385 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, 1400 1386 sizeof(*gdt), (void **)&gdt);
+16
arch/x86/boot/compressed/eboot.h
··· 103 103 void *blt; 104 104 }; 105 105 106 + struct efi_config { 107 + u64 image_handle; 108 + u64 table; 109 + u64 allocate_pool; 110 + u64 allocate_pages; 111 + u64 get_memory_map; 112 + u64 free_pool; 113 + u64 free_pages; 114 + u64 locate_handle; 115 + u64 handle_protocol; 116 + u64 exit_boot_services; 117 + u64 text_output; 118 + efi_status_t (*call)(unsigned long, ...); 119 + bool is64; 120 + } __packed; 121 + 106 122 #endif /* BOOT_COMPRESSED_EBOOT_H */
-24
arch/x86/include/asm/efi.h
··· 159 159 } 160 160 #endif /* CONFIG_EFI_MIXED */ 161 161 162 - 163 - /* arch specific definitions used by the stub code */ 164 - 165 - struct efi_config { 166 - u64 image_handle; 167 - u64 table; 168 - u64 allocate_pool; 169 - u64 allocate_pages; 170 - u64 get_memory_map; 171 - u64 free_pool; 172 - u64 free_pages; 173 - u64 locate_handle; 174 - u64 handle_protocol; 175 - u64 exit_boot_services; 176 - u64 text_output; 177 - efi_status_t (*call)(unsigned long, ...); 178 - bool is64; 179 - } __packed; 180 - 181 - extern struct efi_config *efi_early; 182 - 183 - #define efi_call_early(f, ...) \ 184 - efi_early->call(efi_early->f, __VA_ARGS__); 185 - 186 162 extern bool efi_reboot_required(void); 187 163 188 164 #else
+3 -3
arch/x86/include/asm/fixmap.h
··· 106 106 __end_of_permanent_fixed_addresses, 107 107 108 108 /* 109 - * 256 temporary boot-time mappings, used by early_ioremap(), 109 + * 512 temporary boot-time mappings, used by early_ioremap(), 110 110 * before ioremap() is functional. 111 111 * 112 - * If necessary we round it up to the next 256 pages boundary so 112 + * If necessary we round it up to the next 512 pages boundary so 113 113 * that we can have a single pgd entry and a single pte table: 114 114 */ 115 115 #define NR_FIX_BTMAPS 64 116 - #define FIX_BTMAPS_SLOTS 4 116 + #define FIX_BTMAPS_SLOTS 8 117 117 #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS) 118 118 FIX_BTMAP_END = 119 119 (__end_of_permanent_fixed_addresses ^
+1 -1
drivers/firmware/efi/Makefile
··· 7 7 obj-$(CONFIG_UEFI_CPER) += cper.o 8 8 obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o 9 9 obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o 10 - obj-$(CONFIG_EFI_STUB) += libstub/ 10 + obj-$(CONFIG_EFI_ARM_STUB) += libstub/