Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751874Ab3I0K6Q (ORCPT ); Fri, 27 Sep 2013 06:58:16 -0400 Received: from us02smtp1.synopsys.com ([198.182.60.75]:65337 "EHLO vaxjo.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949Ab3I0K6O (ORCPT ); Fri, 27 Sep 2013 06:58:14 -0400 From: Vineet Gupta To: , CC: , , Noam Camus , Gilad Ben-Yossef , Mischa Jonker , Vineet Gupta Subject: [PATCH 1/4] ARC: Handle zero-overhead-loop in unaligned access handler Date: Fri, 27 Sep 2013 16:27:34 +0530 Message-ID: <1380279457-14299-2-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380279457-14299-1-git-send-email-vgupta@synopsys.com> References: <1380279457-14299-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.12.197.111] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1142 Lines: 38 From: 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 Signed-off-by: Vineet Gupta --- 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 28d1700..7ff5b5c 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c @@ -245,6 +245,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.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/