x86 fixes
Linus,
Please pull the latest x86-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus
# HEAD: 827409b2f5b58573ae3774fe6bd2d6daeb335878 x86/fpu/math-emu: Fix crash in fork()
Various low level fixes: fix more fallout from the FPU rework and the asm entry code rework, plus an MSI rework fix, and an idle-tracing fix.
Thanks,
Ingo
------------------>
Andy Lutomirski (1):
Revert "sched/x86_64: Don't save flags on context switch"
Ingo Molnar (2):
x86/fpu/math-emu: Fix math-emu boot crash
x86/fpu/math-emu: Fix crash in fork()
Jiang Liu (1):
x86/irq: Build correct vector mapping for multiple MSI interrupts
Jisheng Zhang (1):
x86/idle: Restore trace_cpu_idle to mwait_idle() calls
arch/x86/include/asm/switch_to.h | 12 ++++-------- arch/x86/kernel/apic/vector.c | 2 +- arch/x86/kernel/fpu/core.c | 2 +- arch/x86/kernel/fpu/init.c | 7 ++++++- arch/x86/kernel/process.c | 2 ++ 5 files changed, 14 insertions(+), 11 deletions(-)
arch/x86/include/asm/switch_to.h +4 -8
@@ -79,12 +79,12 @@ do { \#else /* CONFIG_X86_32 */ /* frame pointer must be last for get_wchan */ -#define SAVE_CONTEXT "pushq %%rbp ; movq %%rsi,%%rbp\n\t" -#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp\t" +#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t" +#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\t"#define __EXTRA_CLOBBER \ , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \ - "r12", "r13", "r14", "r15", "flags" + "r12", "r13", "r14", "r15"#ifdef CONFIG_CC_STACKPROTECTOR #define __switch_canary \
@@ -100,11 +100,7 @@ do { \#define __switch_canary_iparam#endif /* CC_STACKPROTECTOR */ -/* -* There is no need to save or restore flags, because flags are always -* clean in kernel mode, with the possible exception of IOPL. Kernel IOPL -* has no effect. -*/ +/* Save restore flags to clear handle leaking NT */ #define switch_to (prev, next, last) \ asm volatile(SAVE_CONTEXT \ "movq %%rsp,%P[threadrsp](%[prev])\n\t"/* save RSP */ \
arch/x86/kernel/apic/vector.c +1 -1
@@ -322,7 +322,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq, irq_data->chip = &lapic_controller; irq_data->chip_data = data; irq_data->hwirq = virq + i; - err =assign_irq_vector_policy (virq, irq_data->node, data, + err =assign_irq_vector_policy (virq + i, irq_data->node, data, info);if (err) goto error;
arch/x86/kernel/fpu/core.c +1 -1
@@ -270,7 +270,7 @@ int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu) dst_fpu->fpregs_active =0 ; dst_fpu->last_cpu =-1 ; -if (src_fpu->fpstate_active) +if (src_fpu->fpstate_active && cpu_has_fpu)fpu_copy (dst_fpu, src_fpu);return 0 ;
arch/x86/kernel/fpu/init.c +6 -1
@@ -40,7 +40,12 @@ static void fpu__init_cpu_generic(void)write_cr0 (cr0);/* Flush out any pending x87 state: */ - asmvolatile ("fninit" ); +#ifdef CONFIG_MATH_EMULATION +if (!cpu_has_fpu) +fpstate_init_soft (¤t->thread.fpu.state.soft); + else +#endif + asmvolatile ("fninit" ); }/*
arch/x86/kernel/process.c +2 -0
@@ -408,6 +408,7 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c)static void mwait_idle (void ) {if (!current_set_polling_and_test ()) { +trace_cpu_idle_rcuidle (1 ,smp_processor_id ());if (this_cpu_has (X86_BUG_CLFLUSH_MONITOR )) {smp_mb ();/* quirk */ clflush ((void *)¤t_thread_info ()->flags);
@@ -419,6 +420,7 @@ static void mwait_idle(void)__sti_mwait (0 ,0 ); elselocal_irq_enable (); +trace_cpu_idle_rcuidle (PWR_EVENT_EXIT ,smp_processor_id ()); }else {local_irq_enable (); }