* [PATCH 1/2] ARC: Handle zero-overhead-loop in unaligned access handler
@ 2013-09-26 13:44 Mischa Jonker
2013-09-26 14:33 ` Vineet Gupta
0 siblings, 1 reply; 2+ messages in thread
From: Mischa Jonker @ 2013-09-26 13:44 UTC (permalink / raw)
To: Vineet.Gupta1, arnd, linux-kernel, arc-linux-dev; +Cc: Mischa Jonker
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>
---
arch/arc/kernel/unaligned.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
index c0f832f..00ad070 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,
regs->status32 &= ~STATUS_DE_MASK;
} else {
regs->ret += state.instr_len;
+
+ /* handle zero-overhead-loop */
+ if ((regs->ret == regs->lp_end) && (regs->lp_count)) {
+ regs->ret = regs->lp_start;
+ regs->lp_count--;
+ }
}
return 0;
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] ARC: Handle zero-overhead-loop in unaligned access handler
2013-09-26 13:44 [PATCH 1/2] ARC: Handle zero-overhead-loop in unaligned access handler Mischa Jonker
@ 2013-09-26 14:33 ` Vineet Gupta
0 siblings, 0 replies; 2+ messages in thread
From: Vineet Gupta @ 2013-09-26 14:33 UTC (permalink / raw)
To: Mischa Jonker, arnd, linux-kernel, arc-linux-dev
On 09/26/2013 07:34 PM, Mischa Jonker wrote:
> 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>
Applied to for-curr for 3.12-rcX
Thx,
-Vineet
> ---
> arch/arc/kernel/unaligned.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
> index c0f832f..00ad070 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,
> regs->status32 &= ~STATUS_DE_MASK;
> } else {
> regs->ret += state.instr_len;
> +
> + /* handle zero-overhead-loop */
> + if ((regs->ret == regs->lp_end) && (regs->lp_count)) {
> + regs->ret = regs->lp_start;
> + regs->lp_count--;
> + }
> }
>
> return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-26 14:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-26 13:44 [PATCH 1/2] ARC: Handle zero-overhead-loop in unaligned access handler Mischa Jonker
2013-09-26 14:33 ` Vineet Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®