diff options
author | Mischa Jonker <mjonker@synopsys.com> | 2013-09-26 09:44:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-18 10:45:45 -0400 |
commit | 5cd12e7776183668bd92a5f5fe102113d3bb599a (patch) | |
tree | 10fbc5aaa32e28dd60f2c98fac84c5f561406ace /arch/arc | |
parent | 8036c31c84117707d4132cd199d997d7ed41427c (diff) |
ARC: Handle zero-overhead-loop in unaligned access handler
commit c11eb222fd7d4db91196121dbf854178505d2751 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/kernel/unaligned.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index 4cd81633febd..116d3e09b5b5 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c | |||
@@ -233,6 +233,12 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, | |||
233 | regs->status32 &= ~STATUS_DE_MASK; | 233 | regs->status32 &= ~STATUS_DE_MASK; |
234 | } else { | 234 | } else { |
235 | regs->ret += state.instr_len; | 235 | regs->ret += state.instr_len; |
236 | |||
237 | /* handle zero-overhead-loop */ | ||
238 | if ((regs->ret == regs->lp_end) && (regs->lp_count)) { | ||
239 | regs->ret = regs->lp_start; | ||
240 | regs->lp_count--; | ||
241 | } | ||
236 | } | 242 | } |
237 | 243 | ||
238 | return 0; | 244 | return 0; |