Skip to content

Commit acb63c8

Browse files
vineetgarcgregkh
authored andcommitted
ARC: [arcompact] handle unaligned access delay slot corner case
commit 9aed02feae57bf7a40cb04ea0e3017cb7a998db4 upstream. 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 Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 42ad766 commit acb63c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)