From patchwork Fri Nov 8 18:37:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3159291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5F28C045B for ; Fri, 8 Nov 2013 18:40:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD62620499 for ; Fri, 8 Nov 2013 18:40:22 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D4CD2049C for ; Fri, 8 Nov 2013 18:40:21 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VeqxH-0001at-Bt; Fri, 08 Nov 2013 18:38:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Veqwv-0002e3-86; Fri, 08 Nov 2013 18:38:29 +0000 Received: from 82-68-191-81.dsl.posilan.com ([82.68.191.81] helo=rainbowdash.ducie.codethink.co.uk) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Veqw9-0002Y1-NK for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2013 18:37:46 +0000 Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.80) (envelope-from ) id 1Veqvn-0005U9-K4; Fri, 08 Nov 2013 18:37:19 +0000 From: Ben Dooks To: linux-arm-kernel@lists.infradead.org, victor.kamensky@linaro.org, taras.kondratiuk@linaro.org Subject: [PATCH 7/9] ARM: kprobes-test: fix next_instruction() Date: Fri, 8 Nov 2013 18:37:10 +0000 Message-Id: <1383935832-20865-8-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1383935832-20865-1-git-send-email-ben.dooks@codethink.co.uk> References: <1383935832-20865-1-git-send-email-ben.dooks@codethink.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131108_133742_119090_071326C8 X-CRM114-Status: GOOD ( 10.20 ) X-Spam-Score: -0.3 (/) Cc: Ben Dooks X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Taras Kondratiuk Fix next_instruction() function to correctly swap the instruction loaded from memory. Signed-off-by: Taras Kondratiuk [ben.dooks@codethink.co.uk: edited commit message as item already fixed] Signed-off-by: Ben Dooks --- arch/arm/kernel/kprobes-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index d39cd2e..96e3dbc 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c @@ -1329,7 +1329,8 @@ static void test_case_failed(const char *message) static unsigned long next_instruction(unsigned long pc) { #ifdef CONFIG_THUMB2_KERNEL - if ((pc & 1) && !is_wide_instruction(*(u16 *)(pc - 1))) + if ((pc & 1) && + !is_wide_instruction(__mem_to_opcode_thumb16(*(u16 *)(pc - 1)))) return pc + 2; else #endif