#include <asm/irqflags.h>
#include <asm/asm.h>
#include <asm/smap.h>
+#include <asm/spec_ctrl.h>
#include <linux/linkage.h>
#include <linux/err.h>
sub $(10*8),%rsp /* pt_regs->r8-11,bp,bx,r12-15 not saved */
CFI_ADJUST_CFA_OFFSET 10*8
+ ENABLE_IBRS
+
/*
* no need to do an access_ok check here because rbp has been
* 32bit zero extended
sub $(10*8),%rsp /* pt_regs->r8-11,bp,bx,r12-15 not saved */
CFI_ADJUST_CFA_OFFSET 10*8
+ ENABLE_IBRS
+
orl $TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS)
testl $_TIF_WORK_SYSCALL_ENTRY, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
jnz ia32_tracesys
movq %rax,RAX(%rsp)
ia32_ret_from_sys_call:
CLEAR_RREGS
+ DISABLE_IBRS
jmp int_ret_from_sys_call
ia32_tracesys:
#include <asm/smap.h>
#include <asm/pgtable_types.h>
#include <asm/dtrace_util.h>
+#include <asm/spec_ctrl.h>
#include <linux/err.h>
/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
movq %rsp,PER_CPU_VAR(rsp_scratch)
movq PER_CPU_VAR(kernel_stack),%rsp
+ ENABLE_IBRS
+
/* Construct struct pt_regs on stack */
pushq_cfi $__USER_DS /* pt_regs->ss */
pushq_cfi PER_CPU_VAR(rsp_scratch) /* pt_regs->sp */
* perf profiles. Nothing jumps here.
*/
syscall_return_via_sysret:
+ DISABLE_IBRS
CFI_REMEMBER_STATE
/* r11 is already restored (see code above) */
RESTORE_C_REGS_EXCEPT_R11
* which come from interrupts/exception and from syscalls, merge.
*/
restore_c_regs_and_iret:
+ DISABLE_IBRS
RESTORE_C_REGS
REMOVE_PT_GPREGS_FROM_STACK 8
INTERRUPT_RETURN
js 1f /* negative -> in kernel */
SWAPGS
xorl %ebx,%ebx
-1: ret
+1: ENABLE_IBRS_CLOBBER
+ ret
CFI_ENDPROC
END(paranoid_entry)
je error_kernelspace
error_swapgs:
SWAPGS
+ ENABLE_IBRS_CLOBBER
error_sti:
TRACE_IRQS_OFF
ret
error_bad_iret:
SWAPGS
+ ENABLE_IBRS
mov %rsp,%rdi
call fixup_bad_iret
mov %rax,%rsp
cld
movq %rsp, %rdx
movq PER_CPU_VAR(kernel_stack), %rsp
+ ENABLE_IBRS
pushq 5*8(%rdx) /* pt_regs->ss */
pushq 4*8(%rdx) /* pt_regs->rsp */
pushq 3*8(%rdx) /* pt_regs->flags */