Merge tag 'v4.15' into x86/pti, to be able to merge dependent changes
[linux-2.6-block.git] / arch / x86 / entry / entry_64.S
index 4f8e1d35a97ca7071a11f33f07e2b87c2eac7acf..a835704951629f2d741cc222ea479a362244ce06 100644 (file)
@@ -491,6 +491,18 @@ ENTRY(__switch_to_asm)
        movq    %rbx, PER_CPU_VAR(irq_stack_union)+stack_canary_offset
 #endif
 
+#ifdef CONFIG_RETPOLINE
+       /*
+        * When switching from a shallower to a deeper call stack
+        * the RSB may either underflow or use entries populated
+        * with userspace addresses. On CPUs where those concerns
+        * exist, overwrite the RSB with entries which capture
+        * speculative execution to prevent attack.
+        */
+       /* Clobbers %rbx */
+       FILL_RETURN_BUFFER RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW
+#endif
+
        /* restore callee-saved registers */
        popq    %r15
        popq    %r14
@@ -1253,7 +1265,7 @@ idtentry async_page_fault do_async_page_fault     has_error_code=1
 #endif
 
 #ifdef CONFIG_X86_MCE
-idtentry machine_check                                 has_error_code=0        paranoid=1 do_sym=*machine_check_vector(%rip)
+idtentry machine_check         do_mce                  has_error_code=0        paranoid=1
 #endif
 
 /*