History

MN10300: Save frame pointer in thread_info struct rather than global var

Save the current exception frame pointer in the thread_info struct rather than in a global variable as the latter makes SMP tricky, especially when preemption is also enabled. This also replaces __frame with current_frame() and rearranges header file inclusions to make it all compile.

David Howells committed 16 years ago

Commit 7c7fcf71 parent a5e03ca15 files · +76 −146Browse files

Unified · Split

15 files
  1. arch/mn10300/include/asm/frame.inc +13 −43
  2. arch/mn10300/include/asm/irq_regs.h +5 −1
  3. arch/mn10300/include/asm/pgalloc.h +0 −1
  4. arch/mn10300/include/asm/processor.h +18 −28
  5. arch/mn10300/include/asm/ptrace.h +0 −6
  6. arch/mn10300/include/asm/smp.h +0 −13
  7. arch/mn10300/include/asm/thread_info.h +14 −4
  8. arch/mn10300/include/asm/uaccess.h +1 −3
  9. arch/mn10300/kernel/asm-offsets.c +1 −1
  10. arch/mn10300/kernel/mn10300-watchdog.c +1 −1
  11. arch/mn10300/kernel/process.c +11 −9
  12. arch/mn10300/kernel/signal.c +11 −9
  13. arch/mn10300/kernel/switch_to.S +0 −18
  14. arch/mn10300/kernel/traps.c +0 −8
  15. mm/maccess.c +1 −1
