aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/ia32/ia32entry.S25
-rw-r--r--arch/x86/kernel/asm-offsets_64.c2
-rw-r--r--arch/x86/kernel/entry_64.S23
-rw-r--r--arch/x86/lib/copy_user_64.S4
-rw-r--r--arch/x86/lib/getuser_64.S8
-rw-r--r--arch/x86/lib/putuser_64.S8
6 files changed, 37 insertions, 33 deletions
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 24e4d4928d65..20371d0635e4 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -116,7 +116,7 @@ ENTRY(ia32_sysenter_target)
116 pushfq 116 pushfq
117 CFI_ADJUST_CFA_OFFSET 8 117 CFI_ADJUST_CFA_OFFSET 8
118 /*CFI_REL_OFFSET rflags,0*/ 118 /*CFI_REL_OFFSET rflags,0*/
119 movl 8*3-THREAD_SIZE+threadinfo_sysenter_return(%rsp), %r10d 119 movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d
120 CFI_REGISTER rip,r10 120 CFI_REGISTER rip,r10
121 pushq $__USER32_CS 121 pushq $__USER32_CS
122 CFI_ADJUST_CFA_OFFSET 8 122 CFI_ADJUST_CFA_OFFSET 8
@@ -136,8 +136,9 @@ ENTRY(ia32_sysenter_target)
136 .quad 1b,ia32_badarg 136 .quad 1b,ia32_badarg
137 .previous 137 .previous
138 GET_THREAD_INFO(%r10) 138 GET_THREAD_INFO(%r10)
139 orl $TS_COMPAT,threadinfo_status(%r10) 139 orl $TS_COMPAT,TI_status(%r10)
140 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10) 140 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP), \
141 TI_flags(%r10)
141 CFI_REMEMBER_STATE 142 CFI_REMEMBER_STATE
142 jnz sysenter_tracesys 143 jnz sysenter_tracesys
143sysenter_do_call: 144sysenter_do_call:
@@ -149,9 +150,9 @@ sysenter_do_call:
149 GET_THREAD_INFO(%r10) 150 GET_THREAD_INFO(%r10)
150 DISABLE_INTERRUPTS(CLBR_NONE) 151 DISABLE_INTERRUPTS(CLBR_NONE)
151 TRACE_IRQS_OFF 152 TRACE_IRQS_OFF
152 testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10) 153 testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
153 jnz int_ret_from_sys_call 154 jnz int_ret_from_sys_call
154 andl $~TS_COMPAT,threadinfo_status(%r10) 155 andl $~TS_COMPAT,TI_status(%r10)
155 /* clear IF, that popfq doesn't enable interrupts early */ 156 /* clear IF, that popfq doesn't enable interrupts early */
156 andl $~0x200,EFLAGS-R11(%rsp) 157 andl $~0x200,EFLAGS-R11(%rsp)
157 movl RIP-R11(%rsp),%edx /* User %eip */ 158 movl RIP-R11(%rsp),%edx /* User %eip */
@@ -240,8 +241,9 @@ ENTRY(ia32_cstar_target)
240 .quad 1b,ia32_badarg 241 .quad 1b,ia32_badarg
241 .previous 242 .previous
242 GET_THREAD_INFO(%r10) 243 GET_THREAD_INFO(%r10)
243 orl $TS_COMPAT,threadinfo_status(%r10) 244 orl $TS_COMPAT,TI_status(%r10)
244 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10) 245 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP), \
246 TI_flags(%r10)
245 CFI_REMEMBER_STATE 247 CFI_REMEMBER_STATE
246 jnz cstar_tracesys 248 jnz cstar_tracesys
247cstar_do_call: 249cstar_do_call:
@@ -253,9 +255,9 @@ cstar_do_call:
253 GET_THREAD_INFO(%r10) 255 GET_THREAD_INFO(%r10)
254 DISABLE_INTERRUPTS(CLBR_NONE) 256 DISABLE_INTERRUPTS(CLBR_NONE)
255 TRACE_IRQS_OFF 257 TRACE_IRQS_OFF
256 testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10) 258 testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
257 jnz int_ret_from_sys_call 259 jnz int_ret_from_sys_call
258 andl $~TS_COMPAT,threadinfo_status(%r10) 260 andl $~TS_COMPAT,TI_status(%r10)
259 RESTORE_ARGS 1,-ARG_SKIP,1,1,1 261 RESTORE_ARGS 1,-ARG_SKIP,1,1,1
260 movl RIP-ARGOFFSET(%rsp),%ecx 262 movl RIP-ARGOFFSET(%rsp),%ecx
261 CFI_REGISTER rip,rcx 263 CFI_REGISTER rip,rcx
@@ -333,8 +335,9 @@ ENTRY(ia32_syscall)
333 this could be a problem. */ 335 this could be a problem. */
334 SAVE_ARGS 0,0,1 336 SAVE_ARGS 0,0,1
335 GET_THREAD_INFO(%r10) 337 GET_THREAD_INFO(%r10)
336 orl $TS_COMPAT,threadinfo_status(%r10) 338 orl $TS_COMPAT,TI_status(%r10)
337 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10) 339 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP), \
340 TI_flags(%r10)
338 jnz ia32_tracesys 341 jnz ia32_tracesys
339ia32_do_syscall: 342ia32_do_syscall:
340 cmpl $(IA32_NR_syscalls-1),%eax 343 cmpl $(IA32_NR_syscalls-1),%eax
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 3295e7c08fe7..bacf5deeec2d 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -34,7 +34,7 @@ int main(void)
34 ENTRY(pid); 34 ENTRY(pid);
35 BLANK(); 35 BLANK();
36#undef ENTRY 36#undef ENTRY
37#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry)) 37#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
38 ENTRY(flags); 38 ENTRY(flags);
39 ENTRY(addr_limit); 39 ENTRY(addr_limit);
40 ENTRY(preempt_count); 40 ENTRY(preempt_count);
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 07d69f262337..466b9284ed2f 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -168,13 +168,13 @@ ENTRY(ret_from_fork)
168 CFI_ADJUST_CFA_OFFSET -4 168 CFI_ADJUST_CFA_OFFSET -4
169 call schedule_tail 169 call schedule_tail
170 GET_THREAD_INFO(%rcx) 170 GET_THREAD_INFO(%rcx)
171 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx) 171 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%rcx)
172 jnz rff_trace 172 jnz rff_trace
173rff_action: 173rff_action:
174 RESTORE_REST 174 RESTORE_REST
175 testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread? 175 testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread?
176 je int_ret_from_sys_call 176 je int_ret_from_sys_call
177 testl $_TIF_IA32,threadinfo_flags(%rcx) 177 testl $_TIF_IA32,TI_flags(%rcx)
178 jnz int_ret_from_sys_call 178 jnz int_ret_from_sys_call
179 RESTORE_TOP_OF_STACK %rdi,ARGOFFSET 179 RESTORE_TOP_OF_STACK %rdi,ARGOFFSET
180 jmp ret_from_sys_call 180 jmp ret_from_sys_call
@@ -243,7 +243,8 @@ ENTRY(system_call_after_swapgs)
243 movq %rcx,RIP-ARGOFFSET(%rsp) 243 movq %rcx,RIP-ARGOFFSET(%rsp)
244 CFI_REL_OFFSET rip,RIP-ARGOFFSET 244 CFI_REL_OFFSET rip,RIP-ARGOFFSET
245 GET_THREAD_INFO(%rcx) 245 GET_THREAD_INFO(%rcx)
246 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx) 246 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP), \
247 TI_flags(%rcx)
247 jnz tracesys 248 jnz tracesys
248 cmpq $__NR_syscall_max,%rax 249 cmpq $__NR_syscall_max,%rax
249 ja badsys 250 ja badsys
@@ -262,7 +263,7 @@ sysret_check:
262 GET_THREAD_INFO(%rcx) 263 GET_THREAD_INFO(%rcx)
263 DISABLE_INTERRUPTS(CLBR_NONE) 264 DISABLE_INTERRUPTS(CLBR_NONE)
264 TRACE_IRQS_OFF 265 TRACE_IRQS_OFF
265 movl threadinfo_flags(%rcx),%edx 266 movl TI_flags(%rcx),%edx
266 andl %edi,%edx 267 andl %edi,%edx
267 jnz sysret_careful 268 jnz sysret_careful
268 CFI_REMEMBER_STATE 269 CFI_REMEMBER_STATE
@@ -347,10 +348,10 @@ int_ret_from_sys_call:
347int_with_check: 348int_with_check:
348 LOCKDEP_SYS_EXIT_IRQ 349 LOCKDEP_SYS_EXIT_IRQ
349 GET_THREAD_INFO(%rcx) 350 GET_THREAD_INFO(%rcx)
350 movl threadinfo_flags(%rcx),%edx 351 movl TI_flags(%rcx),%edx
351 andl %edi,%edx 352 andl %edi,%edx
352 jnz int_careful 353 jnz int_careful
353 andl $~TS_COMPAT,threadinfo_status(%rcx) 354 andl $~TS_COMPAT,TI_status(%rcx)
354 jmp retint_swapgs 355 jmp retint_swapgs
355 356
356 /* Either reschedule or signal or syscall exit tracking needed. */ 357 /* Either reschedule or signal or syscall exit tracking needed. */
@@ -558,7 +559,7 @@ retint_with_reschedule:
558 movl $_TIF_WORK_MASK,%edi 559 movl $_TIF_WORK_MASK,%edi
559retint_check: 560retint_check:
560 LOCKDEP_SYS_EXIT_IRQ 561 LOCKDEP_SYS_EXIT_IRQ
561 movl threadinfo_flags(%rcx),%edx 562 movl TI_flags(%rcx),%edx
562 andl %edi,%edx 563 andl %edi,%edx
563 CFI_REMEMBER_STATE 564 CFI_REMEMBER_STATE
564 jnz retint_careful 565 jnz retint_careful
@@ -654,9 +655,9 @@ retint_signal:
654 /* Returning to kernel space. Check if we need preemption */ 655 /* Returning to kernel space. Check if we need preemption */
655 /* rcx: threadinfo. interrupts off. */ 656 /* rcx: threadinfo. interrupts off. */
656ENTRY(retint_kernel) 657ENTRY(retint_kernel)
657 cmpl $0,threadinfo_preempt_count(%rcx) 658 cmpl $0,TI_preempt_count(%rcx)
658 jnz retint_restore_args 659 jnz retint_restore_args
659 bt $TIF_NEED_RESCHED,threadinfo_flags(%rcx) 660 bt $TIF_NEED_RESCHED,TI_flags(%rcx)
660 jnc retint_restore_args 661 jnc retint_restore_args
661 bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */ 662 bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */
662 jnc retint_restore_args 663 jnc retint_restore_args
@@ -819,7 +820,7 @@ paranoid_restore\trace:
819 jmp irq_return 820 jmp irq_return
820paranoid_userspace\trace: 821paranoid_userspace\trace:
821 GET_THREAD_INFO(%rcx) 822 GET_THREAD_INFO(%rcx)
822 movl threadinfo_flags(%rcx),%ebx 823 movl TI_flags(%rcx),%ebx
823 andl $_TIF_WORK_MASK,%ebx 824 andl $_TIF_WORK_MASK,%ebx
824 jz paranoid_swapgs\trace 825 jz paranoid_swapgs\trace
825 movq %rsp,%rdi /* &pt_regs */ 826 movq %rsp,%rdi /* &pt_regs */
@@ -917,7 +918,7 @@ error_exit:
917 testl %eax,%eax 918 testl %eax,%eax
918 jne retint_kernel 919 jne retint_kernel
919 LOCKDEP_SYS_EXIT_IRQ 920 LOCKDEP_SYS_EXIT_IRQ
920 movl threadinfo_flags(%rcx),%edx 921 movl TI_flags(%rcx),%edx
921 movl $_TIF_WORK_MASK,%edi 922 movl $_TIF_WORK_MASK,%edi
922 andl %edi,%edx 923 andl %edi,%edx
923 jnz retint_careful 924 jnz retint_careful
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index ee1c3f635157..7eaaf0123b4d 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -40,7 +40,7 @@ ENTRY(copy_to_user)
40 movq %rdi,%rcx 40 movq %rdi,%rcx
41 addq %rdx,%rcx 41 addq %rdx,%rcx
42 jc bad_to_user 42 jc bad_to_user
43 cmpq threadinfo_addr_limit(%rax),%rcx 43 cmpq TI_addr_limit(%rax),%rcx
44 jae bad_to_user 44 jae bad_to_user
45 xorl %eax,%eax /* clear zero flag */ 45 xorl %eax,%eax /* clear zero flag */
46 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 46 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
@@ -65,7 +65,7 @@ ENTRY(copy_from_user)
65 movq %rsi,%rcx 65 movq %rsi,%rcx
66 addq %rdx,%rcx 66 addq %rdx,%rcx
67 jc bad_from_user 67 jc bad_from_user
68 cmpq threadinfo_addr_limit(%rax),%rcx 68 cmpq TI_addr_limit(%rax),%rcx
69 jae bad_from_user 69 jae bad_from_user
70 movl $1,%ecx /* set zero flag */ 70 movl $1,%ecx /* set zero flag */
71 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 71 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
diff --git a/arch/x86/lib/getuser_64.S b/arch/x86/lib/getuser_64.S
index df37d3a9ba2a..0ec7890f9dcc 100644
--- a/arch/x86/lib/getuser_64.S
+++ b/arch/x86/lib/getuser_64.S
@@ -37,7 +37,7 @@
37ENTRY(__get_user_1) 37ENTRY(__get_user_1)
38 CFI_STARTPROC 38 CFI_STARTPROC
39 GET_THREAD_INFO(%rdx) 39 GET_THREAD_INFO(%rdx)
40 cmpq threadinfo_addr_limit(%rdx),%rax 40 cmpq TI_addr_limit(%rdx),%rax
41 jae bad_get_user 41 jae bad_get_user
421: movzb (%rax),%edx 421: movzb (%rax),%edx
43 xorl %eax,%eax 43 xorl %eax,%eax
@@ -50,7 +50,7 @@ ENTRY(__get_user_2)
50 addq $1,%rax 50 addq $1,%rax
51 jc bad_get_user 51 jc bad_get_user
52 GET_THREAD_INFO(%rdx) 52 GET_THREAD_INFO(%rdx)
53 cmpq threadinfo_addr_limit(%rdx),%rax 53 cmpq TI_addr_limit(%rdx),%rax
54 jae bad_get_user 54 jae bad_get_user
552: movzwl -1(%rax),%edx 552: movzwl -1(%rax),%edx
56 xorl %eax,%eax 56 xorl %eax,%eax
@@ -63,7 +63,7 @@ ENTRY(__get_user_4)
63 addq $3,%rax 63 addq $3,%rax
64 jc bad_get_user 64 jc bad_get_user
65 GET_THREAD_INFO(%rdx) 65 GET_THREAD_INFO(%rdx)
66 cmpq threadinfo_addr_limit(%rdx),%rax 66 cmpq TI_addr_limit(%rdx),%rax
67 jae bad_get_user 67 jae bad_get_user
683: movl -3(%rax),%edx 683: movl -3(%rax),%edx
69 xorl %eax,%eax 69 xorl %eax,%eax
@@ -76,7 +76,7 @@ ENTRY(__get_user_8)
76 addq $7,%rax 76 addq $7,%rax
77 jc bad_get_user 77 jc bad_get_user
78 GET_THREAD_INFO(%rdx) 78 GET_THREAD_INFO(%rdx)
79 cmpq threadinfo_addr_limit(%rdx),%rax 79 cmpq TI_addr_limit(%rdx),%rax
80 jae bad_get_user 80 jae bad_get_user
814: movq -7(%rax),%rdx 814: movq -7(%rax),%rdx
82 xorl %eax,%eax 82 xorl %eax,%eax
diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S
index 4989f5a8fa9b..940796fa0d98 100644
--- a/arch/x86/lib/putuser_64.S
+++ b/arch/x86/lib/putuser_64.S
@@ -35,7 +35,7 @@
35ENTRY(__put_user_1) 35ENTRY(__put_user_1)
36 CFI_STARTPROC 36 CFI_STARTPROC
37 GET_THREAD_INFO(%r8) 37 GET_THREAD_INFO(%r8)
38 cmpq threadinfo_addr_limit(%r8),%rcx 38 cmpq TI_addr_limit(%r8),%rcx
39 jae bad_put_user 39 jae bad_put_user
401: movb %dl,(%rcx) 401: movb %dl,(%rcx)
41 xorl %eax,%eax 41 xorl %eax,%eax
@@ -48,7 +48,7 @@ ENTRY(__put_user_2)
48 GET_THREAD_INFO(%r8) 48 GET_THREAD_INFO(%r8)
49 addq $1,%rcx 49 addq $1,%rcx
50 jc 20f 50 jc 20f
51 cmpq threadinfo_addr_limit(%r8),%rcx 51 cmpq TI_addr_limit(%r8),%rcx
52 jae 20f 52 jae 20f
53 decq %rcx 53 decq %rcx
542: movw %dx,(%rcx) 542: movw %dx,(%rcx)
@@ -64,7 +64,7 @@ ENTRY(__put_user_4)
64 GET_THREAD_INFO(%r8) 64 GET_THREAD_INFO(%r8)
65 addq $3,%rcx 65 addq $3,%rcx
66 jc 30f 66 jc 30f
67 cmpq threadinfo_addr_limit(%r8),%rcx 67 cmpq TI_addr_limit(%r8),%rcx
68 jae 30f 68 jae 30f
69 subq $3,%rcx 69 subq $3,%rcx
703: movl %edx,(%rcx) 703: movl %edx,(%rcx)
@@ -80,7 +80,7 @@ ENTRY(__put_user_8)
80 GET_THREAD_INFO(%r8) 80 GET_THREAD_INFO(%r8)
81 addq $7,%rcx 81 addq $7,%rcx
82 jc 40f 82 jc 40f
83 cmpq threadinfo_addr_limit(%r8),%rcx 83 cmpq TI_addr_limit(%r8),%rcx
84 jae 40f 84 jae 40f
85 subq $7,%rcx 85 subq $7,%rcx
864: movq %rdx,(%rcx) 864: movq %rdx,(%rcx)