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:
"Misc fixes:

EFI fixes, a build fix, a page table dumping (debug) fix and a clang
build fix"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efi/arm64: Fix fdt-related memory reservation
x86/mm: Apply the section attribute to the variable, not its type
x86/efi: Fixup GOT in all boot code paths
x86/efi: Only load initrd above 4g on second try
x86-64, ptdump: Mark espfix area only if existent
x86, irq: Fix build error caused by 9eabc99a635a77cbf09

+108 -40
+1 -2
arch/arm64/mm/init.c
··· 149 149 memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); 150 150 #endif 151 151 152 - if (!efi_enabled(EFI_MEMMAP)) 153 - early_init_fdt_scan_reserved_mem(); 152 + early_init_fdt_scan_reserved_mem(); 154 153 155 154 /* 4GB maximum for 32-bit only capable devices */ 156 155 if (IS_ENABLED(CONFIG_ZONE_DMA))
+11 -7
arch/x86/boot/compressed/eboot.c
··· 1032 1032 int i; 1033 1033 unsigned long ramdisk_addr; 1034 1034 unsigned long ramdisk_size; 1035 - unsigned long initrd_addr_max; 1036 1035 1037 1036 efi_early = c; 1038 1037 sys_table = (efi_system_table_t *)(unsigned long)efi_early->table; ··· 1094 1095 1095 1096 memset(sdt, 0, sizeof(*sdt)); 1096 1097 1097 - if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) 1098 - initrd_addr_max = -1UL; 1099 - else 1100 - initrd_addr_max = hdr->initrd_addr_max; 1101 - 1102 1098 status = handle_cmdline_files(sys_table, image, 1103 1099 (char *)(unsigned long)hdr->cmd_line_ptr, 1104 - "initrd=", initrd_addr_max, 1100 + "initrd=", hdr->initrd_addr_max, 1105 1101 &ramdisk_addr, &ramdisk_size); 1102 + 1103 + if (status != EFI_SUCCESS && 1104 + hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) { 1105 + efi_printk(sys_table, "Trying to load files to higher address\n"); 1106 + status = handle_cmdline_files(sys_table, image, 1107 + (char *)(unsigned long)hdr->cmd_line_ptr, 1108 + "initrd=", -1UL, 1109 + &ramdisk_addr, &ramdisk_size); 1110 + } 1111 + 1106 1112 if (status != EFI_SUCCESS) 1107 1113 goto fail2; 1108 1114 hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
+40 -14
arch/x86/boot/compressed/head_32.S
··· 30 30 #include <asm/boot.h> 31 31 #include <asm/asm-offsets.h> 32 32 33 + /* 34 + * Adjust our own GOT 35 + * 36 + * The relocation base must be in %ebx 37 + * 38 + * It is safe to call this macro more than once, because in some of the 39 + * code paths multiple invocations are inevitable, e.g. via the efi* 40 + * entry points. 41 + * 42 + * Relocation is only performed the first time. 43 + */ 44 + .macro FIXUP_GOT 45 + cmpb $1, got_fixed(%ebx) 46 + je 2f 47 + 48 + leal _got(%ebx), %edx 49 + leal _egot(%ebx), %ecx 50 + 1: 51 + cmpl %ecx, %edx 52 + jae 2f 53 + addl %ebx, (%edx) 54 + addl $4, %edx 55 + jmp 1b 56 + 2: 57 + movb $1, got_fixed(%ebx) 58 + .endm 59 + 33 60 __HEAD 34 61 ENTRY(startup_32) 35 62 #ifdef CONFIG_EFI_STUB ··· 83 56 add %esi, 88(%eax) 84 57 pushl %eax 85 58 59 + movl %esi, %ebx 60 + FIXUP_GOT 61 + 86 62 call make_boot_params 87 63 cmpl $0, %eax 88 64 je fail ··· 111 81 leal efi32_config(%esi), %eax 112 82 add %esi, 88(%eax) 113 83 pushl %eax 84 + 85 + movl %esi, %ebx 86 + FIXUP_GOT 87 + 114 88 2: 115 89 call efi_main 116 90 cmpl $0, %eax ··· 224 190 shrl $2, %ecx 225 191 rep stosl 226 192 227 - /* 228 - * Adjust our own GOT 229 - */ 230 - leal _got(%ebx), %edx 231 - leal _egot(%ebx), %ecx 232 - 1: 233 - cmpl %ecx, %edx 234 - jae 2f 235 - addl %ebx, (%edx) 236 - addl $4, %edx 237 - jmp 1b 238 - 2: 239 - 193 + FIXUP_GOT 240 194 /* 241 195 * Do the decompression, and jump to the new kernel.. 242 196 */ ··· 247 225 xorl %ebx, %ebx 248 226 jmp *%eax 249 227 250 - #ifdef CONFIG_EFI_STUB 251 228 .data 229 + /* Have we relocated the GOT? */ 230 + got_fixed: 231 + .byte 0 232 + 233 + #ifdef CONFIG_EFI_STUB 252 234 efi32_config: 253 235 .fill 11,8,0 254 236 .long efi_call_phys
+41 -15
arch/x86/boot/compressed/head_64.S
··· 32 32 #include <asm/processor-flags.h> 33 33 #include <asm/asm-offsets.h> 34 34 35 + /* 36 + * Adjust our own GOT 37 + * 38 + * The relocation base must be in %rbx 39 + * 40 + * It is safe to call this macro more than once, because in some of the 41 + * code paths multiple invocations are inevitable, e.g. via the efi* 42 + * entry points. 43 + * 44 + * Relocation is only performed the first time. 45 + */ 46 + .macro FIXUP_GOT 47 + cmpb $1, got_fixed(%rip) 48 + je 2f 49 + 50 + leaq _got(%rip), %rdx 51 + leaq _egot(%rip), %rcx 52 + 1: 53 + cmpq %rcx, %rdx 54 + jae 2f 55 + addq %rbx, (%rdx) 56 + addq $8, %rdx 57 + jmp 1b 58 + 2: 59 + movb $1, got_fixed(%rip) 60 + .endm 61 + 35 62 __HEAD 36 63 .code32 37 64 ENTRY(startup_32) ··· 279 252 subq $1b, %rbp 280 253 281 254 /* 282 - * Relocate efi_config->call(). 255 + * Relocate efi_config->call() and the GOT entries. 283 256 */ 284 257 addq %rbp, efi64_config+88(%rip) 258 + 259 + movq %rbp, %rbx 260 + FIXUP_GOT 285 261 286 262 movq %rax, %rdi 287 263 call make_boot_params ··· 301 271 subq $1b, %rbp 302 272 303 273 /* 304 - * Relocate efi_config->call(). 274 + * Relocate efi_config->call() and the GOT entries. 305 275 */ 306 276 movq efi_config(%rip), %rax 307 277 addq %rbp, 88(%rax) 278 + 279 + movq %rbp, %rbx 280 + FIXUP_GOT 308 281 2: 309 282 movq efi_config(%rip), %rdi 310 283 call efi_main ··· 418 385 shrq $3, %rcx 419 386 rep stosq 420 387 421 - /* 422 - * Adjust our own GOT 423 - */ 424 - leaq _got(%rip), %rdx 425 - leaq _egot(%rip), %rcx 426 - 1: 427 - cmpq %rcx, %rdx 428 - jae 2f 429 - addq %rbx, (%rdx) 430 - addq $8, %rdx 431 - jmp 1b 432 - 2: 433 - 388 + FIXUP_GOT 389 + 434 390 /* 435 391 * Do the decompression, and jump to the new kernel.. 436 392 */ ··· 458 436 .quad 0x0080890000000000 /* TS descriptor */ 459 437 .quad 0x0000000000000000 /* TS continued */ 460 438 gdt_end: 439 + 440 + /* Have we relocated the GOT? */ 441 + got_fixed: 442 + .byte 0 461 443 462 444 #ifdef CONFIG_EFI_STUB 463 445 efi_config:
+1
arch/x86/include/asm/io_apic.h
··· 239 239 static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } 240 240 static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } 241 241 static inline void mp_unmap_irq(int irq) { } 242 + static inline bool mp_should_keep_irq(struct device *dev) { return 1; } 242 243 243 244 static inline int save_ioapic_entries(void) 244 245 {
+4
arch/x86/mm/dump_pagetables.c
··· 48 48 LOW_KERNEL_NR, 49 49 VMALLOC_START_NR, 50 50 VMEMMAP_START_NR, 51 + # ifdef CONFIG_X86_ESPFIX64 51 52 ESPFIX_START_NR, 53 + # endif 52 54 HIGH_KERNEL_NR, 53 55 MODULES_VADDR_NR, 54 56 MODULES_END_NR, ··· 73 71 { PAGE_OFFSET, "Low Kernel Mapping" }, 74 72 { VMALLOC_START, "vmalloc() Area" }, 75 73 { VMEMMAP_START, "Vmemmap" }, 74 + # ifdef CONFIG_X86_ESPFIX64 76 75 { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, 76 + # endif 77 77 { __START_KERNEL_map, "High Kernel Mapping" }, 78 78 { MODULES_VADDR, "Modules" }, 79 79 { MODULES_END, "End Modules" },
+1 -1
arch/x86/mm/mmap.c
··· 31 31 #include <linux/sched.h> 32 32 #include <asm/elf.h> 33 33 34 - struct __read_mostly va_alignment va_align = { 34 + struct va_alignment __read_mostly va_align = { 35 35 .flags = -1, 36 36 }; 37 37
+9 -1
drivers/firmware/efi/libstub/fdt.c
··· 22 22 unsigned long map_size, unsigned long desc_size, 23 23 u32 desc_ver) 24 24 { 25 - int node, prev; 25 + int node, prev, num_rsv; 26 26 int status; 27 27 u32 fdt_val32; 28 28 u64 fdt_val64; ··· 72 72 73 73 prev = node; 74 74 } 75 + 76 + /* 77 + * Delete all memory reserve map entries. When booting via UEFI, 78 + * kernel will use the UEFI memory map to find reserved regions. 79 + */ 80 + num_rsv = fdt_num_mem_rsv(fdt); 81 + while (num_rsv-- > 0) 82 + fdt_del_mem_rsv(fdt, num_rsv); 75 83 76 84 node = fdt_subnode_offset(fdt, 0, "chosen"); 77 85 if (node < 0) {