From patchwork Thu Mar 20 15:45:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 26723 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4052720143 for ; Thu, 20 Mar 2014 15:48:07 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lh14sf2478441vcb.2 for ; Thu, 20 Mar 2014 08:48:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=CzV9x8+QC6jOKM8lMbdVlAo3j+j6lTEYRiigVLv+r94=; b=EEJCenmyW5u0nrlN+0ZcO68mvnzdLx+FsNELA1xlxabO2iiznov5xpewEoDSwdJ+rF 9EyBxsy/+10Tv4YftmDi4dSfzPWQs5lM89UZD0OzGXuYh10X3W4E3FyAh8NMEMYfHPuQ cc+KCCoBxra1SNmi7yakC9WTdfQD4uac+B2+RO7502juvHIawhrqNYSFG5tIEgYcyPPz Z0DrStzRl/zV6wZhM5XeQR8zXAGkhAE1Ow0K/AErMXCfIAN/mhokodMjQeQmUviETK9i Q0pB1+tmHUHReIAYmTttj40vCjWxQ8cQmlD8X0cAdULtrAbC2tnfZcUrBwjOqHKPIudG +D4w== X-Gm-Message-State: ALoCoQmyC8Tcf4oyeCOdOBCamf5U2Q/UTn7FrqTENNyRTZQ5MAewzmJVVlfN9PSOAYamcTyC7cE3 X-Received: by 10.236.173.42 with SMTP id u30mr1149585yhl.2.1395330486813; Thu, 20 Mar 2014 08:48:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.11 with SMTP id g11ls294205qgg.11.gmail; Thu, 20 Mar 2014 08:48:06 -0700 (PDT) X-Received: by 10.58.57.42 with SMTP id f10mr34460733veq.1.1395330486696; Thu, 20 Mar 2014 08:48:06 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id sa10si519242vdc.157.2014.03.20.08.48.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:48:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id ks9so1159494vcb.41 for ; Thu, 20 Mar 2014 08:48:06 -0700 (PDT) X-Received: by 10.220.109.1 with SMTP id h1mr21502972vcp.20.1395330486599; Thu, 20 Mar 2014 08:48:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp398583vck; Thu, 20 Mar 2014 08:48:06 -0700 (PDT) X-Received: by 10.58.66.195 with SMTP id h3mr492225vet.57.1395330485366; Thu, 20 Mar 2014 08:48:05 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id tn6si507428vcb.75.2014.03.20.08.47.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:48:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfAc-0004BY-8r; Thu, 20 Mar 2014 15:46:14 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfAa-0004A5-SQ for xen-devel@lists.xen.org; Thu, 20 Mar 2014 15:46:13 +0000 Received: from [85.158.139.211:10957] by server-1.bemta-5.messagelabs.com id 0D/22-10259-44D0B235; Thu, 20 Mar 2014 15:46:12 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1395330369!2348168!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28188 invoked from network); 20 Mar 2014 15:46:11 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 20 Mar 2014 15:46:11 -0000 X-IronPort-AV: E=Sophos;i="4.97,695,1389744000"; d="scan'208";a="111935195" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 20 Mar 2014 15:46:08 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Thu, 20 Mar 2014 11:46:06 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WQfAT-0006O2-Px; Thu, 20 Mar 2014 15:46:05 +0000 From: Ian Campbell To: Date: Thu, 20 Mar 2014 15:45:50 +0000 Message-ID: <1395330365-9901-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395330336.3104.12.camel@kazak.uk.xensource.com> References: <1395330336.3104.12.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 02/17] xen: arm32: resync bitops with Linux v3.14-rc7 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This pulls in the following Linux commits: commit c36ef4b1762302a493c6cb754073bded084700e2 Author: Will Deacon Date: Wed Nov 23 11:28:25 2011 +0100 ARM: 7171/1: unwind: add unwind directives to bitops assembly macros The bitops functions (e.g. _test_and_set_bit) on ARM do not have unwind annotations and therefore the kernel cannot backtrace out of them on a fatal error (for example, NULL pointer dereference). This patch annotates the bitops assembly macros with UNWIND annotations so that we can produce a meaningful backtrace on error. Callers of the macros are modified to pass their function name as a macro parameter, enforcing that the macros are used as standalone function implementations. Acked-by: Dave Martin Signed-off-by: Will Deacon Signed-off-by: Russell King commit d779c07dd72098a7416d907494f958213b7726f3 Author: Will Deacon Date: Thu Jun 27 12:01:51 2013 +0100 ARM: bitops: prefetch the destination word for write prior to strex The cost of changing a cacheline from shared to exclusive state can be significant, especially when this is triggered by an exclusive store, since it may result in having to retry the transaction. This patch prefixes our atomic bitops implementation with prefetchw, to try and grab the line in exclusive state from the start. The testop macro is left alone, since the barrier semantics limit the usefulness of prefetching data. Acked-by: Nicolas Pitre Signed-off-by: Will Deacon commit b7ec699405f55667caeb46d96229d75bf33a83ad Author: Will Deacon Date: Tue Nov 19 15:46:11 2013 +0100 ARM: 7893/1: bitops: only emit .arch_extension mp if CONFIG_SMP Uwe reported a build failure when targetting a NOMMU platform with my recent prefetch changes: arch/arm/lib/changebit.S: Assembler messages: arch/arm/lib/changebit.S:15: Error: architectural extension `mp' is not allowed for the current base architecture This is due to use of the .arch_extension mp directive immediately prior to an ALT_SMP(...) instruction. Whilst the ALT_SMP macro will expand to nothing if !CONFIG_SMP, gas will still choke on the directive. This patch fixes the issue by only emitting the sequence (including the directive) if CONFIG_SMP=y. Tested-by: Uwe Kleine-König Signed-off-by: Will Deacon Signed-off-by: Russell King Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/arm32/lib/bitops.h | 17 +++++++++++++++-- xen/arch/arm/arm32/lib/changebit.S | 4 +--- xen/arch/arm/arm32/lib/clearbit.S | 4 +--- xen/arch/arm/arm32/lib/setbit.S | 4 +--- xen/arch/arm/arm32/lib/testchangebit.S | 4 +--- xen/arch/arm/arm32/lib/testclearbit.S | 4 +--- xen/arch/arm/arm32/lib/testsetbit.S | 4 +--- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/xen/arch/arm/arm32/lib/bitops.h b/xen/arch/arm/arm32/lib/bitops.h index 689f2e8..25784c3 100644 --- a/xen/arch/arm/arm32/lib/bitops.h +++ b/xen/arch/arm/arm32/lib/bitops.h @@ -1,13 +1,20 @@ #include #if __LINUX_ARM_ARCH__ >= 6 - .macro bitop, instr + .macro bitop, name, instr +ENTRY( \name ) +UNWIND( .fnstart ) ands ip, r1, #3 strneb r1, [ip] @ assert word-aligned mov r2, #1 and r3, r0, #31 @ Get bit offset mov r0, r0, lsr #5 add r1, r1, r0, lsl #2 @ Get word offset +#if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP) + .arch_extension mp + ALT_SMP(W(pldw) [r1]) + ALT_UP(W(nop)) +#endif mov r3, r2, lsl r3 1: ldrex r2, [r1] \instr r2, r2, r3 @@ -15,9 +22,13 @@ cmp r0, #0 bne 1b bx lr +UNWIND( .fnend ) +ENDPROC(\name ) .endm - .macro testop, instr, store + .macro testop, name, instr, store +ENTRY( \name ) +UNWIND( .fnstart ) ands ip, r1, #3 strneb r1, [ip] @ assert word-aligned mov r2, #1 @@ -36,6 +47,8 @@ cmp r0, #0 movne r0, #1 2: bx lr +UNWIND( .fnend ) +ENDPROC(\name ) .endm #else .macro bitop, name, instr diff --git a/xen/arch/arm/arm32/lib/changebit.S b/xen/arch/arm/arm32/lib/changebit.S index 62954bc..11f41d2 100644 --- a/xen/arch/arm/arm32/lib/changebit.S +++ b/xen/arch/arm/arm32/lib/changebit.S @@ -13,6 +13,4 @@ #include "bitops.h" .text -ENTRY(_change_bit) - bitop eor -ENDPROC(_change_bit) +bitop _change_bit, eor diff --git a/xen/arch/arm/arm32/lib/clearbit.S b/xen/arch/arm/arm32/lib/clearbit.S index 42ce416..1b6a569 100644 --- a/xen/arch/arm/arm32/lib/clearbit.S +++ b/xen/arch/arm/arm32/lib/clearbit.S @@ -14,6 +14,4 @@ #include "bitops.h" .text -ENTRY(_clear_bit) - bitop bic -ENDPROC(_clear_bit) +bitop _clear_bit, bic diff --git a/xen/arch/arm/arm32/lib/setbit.S b/xen/arch/arm/arm32/lib/setbit.S index c828851..1f4ef56 100644 --- a/xen/arch/arm/arm32/lib/setbit.S +++ b/xen/arch/arm/arm32/lib/setbit.S @@ -13,6 +13,4 @@ #include "bitops.h" .text -ENTRY(_set_bit) - bitop orr -ENDPROC(_set_bit) +bitop _set_bit, orr diff --git a/xen/arch/arm/arm32/lib/testchangebit.S b/xen/arch/arm/arm32/lib/testchangebit.S index a7f527c..7f4635c 100644 --- a/xen/arch/arm/arm32/lib/testchangebit.S +++ b/xen/arch/arm/arm32/lib/testchangebit.S @@ -13,6 +13,4 @@ #include "bitops.h" .text -ENTRY(_test_and_change_bit) - testop eor, str -ENDPROC(_test_and_change_bit) +testop _test_and_change_bit, eor, str diff --git a/xen/arch/arm/arm32/lib/testclearbit.S b/xen/arch/arm/arm32/lib/testclearbit.S index 8f39c72..4d4152f 100644 --- a/xen/arch/arm/arm32/lib/testclearbit.S +++ b/xen/arch/arm/arm32/lib/testclearbit.S @@ -13,6 +13,4 @@ #include "bitops.h" .text -ENTRY(_test_and_clear_bit) - testop bicne, strne -ENDPROC(_test_and_clear_bit) +testop _test_and_clear_bit, bicne, strne diff --git a/xen/arch/arm/arm32/lib/testsetbit.S b/xen/arch/arm/arm32/lib/testsetbit.S index 1b8d273..54f48f9 100644 --- a/xen/arch/arm/arm32/lib/testsetbit.S +++ b/xen/arch/arm/arm32/lib/testsetbit.S @@ -13,6 +13,4 @@ #include "bitops.h" .text -ENTRY(_test_and_set_bit) - testop orreq, streq -ENDPROC(_test_and_set_bit) +testop _test_and_set_bit, orreq, streq