MIPS: Make use of the ERETNC instruction on MIPS R6
The ERETNC instruction, introduced in MIPS R5, is similar to the ERET one, except it does not clear the LLB bit in the LLADDR register. This feature is necessary to safely emulate R2 LL/SC instructions. However, on context switches, we need to clear the LLAddr/LLB bit in order to make sure that an SC instruction from the new thread will never succeed if it happens to interrupt an LL operation on the same address from the previous thread. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
This commit is contained in:
@@ -1039,12 +1039,14 @@ asmlinkage void do_ri(struct pt_regs *regs)
|
||||
switch (status) {
|
||||
case 0:
|
||||
case SIGEMT:
|
||||
task_thread_info(current)->r2_emul_return = 1;
|
||||
return;
|
||||
case SIGILL:
|
||||
goto no_r2_instr;
|
||||
default:
|
||||
process_fpemu_return(status,
|
||||
¤t->thread.cp0_baduaddr);
|
||||
task_thread_info(current)->r2_emul_return = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user