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:

- MCE related boot crash fix on certain AMD systems

- FPU exception handling fix

- FPU handling race fix

- revert+rewrite of the RSDP boot protocol extension, use boot_params
instead

- documentation fix"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/MCE/AMD: Fix the thresholding machinery initialization order
x86/fpu: Use the correct exception table macro in the XSTATE_OP wrapper
x86/fpu: Disable bottom halves while loading FPU registers
x86/acpi, x86/boot: Take RSDP address from boot params if available
x86/boot: Mostly revert commit ae7e1238e68f2a ("Add ACPI RSDP address to setup_header")
x86/ptrace: Fix documentation for tracehook_report_syscall_entry()

+16 -82
+1 -31
Documentation/x86/boot.txt
··· 61 61 to struct boot_params for loading bzImage and ramdisk 62 62 above 4G in 64bit. 63 63 64 - Protocol 2.13: (Kernel 3.14) Support 32- and 64-bit flags being set in 65 - xloadflags to support booting a 64-bit kernel from 32-bit 66 - EFI 67 - 68 - Protocol 2.14: (Kernel 4.20) Added acpi_rsdp_addr holding the physical 69 - address of the ACPI RSDP table. 70 - The bootloader updates version with: 71 - 0x8000 | min(kernel-version, bootloader-version) 72 - kernel-version being the protocol version supported by 73 - the kernel and bootloader-version the protocol version 74 - supported by the bootloader. 75 - 76 64 **** MEMORY LAYOUT 77 65 78 66 The traditional memory map for the kernel loader, used for Image or ··· 197 209 0258/8 2.10+ pref_address Preferred loading address 198 210 0260/4 2.10+ init_size Linear memory required during initialization 199 211 0264/4 2.11+ handover_offset Offset of handover entry point 200 - 0268/8 2.14+ acpi_rsdp_addr Physical address of RSDP table 201 212 202 213 (1) For backwards compatibility, if the setup_sects field contains 0, the 203 214 real value is 4. ··· 309 322 Contains the magic number "HdrS" (0x53726448). 310 323 311 324 Field name: version 312 - Type: modify 325 + Type: read 313 326 Offset/size: 0x206/2 314 327 Protocol: 2.00+ 315 328 316 329 Contains the boot protocol version, in (major << 8)+minor format, 317 330 e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version 318 331 10.17. 319 - 320 - Up to protocol version 2.13 this information is only read by the 321 - bootloader. From protocol version 2.14 onwards the bootloader will 322 - write the used protocol version or-ed with 0x8000 to the field. The 323 - used protocol version will be the minimum of the supported protocol 324 - versions of the bootloader and the kernel. 325 332 326 333 Field name: realmode_swtch 327 334 Type: modify (optional) ··· 743 762 handover protocol to boot the kernel should jump to this offset. 744 763 745 764 See EFI HANDOVER PROTOCOL below for more details. 746 - 747 - Field name: acpi_rsdp_addr 748 - Type: write 749 - Offset/size: 0x268/8 750 - Protocol: 2.14+ 751 - 752 - This field can be set by the boot loader to tell the kernel the 753 - physical address of the ACPI RSDP table. 754 - 755 - A value of 0 indicates the kernel should fall back to the standard 756 - methods to locate the RSDP. 757 765 758 766 759 767 **** THE IMAGE CHECKSUM
+1 -5
arch/x86/boot/header.S
··· 300 300 # Part 2 of the header, from the old setup.S 301 301 302 302 .ascii "HdrS" # header signature 303 - .word 0x020e # header version number (>= 0x0105) 303 + .word 0x020d # header version number (>= 0x0105) 304 304 # or else old loadlin-1.5 will fail) 305 305 .globl realmode_swtch 306 306 realmode_swtch: .word 0, 0 # default_switch, SETUPSEG ··· 557 557 558 558 init_size: .long INIT_SIZE # kernel initialization size 559 559 handover_offset: .long 0 # Filled in by build.c 560 - 561 - acpi_rsdp_addr: .quad 0 # 64-bit physical pointer to the 562 - # ACPI RSDP table, added with 563 - # version 2.14 564 560 565 561 # End of setup header ##################################################### 566 562
+1 -1
arch/x86/include/asm/fpu/internal.h
··· 226 226 "3: movl $-2,%[err]\n\t" \ 227 227 "jmp 2b\n\t" \ 228 228 ".popsection\n\t" \ 229 - _ASM_EXTABLE_UA(1b, 3b) \ 229 + _ASM_EXTABLE(1b, 3b) \ 230 230 : [err] "=r" (err) \ 231 231 : "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \ 232 232 : "memory")
-2
arch/x86/include/asm/x86_init.h
··· 303 303 extern void x86_init_uint_noop(unsigned int unused); 304 304 extern bool x86_pnpbios_disabled(void); 305 305 306 - void x86_verify_bootdata_version(void); 307 - 308 306 #endif
+2 -5
arch/x86/include/uapi/asm/bootparam.h
··· 16 16 #define RAMDISK_PROMPT_FLAG 0x8000 17 17 #define RAMDISK_LOAD_FLAG 0x4000 18 18 19 - /* version flags */ 20 - #define VERSION_WRITTEN 0x8000 21 - 22 19 /* loadflags */ 23 20 #define LOADED_HIGH (1<<0) 24 21 #define KASLR_FLAG (1<<1) ··· 86 89 __u64 pref_address; 87 90 __u32 init_size; 88 91 __u32 handover_offset; 89 - __u64 acpi_rsdp_addr; 90 92 } __attribute__((packed)); 91 93 92 94 struct sys_desc_table { ··· 155 159 __u8 _pad2[4]; /* 0x054 */ 156 160 __u64 tboot_addr; /* 0x058 */ 157 161 struct ist_info ist_info; /* 0x060 */ 158 - __u8 _pad3[16]; /* 0x070 */ 162 + __u64 acpi_rsdp_addr; /* 0x070 */ 163 + __u8 _pad3[8]; /* 0x078 */ 159 164 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ 160 165 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ 161 166 struct sys_desc_table sys_desc_table; /* obsolete! */ /* 0x0a0 */
+1 -1
arch/x86/kernel/acpi/boot.c
··· 1776 1776 1777 1777 u64 x86_default_get_root_pointer(void) 1778 1778 { 1779 - return boot_params.hdr.acpi_rsdp_addr; 1779 + return boot_params.acpi_rsdp_addr; 1780 1780 }
+6 -13
arch/x86/kernel/cpu/mcheck/mce_amd.c
··· 56 56 /* Threshold LVT offset is at MSR0xC0000410[15:12] */ 57 57 #define SMCA_THR_LVT_OFF 0xF000 58 58 59 - static bool thresholding_en; 59 + static bool thresholding_irq_en; 60 60 61 61 static const char * const th_names[] = { 62 62 "load_store", ··· 534 534 535 535 set_offset: 536 536 offset = setup_APIC_mce_threshold(offset, new); 537 - 538 - if ((offset == new) && (mce_threshold_vector != amd_threshold_interrupt)) 539 - mce_threshold_vector = amd_threshold_interrupt; 537 + if (offset == new) 538 + thresholding_irq_en = true; 540 539 541 540 done: 542 541 mce_threshold_block_init(&b, offset); ··· 1356 1357 { 1357 1358 unsigned int bank; 1358 1359 1359 - if (!thresholding_en) 1360 - return 0; 1361 - 1362 1360 for (bank = 0; bank < mca_cfg.banks; ++bank) { 1363 1361 if (!(per_cpu(bank_map, cpu) & (1 << bank))) 1364 1362 continue; ··· 1372 1376 unsigned int bank; 1373 1377 struct threshold_bank **bp; 1374 1378 int err = 0; 1375 - 1376 - if (!thresholding_en) 1377 - return 0; 1378 1379 1379 1380 bp = per_cpu(threshold_banks, cpu); 1380 1381 if (bp) ··· 1401 1408 { 1402 1409 unsigned lcpu = 0; 1403 1410 1404 - if (mce_threshold_vector == amd_threshold_interrupt) 1405 - thresholding_en = true; 1406 - 1407 1411 /* to hit CPUs online before the notifier is up */ 1408 1412 for_each_online_cpu(lcpu) { 1409 1413 int err = mce_threshold_create_device(lcpu); ··· 1408 1418 if (err) 1409 1419 return err; 1410 1420 } 1421 + 1422 + if (thresholding_irq_en) 1423 + mce_threshold_vector = amd_threshold_interrupt; 1411 1424 1412 1425 return 0; 1413 1426 }
+2 -2
arch/x86/kernel/fpu/signal.c
··· 344 344 sanitize_restored_xstate(tsk, &env, xfeatures, fx_only); 345 345 } 346 346 347 + local_bh_disable(); 347 348 fpu->initialized = 1; 348 - preempt_disable(); 349 349 fpu__restore(fpu); 350 - preempt_enable(); 350 + local_bh_enable(); 351 351 352 352 return err; 353 353 } else {
-1
arch/x86/kernel/head32.c
··· 37 37 cr4_init_shadow(); 38 38 39 39 sanitize_boot_params(&boot_params); 40 - x86_verify_bootdata_version(); 41 40 42 41 x86_early_init_platform_quirks(); 43 42
-2
arch/x86/kernel/head64.c
··· 457 457 if (!boot_params.hdr.version) 458 458 copy_bootdata(__va(real_mode_data)); 459 459 460 - x86_verify_bootdata_version(); 461 - 462 460 x86_early_init_platform_quirks(); 463 461 464 462 switch (boot_params.hdr.hardware_subarch) {
-17
arch/x86/kernel/setup.c
··· 1280 1280 unwind_init(); 1281 1281 } 1282 1282 1283 - /* 1284 - * From boot protocol 2.14 onwards we expect the bootloader to set the 1285 - * version to "0x8000 | <used version>". In case we find a version >= 2.14 1286 - * without the 0x8000 we assume the boot loader supports 2.13 only and 1287 - * reset the version accordingly. The 0x8000 flag is removed in any case. 1288 - */ 1289 - void __init x86_verify_bootdata_version(void) 1290 - { 1291 - if (boot_params.hdr.version & VERSION_WRITTEN) 1292 - boot_params.hdr.version &= ~VERSION_WRITTEN; 1293 - else if (boot_params.hdr.version >= 0x020e) 1294 - boot_params.hdr.version = 0x020d; 1295 - 1296 - if (boot_params.hdr.version < 0x020e) 1297 - boot_params.hdr.acpi_rsdp_addr = 0; 1298 - } 1299 - 1300 1283 #ifdef CONFIG_X86_32 1301 1284 1302 1285 static struct resource video_ram_resource = {
+2 -2
include/linux/tracehook.h
··· 83 83 * tracehook_report_syscall_entry - task is about to attempt a system call 84 84 * @regs: user register state of current task 85 85 * 86 - * This will be called if %TIF_SYSCALL_TRACE has been set, when the 87 - * current task has just entered the kernel for a system call. 86 + * This will be called if %TIF_SYSCALL_TRACE or %TIF_SYSCALL_EMU have been set, 87 + * when the current task has just entered the kernel for a system call. 88 88 * Full user register state is available here. Changing the values 89 89 * in @regs can affect the system call number and arguments to be tried. 90 90 * It is safe to block here, preventing the system call from beginning.