Skip to content

Commit 9aed02f

Browse files
committed
ARC: [arcompact] handle unaligned access delay slot corner case
After emulating an unaligned access in delay slot of a branch, we pretend as the delay slot never happened - so return back to actual branch target (or next PC if branch was not taken). Curently we did this by handling STATUS32.DE, we also need to clear the BTA.T bit, which is disregarded when returning from original misaligned exception, but could cause weirdness if it took the interrupt return path (in case interrupt was acive too) One ARC700 customer ran into this when enabling unaligned access fixup for kernel mode accesses as well Cc: [email protected] Signed-off-by: Vineet Gupta <[email protected]>
1 parent 78f824d commit 9aed02f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arc/kernel/unaligned.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs,
241241
if (state.fault)
242242
goto fault;
243243

244+
/* clear any remanants of delay slot */
244245
if (delay_mode(regs)) {
245-
regs->ret = regs->bta;
246+
regs->ret = regs->bta ~1U;
246247
regs->status32 &= ~STATUS_DE_MASK;
247248
} else {
248249
regs->ret += state.instr_len;

0 commit comments

Comments
 (0)