From patchwork Wed Mar 26 13:38:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27128 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 373ED20062 for ; Wed, 26 Mar 2014 13:40:52 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf3991550qac.8 for ; Wed, 26 Mar 2014 06:40:51 -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=TA80YBxTS5HC8jAuXTNuVMniTRaTMGJQJ2Oha/Sn3X8=; b=AXY0q4I35XBjK7p6NDPPT7PhBDNtM9ji1Ohjbl79v4sH1I8FVDRq9CfW4J0AMjo9Et ZjJEYKaag+kB6mC8FpCW31MJAjIdJHWH4l7P54WHwiu4xDNuQ7P+z+hM0f1//dRYosY+ mFWbyY8v6tFyEaXVf2rW1YSvBnZRJp86mUdFaJ0rWzYsQFT8yfB+qJsqdP/pcwx03ZZ0 9n/MyuFIA7Tq8PwH7DbfjfUSc+wWD0pOxtFLsKV8Zz2L9UUGlZh6+mblOUMbGCqoWlN7 3SUt0pnxLFdAUxaBCp6bx5f2knuDREeR4Cyu+WDVVLCH9hS0tOdy+CEGTLyT4v2Q9l4c Yttw== X-Gm-Message-State: ALoCoQlvvrvQaoyZmxYFtnKPFG7uXM5BB0iwbR6aVQgzEGT4NARRHHcRyFmqv96soN3K+mLC0cvA X-Received: by 10.58.228.201 with SMTP id sk9mr20867873vec.35.1395841251936; Wed, 26 Mar 2014 06:40:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.36 with SMTP id k33ls636108qgk.20.gmail; Wed, 26 Mar 2014 06:40:51 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr61282946vcb.16.1395841251819; Wed, 26 Mar 2014 06:40:51 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id sh5si4630533vdc.140.2014.03.26.06.40.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:40:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so2343959vcb.5 for ; Wed, 26 Mar 2014 06:40:51 -0700 (PDT) X-Received: by 10.220.162.196 with SMTP id w4mr73793vcx.58.1395841251732; Wed, 26 Mar 2014 06:40:51 -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 i9csp47136vck; Wed, 26 Mar 2014 06:40:51 -0700 (PDT) X-Received: by 10.224.29.4 with SMTP id o4mr68693894qac.55.1395841250945; Wed, 26 Mar 2014 06:40:50 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id h5si8808981qas.27.2014.03.26.06.40.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:40:50 -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 1WSo2l-0004P5-O1; Wed, 26 Mar 2014 13:38:59 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSo2i-0004LW-OZ for xen-devel@lists.xen.org; Wed, 26 Mar 2014 13:38:57 +0000 Received: from [85.158.137.68:2269] by server-1.bemta-3.messagelabs.com id 49/9F-11134-078D2335; Wed, 26 Mar 2014 13:38:56 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-2.tower-31.messagelabs.com!1395841128!1838933!3 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 22594 invoked from network); 26 Mar 2014 13:38:55 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 26 Mar 2014 13:38:55 -0000 X-IronPort-AV: E=Sophos;i="4.97,735,1389744000"; d="scan'208";a="113732829" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 26 Mar 2014 13:38:54 +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; Wed, 26 Mar 2014 09:38:53 -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 1WSo2f-00074X-5A; Wed, 26 Mar 2014 13:38:53 +0000 From: Ian Campbell To: Date: Wed, 26 Mar 2014 13:38:37 +0000 Message-ID: <1395841133-2223-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395841009.12547.11.camel@kazak.uk.xensource.com> References: <1395841009.12547.11.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 v2 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.174 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