Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARC: Handle zero-overhead-loop in unaligned access handler

If a load or store is the last instruction in a zero-overhead-loop, and
it's misaligned, the loop would execute only once.

This fixes that problem.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

authored by

Mischa Jonker and committed by
Vineet Gupta
c11eb222 4a10c2ac

+6
+6
arch/arc/kernel/unaligned.c
··· 245 245 regs->status32 &= ~STATUS_DE_MASK; 246 246 } else { 247 247 regs->ret += state.instr_len; 248 + 249 + /* handle zero-overhead-loop */ 250 + if ((regs->ret == regs->lp_end) && (regs->lp_count)) { 251 + regs->ret = regs->lp_start; 252 + regs->lp_count--; 253 + } 248 254 } 249 255 250 256 return 0;