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-pti-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 pti fixes from Ingo Molnar:
"An APM fix, and a BTS hardware-tracing fix related to PTI changes"

* 'x86-pti-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/apm: Don't access __preempt_count with zeroed fs
x86/events/intel/ds: Fix bts_interrupt_threshold alignment

+10 -9
+5 -3
arch/x86/events/intel/ds.c
··· 408 408 ds->bts_buffer_base = (unsigned long) cea; 409 409 ds_update_cea(cea, buffer, BTS_BUFFER_SIZE, PAGE_KERNEL); 410 410 ds->bts_index = ds->bts_buffer_base; 411 - max = BTS_RECORD_SIZE * (BTS_BUFFER_SIZE / BTS_RECORD_SIZE); 412 - ds->bts_absolute_maximum = ds->bts_buffer_base + max; 413 - ds->bts_interrupt_threshold = ds->bts_absolute_maximum - (max / 16); 411 + max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE; 412 + ds->bts_absolute_maximum = ds->bts_buffer_base + 413 + max * BTS_RECORD_SIZE; 414 + ds->bts_interrupt_threshold = ds->bts_absolute_maximum - 415 + (max / 16) * BTS_RECORD_SIZE; 414 416 return 0; 415 417 } 416 418
-6
arch/x86/include/asm/apm.h
··· 7 7 #ifndef _ASM_X86_MACH_DEFAULT_APM_H 8 8 #define _ASM_X86_MACH_DEFAULT_APM_H 9 9 10 - #include <asm/nospec-branch.h> 11 - 12 10 #ifdef APM_ZERO_SEGS 13 11 # define APM_DO_ZERO_SEGS \ 14 12 "pushl %%ds\n\t" \ ··· 32 34 * N.B. We do NOT need a cld after the BIOS call 33 35 * because we always save and restore the flags. 34 36 */ 35 - firmware_restrict_branch_speculation_start(); 36 37 __asm__ __volatile__(APM_DO_ZERO_SEGS 37 38 "pushl %%edi\n\t" 38 39 "pushl %%ebp\n\t" ··· 44 47 "=S" (*esi) 45 48 : "a" (func), "b" (ebx_in), "c" (ecx_in) 46 49 : "memory", "cc"); 47 - firmware_restrict_branch_speculation_end(); 48 50 } 49 51 50 52 static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, ··· 56 60 * N.B. We do NOT need a cld after the BIOS call 57 61 * because we always save and restore the flags. 58 62 */ 59 - firmware_restrict_branch_speculation_start(); 60 63 __asm__ __volatile__(APM_DO_ZERO_SEGS 61 64 "pushl %%edi\n\t" 62 65 "pushl %%ebp\n\t" ··· 68 73 "=S" (si) 69 74 : "a" (func), "b" (ebx_in), "c" (ecx_in) 70 75 : "memory", "cc"); 71 - firmware_restrict_branch_speculation_end(); 72 76 return error; 73 77 } 74 78
+5
arch/x86/kernel/apm_32.c
··· 240 240 #include <asm/olpc.h> 241 241 #include <asm/paravirt.h> 242 242 #include <asm/reboot.h> 243 + #include <asm/nospec-branch.h> 243 244 244 245 #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) 245 246 extern int (*console_blank_hook)(int); ··· 615 614 gdt[0x40 / 8] = bad_bios_desc; 616 615 617 616 apm_irq_save(flags); 617 + firmware_restrict_branch_speculation_start(); 618 618 APM_DO_SAVE_SEGS; 619 619 apm_bios_call_asm(call->func, call->ebx, call->ecx, 620 620 &call->eax, &call->ebx, &call->ecx, &call->edx, 621 621 &call->esi); 622 622 APM_DO_RESTORE_SEGS; 623 + firmware_restrict_branch_speculation_end(); 623 624 apm_irq_restore(flags); 624 625 gdt[0x40 / 8] = save_desc_40; 625 626 put_cpu(); ··· 693 690 gdt[0x40 / 8] = bad_bios_desc; 694 691 695 692 apm_irq_save(flags); 693 + firmware_restrict_branch_speculation_start(); 696 694 APM_DO_SAVE_SEGS; 697 695 error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx, 698 696 &call->eax); 699 697 APM_DO_RESTORE_SEGS; 698 + firmware_restrict_branch_speculation_end(); 700 699 apm_irq_restore(flags); 701 700 gdt[0x40 / 8] = save_desc_40; 702 701 put_cpu();