From patchwork Mon Aug 22 15:56:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 1085882 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7MFvRHP016230 for ; Mon, 22 Aug 2011 15:57:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544Ab1HVP5X (ORCPT ); Mon, 22 Aug 2011 11:57:23 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:45563 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294Ab1HVP5W (ORCPT ); Mon, 22 Aug 2011 11:57:22 -0400 Received: from relmlir3.idc.renesas.com ([10.200.68.153]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0LQC00BRN6ZLKT60@relmlor3.idc.renesas.com> for linux-sh@vger.kernel.org; Tue, 23 Aug 2011 00:57:21 +0900 (JST) Received: from relmlac4.idc.renesas.com ([10.200.69.24]) by relmlir3.idc.renesas.com ( SJSMS) with ESMTP id <0LQC00MTM6ZLN240@relmlir3.idc.renesas.com> for linux-sh@vger.kernel.org; Tue, 23 Aug 2011 00:57:21 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 039B94807B; Tue, 23 Aug 2011 00:57:20 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id E773248070 for ; Tue, 23 Aug 2011 00:57:20 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id AAA10540; Tue, 23 Aug 2011 00:57:20 +0900 X-IronPort-AV: E=Sophos; i="4.68,263,1312124400"; d="scan'208"; a="41870230" Received: from unknown (HELO rte-idc-bh1.RTE.ADWIN.RENESAS.COM) ([172.28.64.243]) by relmlii1.idc.renesas.com with ESMTP; Tue, 23 Aug 2011 00:57:20 +0900 Received: from rte-ben-exch.RTE.ADWIN.RENESAS.COM ([172.29.42.16]) by rte-idc-bh1.RTE.ADWIN.RENESAS.COM with Microsoft SMTPSVC(6.0.3790.211) ; Mon, 22 Aug 2011 16:57:17 +0100 Received: from localhost.localdomain ([172.29.43.116]) by rte-ben-exch.RTE.ADWIN.RENESAS.COM with Microsoft SMTPSVC(6.0.3790.3959) ; Mon, 22 Aug 2011 16:57:16 +0100 From: Phil Edworthy To: linux-sh@vger.kernel.org Cc: Phil Edworthy Subject: [PATCH 1/2] sh: Fix unaligned memory access for branches without delay slots Date: Mon, 22 Aug 2011 16:56:08 +0100 Message-id: <1314028568-7571-1-git-send-email-phil.edworthy@renesas.com> X-Mailer: git-send-email 1.7.0.4 X-OriginalArrivalTime: 22 Aug 2011 15:57:16.0568 (UTC) FILETIME=[2A514180:01CC60E4] Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Aug 2011 15:57:35 +0000 (UTC) This patch just clears the return code for those cases where an unaligned memory access occurs on branch instructions without a delay slot. Signed-off-by: Phil Edworthy --- arch/sh/kernel/traps_32.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index d9006f8..61fa4a5 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c @@ -466,6 +466,7 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, case 0x0500: /* mov.w @(disp,Rm),R0 */ goto simple; case 0x0B00: /* bf lab - no delayslot*/ + ret = 0; break; case 0x0F00: /* bf/s lab */ ret = handle_delayslot(regs, instruction, ma); @@ -479,6 +480,7 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, } break; case 0x0900: /* bt lab - no delayslot */ + ret = 0; break; case 0x0D00: /* bt/s lab */ ret = handle_delayslot(regs, instruction, ma);