arch/mn10300/include/asm/frame.inc+13−43
@@ -18,9 +18,7 @@ · 17 unmodified lines
18#ifndef __ASM_OFFSETS_H__18#ifndef __ASM_OFFSETS_H__
19#include <asm/asm-offsets.h>19#include <asm/asm-offsets.h>
20#endif20#endif
21#ifdef CONFIG_SMP21#include <asm/thread_info.h>
22#include <proc/smp-regs.h>
23#endif
24 22
25#define pi break23#define pi break
26 24
@@ -40,27 +38,15 @@ · 13 unmodified lines
40 movm [d2,d3,a2,a3,exreg0,exreg1,exother],(sp)38 movm [d2,d3,a2,a3,exreg0,exreg1,exother],(sp)
41 mov sp,fp # FRAME pointer in A339 mov sp,fp # FRAME pointer in A3
42 add -12,sp # allow for calls to be made40 add -12,sp # allow for calls to be made
43#ifdef CONFIG_SMP
44#ifdef CONFIG_PREEMPT /* FIXME */
45 mov epsw,d2
46 and ~EPSW_IE,epsw
47#endif
48 mov (CPUID),a0
49 add a0,a0
50 add a0,a0
51 mov (___frame,a0),a1
52 mov a1,(REG_NEXT,fp)
53 mov fp,(___frame,a0)
54#ifdef CONFIG_PREEMPT /* FIXME */
55 mov d2,epsw
56#endif
57#else /* CONFIG_SMP */
58 mov (__frame),a1
59 mov a1,(REG_NEXT,fp)
60 mov fp,(__frame)
61#endif /* CONFIG_SMP */
62 41
63 and ~EPSW_FE,epsw # disable the FPU inside the kernel42 # push the exception frame onto the front of the list
43 GET_THREAD_INFO a1
44 mov (TI_frame,a1),a0
45 mov a0,(REG_NEXT,fp)
46 mov fp,(TI_frame,a1)
47
48 # disable the FPU inside the kernel
49 and ~EPSW_FE,epsw
64 50
65 # we may be holding current in E251 # we may be holding current in E2
66#ifdef CONFIG_MN10300_CURRENT_IN_E252#ifdef CONFIG_MN10300_CURRENT_IN_E2
@@ -76,27 +62,11 @@ · 9 unmodified lines
76.macro RESTORE_ALL62.macro RESTORE_ALL
77 # peel back the stack to the calling frame63 # peel back the stack to the calling frame
78 # - this permits execve() to discard extra frames due to kernel syscalls64 # - this permits execve() to discard extra frames due to kernel syscalls
79#ifdef CONFIG_SMP65 GET_THREAD_INFO a0
80#ifdef CONFIG_PREEMPT /* FIXME */66 mov (TI_frame,a0),fp
81 mov epsw,d2
82 and ~EPSW_IE,epsw
83#endif
84 mov (CPUID),a0
85 add a0,a0
86 add a0,a0
87 mov (___frame,a0),fp
88 mov fp,sp
89 mov (REG_NEXT,fp),d0 # userspace has regs->next == 0
90 mov d0,(___frame,a0)
91#ifdef CONFIG_PREEMPT /* FIXME */
92 mov d2,epsw
93#endif
94#else /* CONFIG_SMP */
95 mov (__frame),fp
96 mov fp,sp67 mov fp,sp
97 mov (REG_NEXT,fp),d0 # userspace has regs->next == 068 mov (REG_NEXT,fp),d0
98 mov d0,(__frame)69 mov d0,(TI_frame,a0) # userspace has regs->next == 0
99#endif /* CONFIG_SMP */
100 70
101#ifndef CONFIG_MN10300_USING_JTAG71#ifndef CONFIG_MN10300_USING_JTAG
102 mov (REG_EPSW,fp),d072 mov (REG_EPSW,fp),d0
arch/mn10300/include/asm/irq_regs.h+5−1
@@ -18,7 +18,11 @@ · 17 unmodified lines
18#define ARCH_HAS_OWN_IRQ_REGS18#define ARCH_HAS_OWN_IRQ_REGS
19 19
20#ifndef __ASSEMBLY__20#ifndef __ASSEMBLY__
21#define get_irq_regs() (__frame)21static inline __attribute__((const))
22struct pt_regs *get_irq_regs(void)
23{
24 return current_frame();
25}
22#endif26#endif
23 27
24#endif /* _ASM_IRQ_REGS_H */28#endif /* _ASM_IRQ_REGS_H */
arch/mn10300/include/asm/pgalloc.h+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
11#ifndef _ASM_PGALLOC_H11#ifndef _ASM_PGALLOC_H
12#define _ASM_PGALLOC_H12#define _ASM_PGALLOC_H
13 13
14#include <asm/processor.h>
15#include <asm/page.h>14#include <asm/page.h>
16#include <linux/threads.h>15#include <linux/threads.h>
17#include <linux/mm.h> /* for struct page */16#include <linux/mm.h> /* for struct page */
arch/mn10300/include/asm/processor.h+18−28
@@ -13,10 +13,13 @@ · 12 unmodified lines
13#ifndef _ASM_PROCESSOR_H13#ifndef _ASM_PROCESSOR_H
14#define _ASM_PROCESSOR_H14#define _ASM_PROCESSOR_H
15 15
16#include <linux/threads.h>
17#include <linux/thread_info.h>
16#include <asm/page.h>18#include <asm/page.h>
17#include <asm/ptrace.h>19#include <asm/ptrace.h>
18#include <asm/cpu-regs.h>20#include <asm/cpu-regs.h>
19#include <linux/threads.h>21#include <asm/uaccess.h>
22#include <asm/current.h>
20 23
21/* Forward declaration, a strange C thing */24/* Forward declaration, a strange C thing */
22struct task_struct;25struct task_struct;
@@ -83,10 +86,6 @@ extern void dodgy_tsc(void); · 60 unmodified lines
83 */86 */
84#define TASK_UNMAPPED_BASE 0x3000000087#define TASK_UNMAPPED_BASE 0x30000000
85 88
86typedef struct {
87 unsigned long seg;
88} mm_segment_t;
89
90struct fpu_state_struct {89struct fpu_state_struct {
91 unsigned long fs[32]; /* fpu registers */90 unsigned long fs[32]; /* fpu registers */
92 unsigned long fpcr; /* fpu control register */91 unsigned long fpcr; /* fpu control register */
@@ -99,7 +98,6 @@ struct thread_struct { · 6 unmodified lines
99 unsigned long a3; /* kernel FP */98 unsigned long a3; /* kernel FP */
100 unsigned long wchan;99 unsigned long wchan;
101 unsigned long usp;100 unsigned long usp;
102 struct pt_regs *frame;
103 unsigned long fpu_flags;101 unsigned long fpu_flags;
104#define THREAD_USING_FPU 0x00000001 /* T if this task is using the FPU */102#define THREAD_USING_FPU 0x00000001 /* T if this task is using the FPU */
105#define THREAD_HAS_FPU 0x00000002 /* T if this task owns the FPU right now */103#define THREAD_HAS_FPU 0x00000002 /* T if this task owns the FPU right now */
@@ -113,7 +111,6 @@ struct thread_struct { · 7 unmodified lines
113 .sp = 0, \111 .sp = 0, \
114 .a3 = 0, \112 .a3 = 0, \
115 .wchan = 0, \113 .wchan = 0, \
116 .frame = NULL, \
117}114}
118 115
119#define INIT_MMAP \116#define INIT_MMAP \
@@ -125,27 +122,20 @@ struct thread_struct { · 5 unmodified lines
125 * - need to discard the frame stacked by the kernel thread invoking the execve122 * - need to discard the frame stacked by the kernel thread invoking the execve
126 * syscall (see RESTORE_ALL macro)123 * syscall (see RESTORE_ALL macro)
127 */124 */
128#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) /* FIXME */125static inline void start_thread(struct pt_regs *regs,
129#define start_thread(regs, new_pc, new_sp) do { \126 unsigned long new_pc, unsigned long new_sp)
130 int cpu; \127{
131 preempt_disable(); \128 struct thread_info *ti = current_thread_info();
132 cpu = CPUID; \129 struct pt_regs *frame0;
133 set_fs(USER_DS); \130 set_fs(USER_DS);
134 ___frame[cpu] = current->thread.uregs; \131
135 ___frame[cpu]->epsw = EPSW_nSL | EPSW_IE | EPSW_IM;\132 frame0 = thread_info_to_uregs(ti);
136 ___frame[cpu]->pc = new_pc; \133 frame0->epsw = EPSW_nSL | EPSW_IE | EPSW_IM;
137 ___frame[cpu]->sp = new_sp; \134 frame0->pc = new_pc;
138 preempt_enable(); \135 frame0->sp = new_sp;
139} while (0)136 ti->frame = frame0;
140#else /* CONFIG_SMP && CONFIG_PREEMPT */137}
141#define start_thread(regs, new_pc, new_sp) do { \138
142 set_fs(USER_DS); \
143 __frame = current->thread.uregs; \
144 __frame->epsw = EPSW_nSL | EPSW_IE | EPSW_IM; \
145 __frame->pc = new_pc; \
146 __frame->sp = new_sp; \
147} while (0)
148#endif /* CONFIG_SMP && CONFIG_PREEMPT */
149 139
150/* Free all resources held by a thread. */140/* Free all resources held by a thread. */
151extern void release_thread(struct task_struct *);141extern void release_thread(struct task_struct *);
arch/mn10300/include/asm/ptrace.h+0−6
@@ -86,12 +86,6 @@ struct pt_regs { · 85 unmodified lines
86 86
87#ifdef __KERNEL__87#ifdef __KERNEL__
88 88
89#ifdef CONFIG_SMP
90extern struct pt_regs *___frame[]; /* current frame pointer */
91#else
92extern struct pt_regs *__frame; /* current frame pointer */
93#endif
94
95#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL)89#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL)
96#define instruction_pointer(regs) ((regs)->pc)90#define instruction_pointer(regs) ((regs)->pc)
97#define user_stack_pointer(regs) ((regs)->sp)91#define user_stack_pointer(regs) ((regs)->sp)
arch/mn10300/include/asm/smp.h+0−13
@@ -93,19 +93,6 @@ extern int __cpu_disable(void); · 92 unmodified lines
93extern void __cpu_die(unsigned int cpu);93extern void __cpu_die(unsigned int cpu);
94#endif /* CONFIG_HOTPLUG_CPU */94#endif /* CONFIG_HOTPLUG_CPU */
95 95
96#ifdef CONFIG_PREEMPT /* FIXME */
97#define __frame \
98 ({ \
99 struct pt_regs *f; \
100 preempt_disable(); \
101 f = ___frame[CPUID]; \
102 preempt_enable(); \
103 f; \
104 })
105#else
106#define __frame ___frame[CPUID]
107#endif
108
109#endif /* __ASSEMBLY__ */96#endif /* __ASSEMBLY__ */
110#else /* CONFIG_SMP */97#else /* CONFIG_SMP */
111#ifndef __ASSEMBLY__98#ifndef __ASSEMBLY__
arch/mn10300/include/asm/thread_info.h+14−4
@@ -16,10 +16,6 @@ · 15 unmodified lines
16 16
17#include <asm/page.h>17#include <asm/page.h>
18 18
19#ifndef __ASSEMBLY__
20#include <asm/processor.h>
21#endif
22
23#define PREEMPT_ACTIVE 0x1000000019#define PREEMPT_ACTIVE 0x10000000
24 20
25#ifdef CONFIG_4KSTACKS21#ifdef CONFIG_4KSTACKS
@@ -38,10 +34,14 @@ · 12 unmodified lines
38 * must also be changed34 * must also be changed
39 */35 */
40#ifndef __ASSEMBLY__36#ifndef __ASSEMBLY__
37typedef struct {
38 unsigned long seg;
39} mm_segment_t;
41 40
42struct thread_info {41struct thread_info {
43 struct task_struct *task; /* main task structure */42 struct task_struct *task; /* main task structure */
44 struct exec_domain *exec_domain; /* execution domain */43 struct exec_domain *exec_domain; /* execution domain */
44 struct pt_regs *frame; /* current exception frame */
45 unsigned long flags; /* low level flags */45 unsigned long flags; /* low level flags */
46 __u32 cpu; /* current CPU */46 __u32 cpu; /* current CPU */
47 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */47 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -55,6 +55,10 @@ struct thread_info { · 7 unmodified lines
55 __u8 supervisor_stack[0];55 __u8 supervisor_stack[0];
56};56};
57 57
58#define thread_info_to_uregs(ti) \
59 ((struct pt_regs *) \
60 ((unsigned long)ti + THREAD_SIZE - sizeof(struct pt_regs)))
61
58#else /* !__ASSEMBLY__ */62#else /* !__ASSEMBLY__ */
59 63
60#ifndef __ASM_OFFSETS_H__64#ifndef __ASM_OFFSETS_H__
@@ -102,6 +106,12 @@ struct thread_info *current_thread_info(void) · 41 unmodified lines
102 return ti;106 return ti;
103}107}
104 108
109static inline __attribute__((const))
110struct pt_regs *current_frame(void)
111{
112 return current_thread_info()->frame;
113}
114
105/* how to get the current stack pointer from C */115/* how to get the current stack pointer from C */
106static inline unsigned long current_stack_pointer(void)116static inline unsigned long current_stack_pointer(void)
107{117{
arch/mn10300/include/asm/uaccess.h+1−3
@@ -14,9 +14,8 @@ · 13 unmodified lines
14/*14/*
15 * User space memory access functions15 * User space memory access functions
16 */16 */
17#include <linux/sched.h>17#include <linux/thread_info.h>
18#include <asm/page.h>18#include <asm/page.h>
19#include <asm/pgtable.h>
20#include <asm/errno.h>19#include <asm/errno.h>
21 20
22#define VERIFY_READ 021#define VERIFY_READ 0
@@ -29,7 +28,6 @@ · 6 unmodified lines
29 *28 *
30 * For historical reasons, these macros are grossly misnamed.29 * For historical reasons, these macros are grossly misnamed.
31 */30 */
32
33#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })31#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
34 32
35#define KERNEL_XDS MAKE_MM_SEG(0xBFFFFFFF)33#define KERNEL_XDS MAKE_MM_SEG(0xBFFFFFFF)
arch/mn10300/kernel/asm-offsets.c+1−1
@@ -23,6 +23,7 @@ void foo(void) · 22 unmodified lines
23 23
24 OFFSET(TI_task, thread_info, task);24 OFFSET(TI_task, thread_info, task);
25 OFFSET(TI_exec_domain, thread_info, exec_domain);25 OFFSET(TI_exec_domain, thread_info, exec_domain);
26 OFFSET(TI_frame, thread_info, frame);
26 OFFSET(TI_flags, thread_info, flags);27 OFFSET(TI_flags, thread_info, flags);
27 OFFSET(TI_cpu, thread_info, cpu);28 OFFSET(TI_cpu, thread_info, cpu);
28 OFFSET(TI_preempt_count, thread_info, preempt_count);29 OFFSET(TI_preempt_count, thread_info, preempt_count);
@@ -66,7 +67,6 @@ void foo(void) · 37 unmodified lines
66 OFFSET(THREAD_SP, thread_struct, sp);67 OFFSET(THREAD_SP, thread_struct, sp);
67 OFFSET(THREAD_A3, thread_struct, a3);68 OFFSET(THREAD_A3, thread_struct, a3);
68 OFFSET(THREAD_USP, thread_struct, usp);69 OFFSET(THREAD_USP, thread_struct, usp);
69 OFFSET(THREAD_FRAME, thread_struct, frame);
70#ifdef CONFIG_FPU70#ifdef CONFIG_FPU
71 OFFSET(THREAD_FPU_FLAGS, thread_struct, fpu_flags);71 OFFSET(THREAD_FPU_FLAGS, thread_struct, fpu_flags);
72 OFFSET(THREAD_FPU_STATE, thread_struct, fpu_state);72 OFFSET(THREAD_FPU_STATE, thread_struct, fpu_state);
arch/mn10300/kernel/mn10300-watchdog.c+1−1
@@ -122,7 +122,7 @@ void __init watchdog_go(void) · 121 unmodified lines
122static void watchdog_dump_register(void *dummy)122static void watchdog_dump_register(void *dummy)
123{123{
124 printk(KERN_ERR "--- Register Dump (CPU%d) ---\n", CPUID);124 printk(KERN_ERR "--- Register Dump (CPU%d) ---\n", CPUID);
125 show_registers(__frame);125 show_registers(current_frame());
126}126}
127#endif127#endif
128 128
arch/mn10300/kernel/process.c+11−9
@@ -228,6 +228,7 @@ int copy_thread(unsigned long clone_flags, · 227 unmodified lines
228 unsigned long c_usp, unsigned long ustk_size,228 unsigned long c_usp, unsigned long ustk_size,
229 struct task_struct *p, struct pt_regs *kregs)229 struct task_struct *p, struct pt_regs *kregs)
230{230{
231 struct thread_info *ti = task_thread_info(p);
231 struct pt_regs *c_uregs, *c_kregs, *uregs;232 struct pt_regs *c_uregs, *c_kregs, *uregs;
232 unsigned long c_ksp;233 unsigned long c_ksp;
233 234
@@ -248,7 +249,7 @@ int copy_thread(unsigned long clone_flags, · 14 unmodified lines
248 249
249 /* the new TLS pointer is passed in as arg #5 to sys_clone() */250 /* the new TLS pointer is passed in as arg #5 to sys_clone() */
250 if (clone_flags & CLONE_SETTLS)251 if (clone_flags & CLONE_SETTLS)
251 c_uregs->e2 = __frame->d3;252 c_uregs->e2 = current_frame()->d3;
252 253
253 /* set up the return kernel frame if called from kernel_thread() */254 /* set up the return kernel frame if called from kernel_thread() */
254 c_kregs = c_uregs;255 c_kregs = c_uregs;
@@ -266,7 +267,7 @@ int copy_thread(unsigned long clone_flags, · 11 unmodified lines
266 }267 }
267 268
268 /* set up things up so the scheduler can start the new task */269 /* set up things up so the scheduler can start the new task */
269 p->thread.frame = c_kregs;270 ti->frame = c_kregs;
270 p->thread.a3 = (unsigned long) c_kregs;271 p->thread.a3 = (unsigned long) c_kregs;
271 p->thread.sp = c_ksp;272 p->thread.sp = c_ksp;
272 p->thread.pc = (unsigned long) ret_from_fork;273 p->thread.pc = (unsigned long) ret_from_fork;
@@ -278,25 +279,26 @@ int copy_thread(unsigned long clone_flags, · 5 unmodified lines
278 279
279/*280/*
280 * clone a process281 * clone a process
281 * - tlsptr is retrieved by copy_thread() from __frame->d3282 * - tlsptr is retrieved by copy_thread() from current_frame()->d3
282 */283 */
283asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,284asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
284 int __user *parent_tidptr, int __user *child_tidptr,285 int __user *parent_tidptr, int __user *child_tidptr,
285 int __user *tlsptr)286 int __user *tlsptr)
286{287{
287 return do_fork(clone_flags, newsp ?: __frame->sp, __frame, 0,288 return do_fork(clone_flags, newsp ?: current_frame()->sp,
288 parent_tidptr, child_tidptr);289 current_frame(), 0, parent_tidptr, child_tidptr);
289}290}
290 291
291asmlinkage long sys_fork(void)292asmlinkage long sys_fork(void)
292{293{
293 return do_fork(SIGCHLD, __frame->sp, __frame, 0, NULL, NULL);294 return do_fork(SIGCHLD, current_frame()->sp,
295 current_frame(), 0, NULL, NULL);
294}296}
295 297
296asmlinkage long sys_vfork(void)298asmlinkage long sys_vfork(void)
297{299{
298 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, __frame->sp, __frame,300 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, current_frame()->sp,
299 0, NULL, NULL);301 current_frame(), 0, NULL, NULL);
300}302}
301 303
302asmlinkage long sys_execve(const char __user *name,304asmlinkage long sys_execve(const char __user *name,
@@ -310,7 +312,7 @@ asmlinkage long sys_execve(const char __user *name, · 7 unmodified lines
310 error = PTR_ERR(filename);312 error = PTR_ERR(filename);
311 if (IS_ERR(filename))313 if (IS_ERR(filename))
312 return error;314 return error;
313 error = do_execve(filename, argv, envp, __frame);315 error = do_execve(filename, argv, envp, current_frame());
314 putname(filename);316 putname(filename);
315 return error;317 return error;
316}318}
arch/mn10300/kernel/signal.c+11−9
@@ -91,7 +91,7 @@ asmlinkage long sys_sigaction(int sig, · 90 unmodified lines
91 */91 */
92asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss)92asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss)
93{93{
94 return do_sigaltstack(uss, uoss, __frame->sp);94 return do_sigaltstack(uss, uoss, current_frame()->sp);
95}95}
96 96
97/*97/*
@@ -156,10 +156,11 @@ badframe: · 58 unmodified lines
156 */156 */
157asmlinkage long sys_sigreturn(void)157asmlinkage long sys_sigreturn(void)
158{158{
159 struct sigframe __user *frame = (struct sigframe __user *) __frame->sp;159 struct sigframe __user *frame;
160 sigset_t set;160 sigset_t set;
161 long d0;161 long d0;
162 162
163 frame = (struct sigframe __user *) current_frame()->sp;
163 if (verify_area(VERIFY_READ, frame, sizeof(*frame)))164 if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
164 goto badframe;165 goto badframe;
165 if (__get_user(set.sig[0], &frame->sc.oldmask))166 if (__get_user(set.sig[0], &frame->sc.oldmask))
@@ -176,7 +177,7 @@ asmlinkage long sys_sigreturn(void) · 10 unmodified lines
176 recalc_sigpending();177 recalc_sigpending();
177 spin_unlock_irq(&current->sighand->siglock);178 spin_unlock_irq(&current->sighand->siglock);
178 179
179 if (restore_sigcontext(__frame, &frame->sc, &d0))180 if (restore_sigcontext(current_frame(), &frame->sc, &d0))
180 goto badframe;181 goto badframe;
181 182
182 return d0;183 return d0;
@@ -191,11 +192,11 @@ badframe: · 8 unmodified lines
191 */192 */
192asmlinkage long sys_rt_sigreturn(void)193asmlinkage long sys_rt_sigreturn(void)
193{194{
194 struct rt_sigframe __user *frame =195 struct rt_sigframe __user *frame;
195 (struct rt_sigframe __user *) __frame->sp;
196 sigset_t set;196 sigset_t set;
197 unsigned long d0;197 long d0;
198 198
199 frame = (struct rt_sigframe __user *) current_frame()->sp;
199 if (verify_area(VERIFY_READ, frame, sizeof(*frame)))200 if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
200 goto badframe;201 goto badframe;
201 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))202 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
@@ -207,10 +208,11 @@ asmlinkage long sys_rt_sigreturn(void) · 5 unmodified lines
207 recalc_sigpending();208 recalc_sigpending();
208 spin_unlock_irq(&current->sighand->siglock);209 spin_unlock_irq(&current->sighand->siglock);
209 210
210 if (restore_sigcontext(__frame, &frame->uc.uc_mcontext, &d0))211 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0))
211 goto badframe;212 goto badframe;
212 213
213 if (do_sigaltstack(&frame->uc.uc_stack, NULL, __frame->sp) == -EFAULT)214 if (do_sigaltstack(&frame->uc.uc_stack, NULL, current_frame()->sp) ==
215 -EFAULT)
214 goto badframe;216 goto badframe;
215 217
216 return d0;218 return d0;
@@ -572,7 +574,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags) · 355 unmodified lines
572 574
573 if (thread_info_flags & _TIF_NOTIFY_RESUME) {575 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
574 clear_thread_flag(TIF_NOTIFY_RESUME);576 clear_thread_flag(TIF_NOTIFY_RESUME);
575 tracehook_notify_resume(__frame);577 tracehook_notify_resume(current_frame());
576 if (current->replacement_session_keyring)578 if (current->replacement_session_keyring)
577 key_replace_session_keyring();579 key_replace_session_keyring();
578 }580 }
arch/mn10300/kernel/switch_to.S+0−18
@@ -38,15 +38,6 @@ ENTRY(__switch_to) · 37 unmodified lines
38 mov d1,a138 mov d1,a1
39 39
40 # save prev context40 # save prev context
41#ifdef CONFIG_SMP
42 mov (CPUID),a2
43 add a2,a2
44 add a2,a2
45 mov (___frame,a2),d0
46#else /* CONFIG_SMP */
47 mov (__frame),d0
48#endif /* CONFIG_SMP */
49 mov d0,(THREAD_FRAME,a0)
50 mov __switch_back,d041 mov __switch_back,d0
51 mov d0,(THREAD_PC,a0)42 mov d0,(THREAD_PC,a0)
52 mov sp,a243 mov sp,a2
@@ -68,15 +59,6 @@ ENTRY(__switch_to) · 15 unmodified lines
68 mov a2,e259 mov a2,e2
69#endif60#endif
70 61
71 mov (THREAD_FRAME,a1),a2
72#ifdef CONFIG_SMP
73 mov (CPUID),a0
74 add a0,a0
75 add a0,a0
76 mov a2,(___frame,a0)
77#else /* CONFIG_SMP */
78 mov a2,(__frame)
79#endif /* CONFIG_SMP */
80 mov (THREAD_PC,a1),a262 mov (THREAD_PC,a1),a2
81 mov d2,d0 # for ret_from_fork63 mov d2,d0 # for ret_from_fork
82 mov d0,a0 # for __switch_to64 mov d0,a0 # for __switch_to
arch/mn10300/kernel/traps.c+0−8
@@ -45,14 +45,6 @@ · 44 unmodified lines
45#error "INTERRUPT_VECTOR_BASE not aligned to 16MiB boundary!"45#error "INTERRUPT_VECTOR_BASE not aligned to 16MiB boundary!"
46#endif46#endif
47 47
48#ifdef CONFIG_SMP
49struct pt_regs *___frame[NR_CPUS]; /* current frame pointer */
50EXPORT_SYMBOL(___frame);
51#else /* CONFIG_SMP */
52struct pt_regs *__frame; /* current frame pointer */
53EXPORT_SYMBOL(__frame);
54#endif /* CONFIG_SMP */
55
56int kstack_depth_to_print = 24;48int kstack_depth_to_print = 24;
57 49
58spinlock_t die_lock = __SPIN_LOCK_UNLOCKED(die_lock);50spinlock_t die_lock = __SPIN_LOCK_UNLOCKED(die_lock);
mm/maccess.c+1−1
@@ -1,9 +1,9 @@
1/*1/*
2 * Access kernel memory without faulting.2 * Access kernel memory without faulting.
3 */3 */
4#include <linux/uaccess.h>
5#include <linux/module.h>4#include <linux/module.h>
6#include <linux/mm.h>5#include <linux/mm.h>
6#include <linux/uaccess.h>
7 7
8/**8/**
9 * probe_kernel_read(): safely attempt to read from a location9 * probe_kernel_read(): safely attempt to read from a location

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t