From patchwork Thu Jul 25 21:08:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 2833681 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 808C3C0319 for ; Thu, 25 Jul 2013 21:10:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9964F2020C for ; Thu, 25 Jul 2013 21:10:48 +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 259BF20222 for ; Thu, 25 Jul 2013 21:10:47 +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 1V2Snd-0001wH-12; Thu, 25 Jul 2013 21:10:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2SnN-00060Q-DR; Thu, 25 Jul 2013 21:09:57 +0000 Received: from ducie-dc1.codethink.co.uk ([37.128.190.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2Smt-0005wj-LF for linux-arm-kernel@lists.infradead.org; Thu, 25 Jul 2013 21:09:29 +0000 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id BEC0E463F4B; Thu, 25 Jul 2013 22:09:08 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 85IgiLdJqsxT; Thu, 25 Jul 2013 22:09:04 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [192.168.24.134]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 260124645BC; Thu, 25 Jul 2013 22:09:01 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.80) (envelope-from ) id 1V2SmT-0002ns-3M; Thu, 25 Jul 2013 22:09:01 +0100 From: Ben Dooks To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text Date: Thu, 25 Jul 2013 22:08:57 +0100 Message-Id: <1374786537-10726-5-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1374786537-10726-1-git-send-email-ben.dooks@codethink.co.uk> References: <1374786537-10726-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-20130725_170927_986262_1ACA6044 X-CRM114-Status: GOOD ( 16.28 ) X-Spam-Score: -1.9 (-) Cc: Ben Dooks , Jon Medhurst 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 When testing the kprobes test code with BE8, there is either an issue with the linker or how the code is being built. The issue is with embedding the title text as the first part of the test. Change to placing a pointer to .rodata with the text title in it for the test which seems to stop the issue of the alignment of the data following it being changed arbitrarily by the linker. The proper thing to do here is to fix the linker, however this patch also makes the output much easier to read as there are no variable length data items here any more. CC: Jon Medhurst Signed-off-by: Ben Dooks --- arch/arm/kernel/kprobes-test.c | 12 +++++------- arch/arm/kernel/kprobes-test.h | 6 ++++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index 6cfa04d..a915ac3 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c @@ -111,9 +111,7 @@ * @ TESTCASE_START * bl __kprobes_test_case_start * @ start of inline data... - * .ascii "mov r0, r7" @ text title for test case - * .byte 0 - * .align 2 + * .word title_addr @ text title for test case * * @ TEST_ARG_REG * .byte ARG_TYPE_REG @@ -959,7 +957,7 @@ void __naked __kprobes_test_case_start(void) __asm__ __volatile__ ( "stmdb sp!, {r4-r11} \n\t" "sub sp, sp, #"__stringify(TEST_MEMORY_SIZE)"\n\t" - "bic r0, lr, #1 @ r0 = inline title string \n\t" + "bic r0, lr, #3 @ r0 = inline title block \n\t" "mov r1, sp \n\t" "bl kprobes_test_case_start \n\t" "bx r0 \n\t" @@ -1336,15 +1334,15 @@ static unsigned long next_instruction(unsigned long pc) return pc + 4; } -static uintptr_t __used kprobes_test_case_start(const char *title, void *stack) +static uintptr_t __used kprobes_test_case_start(const char **title, void *stack) { struct test_arg *args; struct test_arg_end *end_arg; unsigned long test_code; - args = (struct test_arg *)PTR_ALIGN(title + strlen(title) + 1, 4); + args = (struct test_arg *)(title + 1); - current_title = title; + current_title = *title; current_args = args; current_stack = stack; diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h index e28a869..a71db09 100644 --- a/arch/arm/kernel/kprobes-test.h +++ b/arch/arm/kernel/kprobes-test.h @@ -113,9 +113,11 @@ struct test_arg_end { "bl __kprobes_test_case_start \n\t" \ /* don't use .asciz here as 'title' may be */ \ /* multiple strings to be concatenated. */ \ - ".ascii "#title" \n\t" \ + ".pushsection .rodata \n\t" \ + "9999: .ascii "#title" \n\t" \ ".byte 0 \n\t" \ - ".align 2 \n\t" + ".popsection \n\t" \ + ".word 9999b \n\t" #define TEST_ARG_REG(reg, val) \ ".byte "__stringify(ARG_TYPE_REG)" \n\t" \