protect CU1 bit manipulation from preempt
Subsystems (2)
PATCH 1/1 protect CU1 bit manipulation from preempt
The ptrace temporarily enable CP1 without fpu-ownership. These regions should be protected from preempt.
Signed-off-by Atsushi Nemoto <[email protected]>
arch/mips/kernel/ptrace.c +4 -0
@@ -126,10 +126,12 @@ int ptrace_getfpregs (struct task_struct__put_user (child->thread.fpu.hard.fcr31, data +64 ); +preempt_disable (); flags =read_c0_status ();__enable_fpu (); __asm__ __volatile__("cfc1\t%0,$0" :"=r" (tmp));write_c0_status (flags); +preempt_enable ();__put_user (tmp, data +65 ); }else {__put_user (child->thread.fpu.soft.fcr31, data +64 );
@@ -284,10 +286,12 @@ asmlinkage int sys_ptrace(long request,if (!cpu_has_fpu)break ; +preempt_disable (); flags =read_c0_status ();__enable_fpu (); __asm__ __volatile__("cfc1\t%0,$0" :"=r" (tmp));write_c0_status (flags); +preempt_enable ();break ; } case DSP_BASE ... DSP_BASE + 5: {
arch/mips/kernel/ptrace32.c +2 -0
@@ -191,10 +191,12 @@ asmlinkage int sys32_ptrace(int request,if (!cpu_has_fpu)break ; +preempt_disable (); flags =read_c0_status ();__enable_fpu (); __asm__ __volatile__("cfc1\t%0,$0" :"=r" (tmp));write_c0_status (flags); +preempt_enable ();break ; } case DSP_BASE ... DSP_BASE + 5:
Quoted 2 lines · Atsushi Nemoto
The ptrace temporarily enable CP1 without fpu-ownership. These regions should be protected from preempt.
Applied with quite some additions to take care of the MT ASE as well.
Ralf