aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/swp_emulate.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/swp_emulate.c')
-rw-r--r--arch/arm/kernel/swp_emulate.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c
index 5f452f8fde05..df745188f5de 100644
--- a/arch/arm/kernel/swp_emulate.c
+++ b/arch/arm/kernel/swp_emulate.c
@@ -25,6 +25,7 @@
25#include <linux/syscalls.h> 25#include <linux/syscalls.h>
26#include <linux/perf_event.h> 26#include <linux/perf_event.h>
27 27
28#include <asm/opcodes.h>
28#include <asm/traps.h> 29#include <asm/traps.h>
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
30 31
@@ -185,6 +186,21 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)
185 186
186 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc); 187 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);
187 188
189 res = arm_check_condition(instr, regs->ARM_cpsr);
190 switch (res) {
191 case ARM_OPCODE_CONDTEST_PASS:
192 break;
193 case ARM_OPCODE_CONDTEST_FAIL:
194 /* Condition failed - return to next instruction */
195 regs->ARM_pc += 4;
196 return 0;
197 case ARM_OPCODE_CONDTEST_UNCOND:
198 /* If unconditional encoding - not a SWP, undef */
199 return -EFAULT;
200 default:
201 return -EINVAL;
202 }
203
188 if (current->pid != previous_pid) { 204 if (current->pid != previous_pid) {
189 pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n", 205 pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",
190 current->comm, (unsigned long)current->pid); 206 current->comm, (unsigned long)current->pid);