From patchwork Wed Aug 22 14:29:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10878 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 59F5F23E56 for ; Wed, 22 Aug 2012 14:30:03 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 699D9A18D61 for ; Wed, 22 Aug 2012 14:29:51 +0000 (UTC) Received: by ghbg10 with SMTP id g10so713484ghb.11 for ; Wed, 22 Aug 2012 07:30:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=kQsH8MbLXt7m3VYgAtrImM+z75eyitb+kvmzDQPO6zk=; b=fuRPzbb5WTdzMnrOYtjRRbCJTD9ISK9/mY9wctYSkkg/GHdu08M4dMmrjeJJAbmLxu UbWgyvzH49+sXhPfmMyNwG5OA+hMunYtDsRjJ/87Um74w1Tmp1ZMUEA3a2ytHx1HXCwo IX8EoE2dLIydu+9Md6KYVN75aHIA4bLoaTU7JpabjuVlmmj1RIhlHwrAUQF+4YVGS+TD HMB8piGAd6fPwDWnilH+eMiYodTmyKs9j8iY60eL4El7mJR2e2885hiuRC/Hruzuayf4 wSJkK/DpG6TN+0MDcaEGZvAmi2Gz1DSzHKxE70mgEN4Kl3w/ITSeUbmPinGoidh1aZO/ GjMQ== Received: by 10.50.180.129 with SMTP id do1mr2376585igc.28.1345645801702; Wed, 22 Aug 2012 07:30:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp205463igc; Wed, 22 Aug 2012 07:30:00 -0700 (PDT) Received: by 10.204.136.216 with SMTP id s24mr6679102bkt.137.1345645800284; Wed, 22 Aug 2012 07:30:00 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.171]) by mx.google.com with ESMTP id ha18si2761341bkc.61.2012.08.22.07.29.59; Wed, 22 Aug 2012 07:30:00 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.171 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.171; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.171 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from localhost.localdomain (HSI-KBW-149-172-5-253.hsi13.kabel-badenwuerttemberg.de [149.172.5.253]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0M9AGP-1Swikg3f2b-00CQjm; Wed, 22 Aug 2012 16:29:56 +0200 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Jon Medhurst , Nicolas Pitre , Leif Lindholm Subject: [PATCH 4/4] ARM: kprobes: make more tests conditional Date: Wed, 22 Aug 2012 16:29:40 +0200 Message-Id: <1345645780-2749-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1345645780-2749-1-git-send-email-arnd@arndb.de> References: <1345645780-2749-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:fbNlxuXaJqi5u/VWf5ElycFhIdCCYJ9gHg9CMRg1nEy yOAtW2wAj+CGkQE8FHHLTZ9m4UtFMPENrFwb2Kt4CXkvr+/NLX mAywY7Jyc2EI7+mY19qRR4fHYR44qixg+ow5V7V3ljU0UTwhOI Ypfgpotp3Er6LbRqA+ms5MY9B9h+1xwMbukh7i/FHPwzTtQeEq GSr+9mnZzLz9xwNXG05aQdr/HE4jtuQMYR4jLNubVT4gpBsgif 5MpltKrvTMYuEbHl0Icaz5SIg3apZ/54fw+oEXogDrzJzshMmJ MOPjrhqfFCZNJjX6c/QXKm861aikImwKxv7TuMDNDg5NEeaSHV 66LFKXbPhCVyMD3BdFhDxqoPhXAkFWWCZnp6M/taWdER3qvowL 9AdlpZc56rz7w== X-Gm-Message-State: ALoCoQntfLzfEOuromvPX8bNnnoNxePErQeHlbBE+dzmn05rDt03t0K0ZzUKt4G5oQvKCD88BYLK The mls instruction is not available in ARMv6K or below, so we should make the test conditional on at least ARMv7. ldrex/strex are available in ARMv6K or ARMv7, which we can test by checking the CONFIG_CPU_32v6K symbol. Just testing for ARMv6 is not enough. /tmp/ccuMTZ8D.s: Assembler messages: /tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3' /tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10' /tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13' Signed-off-by: Arnd Bergmann Cc: Jon Medhurst Cc: Russell King Cc: Nicolas Pitre Cc: Leif Lindholm --- arch/arm/kernel/kprobes-test-arm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c index 38c1a3b..3e87ff7 100644 --- a/arch/arm/kernel/kprobes-test-arm.c +++ b/arch/arm/kernel/kprobes-test-arm.c @@ -367,9 +367,11 @@ void kprobe_arm_test_cases(void) TEST_UNSUPPORTED(".word 0xe0500090 @ undef") TEST_UNSUPPORTED(".word 0xe05fff9f @ undef") +#if __LINUX_ARM_ARCH__ >= 7 TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13") +#endif TEST_UNSUPPORTED(".word 0xe06f3291 @ mls pc, r1, r2, r3") TEST_UNSUPPORTED(".word 0xe060329f @ mls r0, pc, r2, r3") TEST_UNSUPPORTED(".word 0xe0603f91 @ mls r0, r1, pc, r3") @@ -454,7 +456,7 @@ void kprobe_arm_test_cases(void) TEST_UNSUPPORTED(".word 0xe1500090") /* Unallocated space */ TEST_UNSUPPORTED(".word 0xe1600090") /* Unallocated space */ TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */ -#if __LINUX_ARM_ARCH__ >= 6 +#ifdef CONFIG_CPU_32v6K TEST_UNSUPPORTED("ldrex r2, [sp]") TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]") TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")