From patchwork Wed Nov 7 09:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10672051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5068C1751 for ; Wed, 7 Nov 2018 09:40:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D8AA2B93F for ; Wed, 7 Nov 2018 09:40:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3165D2B945; Wed, 7 Nov 2018 09:40:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D2A252B93F for ; Wed, 7 Nov 2018 09:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=93AD4MMw8ytPPsMf1e1FMuaxHkaTzilL3m9i4YrvS3M=; b=XJqY9I2XHT3bclEtYmfzuM1hp9 HuBX6wQZE+YcnrHgxB4YK9/clTr/qplPWJ1lMN+ntokOtAkdG3Hqxkba2iPjCnKd2XM3RjUAIxhNv ksPNQ5TnnXHRBxKp1FFaeHHOF/CvMXjg4OoAEr+1EOPwJpR+KHRD1BCfC+BljwHVco1mUqWe5nkYg WivOw60ZlKMd6uKrVGaca8F/u1c6ORfyrI8yhhs3EkeNQeSu1gScmb08sBPHkv7WFgC3spLIuS6E9 GyQl5KrCpwJvOMqlMDvD3OLb6NANnqynp8fXzzk4W9vD8DfNE52dPv1iYzb3psbgZtSAYegnl6NU5 mcEjxolw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKH-0007lP-CK; Wed, 07 Nov 2018 09:40:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKA-0007l0-Lz for linux-arm-kernel@bombadil.infradead.org; Wed, 07 Nov 2018 09:40:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=P2dr0jVr4vldaQs8XWaDDGIJYGCEoiKeux/ppVfCW9M=; b=pdflrNlIBWBrOeG9JIfsuzvHC mgtxqlm2eNmFngLXT0LQJ9FTpJUIDJW0WM137ZROoG1SJq2E9gHyuHFU/YXuVbwEWHdVGBgCu6D1Y MlqKjHcWxqOsan1sVjGrOX3O+EuF0k/OSeUeCS812cLUSngZPuddB8CFrnPIbXcSjLgzeEl5wWHWW EZNDgZ2kHz+W/cjOGQovDXY9D6Mhe1nkyy7XRLqh8WaTq40tvO5xOiUJJUkeUh6Z0nzkfo+Omxqq4 c+S0dYtIwtVz7bwumGyt5CCQuNDtrsbm2ojZPGus2X8PuHZrpnFMx88/snBCV/LSzRTDIp0Zr08yP +ydPotZ3w==; Received: from foss.arm.com ([217.140.101.70]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKK7-0001xA-5v for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 09:40:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC0691596; Wed, 7 Nov 2018 01:40:20 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2B1CD3F718; Wed, 7 Nov 2018 01:40:19 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 1/4] kconfig: add as-instr macro to scripts/Kconfig.include Date: Wed, 7 Nov 2018 09:40:05 +0000 Message-Id: <1541583608-26375-2-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> References: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_094031_373655_9A758AE6 X-CRM114-Status: UNSURE ( 8.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kbuild@vger.kernel.org, Marc Zyngier , Ard Biesheuvel , Will Deacon , yamada.masahiro@socionext.com, kbuild-all@01.org, linux-crypto@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There are cases where the whole feature, for instance arm64/lse or arm/crypto, can depend on assembler. Current practice is to report buildtime that selected feature is not supported, which can be quite annoying... It'd nicer if we can check assembler first and opt-in feature visibility in Kconfig. Cc: Masahiro Yamada Cc: Will Deacon Cc: Marc Zyngier Cc: Ard Biesheuvel Signed-off-by: Vladimir Murzin --- scripts/Kconfig.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index dad5583..07c145c 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -22,6 +22,10 @@ success = $(if-success,$(1),y,n) # Return y if the compiler supports , n otherwise cc-option = $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null) +# $(as-instr,) +# Return y if the assembler supports , n otherwise +as-instr = $(success,printf "%b\n" "$(1)" | $(CC) -Werror -c -x assembler -o /dev/null -) + # $(ld-option,) # Return y if the linker supports , n otherwise ld-option = $(success,$(LD) -v $(1)) From patchwork Wed Nov 7 09:40:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10672059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8498109C for ; Wed, 7 Nov 2018 09:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C74332B936 for ; Wed, 7 Nov 2018 09:41:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB27B2B944; Wed, 7 Nov 2018 09:41:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 39D912B93F for ; Wed, 7 Nov 2018 09:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=y++myUW9pyQMMZZvB5LCfNiZxShPV6AN/9GL4jocWIU=; b=NWOsVHmNxuZQQxBY3eX+2G6otV 7Le+iqfAAPhQChZ9ZLBotwFX/EVZg7zmhIXVzWfz+hNGEs9HXXimlMMEZyd68ffb8u35cAVCBI8U7 WSHT0WDW+tMG1Rh0dTXovjTUknM1eM5RVIjVUZDAtX8SUdOJI+3VHfmWq71Wl/NLMwVv0py7sqf5a mMF5FL6A9jnqWKSY19bsQ3xl5ev03kzvwLuDsps4rB3ZW3mBhN8uIQEHkgVxn/262gwk6tuGMV9wv 9EyMpOV0NJAN4fLLzGJ9yIhrLz/5yWSlmMhXNHLiNeO5pqzeo6kTWtqYlmb/xiKD24kFy/Zpw8AVM CIFlv2lA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKv-0000Cc-OU; Wed, 07 Nov 2018 09:41:21 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKD-0007lJ-Jf for linux-arm-kernel@bombadil.infradead.org; Wed, 07 Nov 2018 09:40:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=B4f2RgVxEN3FhAkJ0lSvl6m+dNRFQ1U0KAtAKKvn7e8=; b=y04lJ4znZfeFLpqULT/+uqJlX lA0D6PsX42EhRVCE3XYQlApjIy4koNxD1rz7sPD65t6q21jg0H7Sty3y8fsJTEqtbdq1G5PKQ3We2 fVTCybs+jdtv5JTJ/M+/EPO+iOY1Ym+syyogMocviapzWZ6hOOIRXkSryYOW97Qa/C9ahmmmSEUwK q1GbBZ9YGdksV1lHipXDN89EDZErLZZ0Q3bYZh7W2Oj5fItfIA6SsdABl39vKnfuKGQ1gRLurEn7k xk+pw1BcevH2t5J2vZllnJ755xzXmyM8CZE0iIFqWvENTy0CR2llYxpLdtHuEQEdnXe/TeeUDbaF1 XNrR9XJSw==; Received: from foss.arm.com ([217.140.101.70]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKA-0003je-TV for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 09:40:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DF3715BE; Wed, 7 Nov 2018 01:40:22 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E7E753F718; Wed, 7 Nov 2018 01:40:20 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 2/4] arm64: lse: expose dependency on gas via Kconfig Date: Wed, 7 Nov 2018 09:40:06 +0000 Message-Id: <1541583608-26375-3-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> References: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_044035_098864_2585A2D3 X-CRM114-Status: GOOD ( 15.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yamada.masahiro@socionext.com, kbuild-all@01.org, Will Deacon , linux-crypto@vger.kernel.org, linux-kbuild@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP So we can simply hide LSE support if dependency is not satisfied. Cc: Will Deacon Signed-off-by: Vladimir Murzin --- arch/arm64/Kconfig | 1 + arch/arm64/Makefile | 13 ++----------- arch/arm64/include/asm/atomic.h | 2 +- arch/arm64/include/asm/lse.h | 6 +++--- arch/arm64/kernel/cpufeature.c | 4 ++-- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 964f682..7978aee 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1072,6 +1072,7 @@ config ARM64_PAN config ARM64_LSE_ATOMICS bool "Atomic instructions" default y + depends on $(as-instr,.arch_extension lse) help As part of the Large System Extensions, ARMv8.1 introduces new atomic instructions that are designed specifically to scale in diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index b4e994c..3054757 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -32,15 +32,6 @@ endif KBUILD_DEFCONFIG := defconfig -# Check for binutils support for specific extensions -lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1) - -ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y) - ifeq ($(lseinstr),) -$(warning LSE atomics not supported by binutils) - endif -endif - ifeq ($(CONFIG_ARM64), y) brokengasinst := $(call as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n,,-DCONFIG_BROKEN_GAS_INST=1) @@ -49,9 +40,9 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable) endif endif -KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) +KBUILD_CFLAGS += -mgeneral-regs-only $(brokengasinst) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) +KBUILD_AFLAGS += $(brokengasinst) KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) diff --git a/arch/arm64/include/asm/atomic.h b/arch/arm64/include/asm/atomic.h index 9bca54d..9d8d029 100644 --- a/arch/arm64/include/asm/atomic.h +++ b/arch/arm64/include/asm/atomic.h @@ -30,7 +30,7 @@ #define __ARM64_IN_ATOMIC_IMPL -#if defined(CONFIG_ARM64_LSE_ATOMICS) && defined(CONFIG_AS_LSE) +#ifdef CONFIG_ARM64_LSE_ATOMICS #include #else #include diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h index 8262325..1fd31c7 100644 --- a/arch/arm64/include/asm/lse.h +++ b/arch/arm64/include/asm/lse.h @@ -2,7 +2,7 @@ #ifndef __ASM_LSE_H #define __ASM_LSE_H -#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS) +#ifdef CONFIG_ARM64_LSE_ATOMICS #include #include @@ -36,7 +36,7 @@ ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS) #endif /* __ASSEMBLER__ */ -#else /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ +#else /* CONFIG_ARM64_LSE_ATOMICS */ #ifdef __ASSEMBLER__ @@ -53,5 +53,5 @@ #define ARM64_LSE_ATOMIC_INSN(llsc, lse) llsc #endif /* __ASSEMBLER__ */ -#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ +#endif /* CONFIG_ARM64_LSE_ATOMICS */ #endif /* __ASM_LSE_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 74e9dcb..46f1bac 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1170,7 +1170,7 @@ static void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused) .cpu_enable = cpu_enable_pan, }, #endif /* CONFIG_ARM64_PAN */ -#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS) +#ifdef CONFIG_ARM64_LSE_ATOMICS { .desc = "LSE atomic instructions", .capability = ARM64_HAS_LSE_ATOMICS, @@ -1181,7 +1181,7 @@ static void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused) .sign = FTR_UNSIGNED, .min_field_value = 2, }, -#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ +#endif /* CONFIG_ARM64_LSE_ATOMICS */ { .desc = "Software prefetching using PRFM", .capability = ARM64_HAS_NO_HW_PREFETCH, From patchwork Wed Nov 7 09:40:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10672053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB6A8109C for ; Wed, 7 Nov 2018 09:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAD312B944 for ; Wed, 7 Nov 2018 09:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE9302B946; Wed, 7 Nov 2018 09:40:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5B4F12B944 for ; Wed, 7 Nov 2018 09:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KwNmimL+9iE2CxNtrvq8zMIXd9lQ/NPmvkLYXeEd1Kk=; b=RQ5xc54M+Jsb9MtmXrneFBbR1B dxaXw5Y9XIyNG75iscIo2U/knqnRxtkJqd541exHHE9G71IkGM6tdpkCHb6pQGqR+J59N2aRxKq5c oLnzd9x4gASsdApZRBFmz2vUAcJLwJfC+GcGQMboObVI0cHQgfv/wh66Nm2p2vqD1+pwzQ3LEuG2/ FQDUZcPh+rPGOTUwBY6AOs/HaU6sscUBOrIkM5Aunj1FXntYgFqA7Wl1OtpOS7CdMeJ7+ZpaJL2dN YFDU4gsqz3Sd3VUvsr5MZPejXd0Peko5u8257Jn7o8Cv+Rmjklrnw8LetgqQ8wRLuVDRtT6ZAiW0Q 001HQ+iA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKN-0007rX-0i; Wed, 07 Nov 2018 09:40:47 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKA-0007kz-Lz for linux-arm-kernel@bombadil.infradead.org; Wed, 07 Nov 2018 09:40:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CaHb4EYjGVKYTE+K5ncdEbm3vQJaQ4pFRPV4YCht55s=; b=lSd3Ev6rOtrkTjp+/pnCqJdvT 3Qly/2dGh9VORSv5Wq1OphK0kEDSKqqwJvH+3qKxdwcXHgHYQu3NLd2b0RHIACDJXMImt8jO0tiP7 Lk+QSrgUhUFRuNPZHdfCJ2iw6yZTk++G8EiCqn83AOlrpgZQt60ZNK3KutSykUyoYw87f7f1UGo4K 03MIG80YgDwqIYyiLIAVZp/Xdn9df0vHXAurq6sYjxxk6/CqCSxCv0js+ejx+rUK/omSjnyq8kklx eM8fTxQzRDv6S5eNU1O/xUycUwQyLFimtJD21JxPwEMQjWtMViuN8NS6B+NFVyW/nUAWigsvDn43L bmtjlBjig==; Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKK7-0001xO-5z for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 09:40:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9B47B15BF; Wed, 7 Nov 2018 01:40:23 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6A0B13F718; Wed, 7 Nov 2018 01:40:22 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 3/4] arm64: turn "broken gas inst" into real config option Date: Wed, 7 Nov 2018 09:40:07 +0000 Message-Id: <1541583608-26375-4-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> References: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_094031_364630_E56AE60D X-CRM114-Status: UNSURE ( 8.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , yamada.masahiro@socionext.com, kbuild-all@01.org, linux-crypto@vger.kernel.org, linux-kbuild@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP So it is available everywhere and there is no need to keep CONFIG_ARM64 workaround ;) Cc: Marc Zyngier Signed-off-by: Vladimir Murzin --- arch/arm64/Kconfig | 3 +++ arch/arm64/Makefile | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7978aee..86fc357 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -287,6 +287,9 @@ config ARCH_SUPPORTS_UPROBES config ARCH_PROC_KCORE_TEXT def_bool y +config BROKEN_GAS_INST + def_bool y if !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n) + source "arch/arm64/Kconfig.platforms" menu "Bus support" diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 3054757..9860d3a 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -32,17 +32,12 @@ endif KBUILD_DEFCONFIG := defconfig -ifeq ($(CONFIG_ARM64), y) -brokengasinst := $(call as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n,,-DCONFIG_BROKEN_GAS_INST=1) - - ifneq ($(brokengasinst),) +ifeq ($(CONFIG_BROKEN_GAS_INST),y) $(warning Detected assembler with broken .inst; disassembly will be unreliable) - endif endif -KBUILD_CFLAGS += -mgeneral-regs-only $(brokengasinst) +KBUILD_CFLAGS += -mgeneral-regs-only KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -KBUILD_AFLAGS += $(brokengasinst) KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) From patchwork Wed Nov 7 09:40:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10672057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F8AA109C for ; Wed, 7 Nov 2018 09:41:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E9E32B936 for ; Wed, 7 Nov 2018 09:41:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82CF92B945; Wed, 7 Nov 2018 09:41:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED1832B944 for ; Wed, 7 Nov 2018 09:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CZA3WXtdTX/ojQ1B5LhrwMZGzcS8LZZT4YNMnGefLvg=; b=vA326Ip+kk4gxK4AQ0NLXU9bbw v+GgAbkLnyMLEygUy3voH8CWQ93ElhXC6UdhObjZh4RGO1v8bX+qqMWVC50hFBYJGVyRE5Ma3dU5p HBI8mAGWGqCJjJub1IwBwKCqlR/xy/o7vxYHQ0ti2mVOtlTvrloO8myNq4i+wnqTAFYrwJBejuZAM xd7CYA2YYdo01mrMqaVvrQ1sCe1oIPjCsQ1QfjaFWjllvBtFN66+G3xZhGR5RnisnvOJ+RwwG1Kek xpLISIdiccJAH90ve9DbkL1FXeEwoobCmk47b441WabnpDfh5nOgFgrtBIq2n+1Q4Ffm42RAke7fh AU/XH63g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKm-0008Qz-88; Wed, 07 Nov 2018 09:41:12 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKKC-0007lC-9v for linux-arm-kernel@bombadil.infradead.org; Wed, 07 Nov 2018 09:40:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eJIOoH06i6PuAKpEbuVFbxKCC50IHoJItp6tcq7cUjI=; b=ftJkp2e206fmla0oH7BKmF7ex 7ljJ6YnMG2bEcAmD6/ETT9hJZU4Cv4FkVUbo9TE1V6LEtMPpVe9ZJsqMwclmTynTZw8DeFsglkZ+f y5D6s9nf9cX/Dn5cBS65xEi76QwW5VUOyWhTlmQ4ZJuWCAeSC0cIWMz3+W1ngZSjXN1kFknXqAfJa 1FA2o3Oq97svEBNo2zUl8cl/s+46Fj4CqCRK1Nq+hyOTOViXoycAqSk5hJqe/ugGFYuPd8/nsliBp 2giG0geuRP80vQM8Y+5XCv4vO53KACumCq6cg3cKFi+oyAHccSACMsE63MwR8lgmbGRA5vzle4+dB S/7md+9lQ==; Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKKK7-0001xS-5w for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 09:40:34 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D65F1650; Wed, 7 Nov 2018 01:40:25 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D75C13F718; Wed, 7 Nov 2018 01:40:23 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 4/4] ARM: crypto: expose dependency on gas via Kconfig Date: Wed, 7 Nov 2018 09:40:08 +0000 Message-Id: <1541583608-26375-5-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> References: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_094031_543174_AA15F857 X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yamada.masahiro@socionext.com, kbuild-all@01.org, Ard Biesheuvel , linux-crypto@vger.kernel.org, linux-kbuild@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP So we can advertise only those entries which dependency is satisfied. Cc: Ard Biesheuvel Signed-off-by: Vladimir Murzin --- arch/arm/crypto/Kconfig | 31 +++++++++++++++++++++---------- arch/arm/crypto/Makefile | 31 ++++++------------------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index ef0c7fe..f437a91f 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -9,6 +9,12 @@ menuconfig ARM_CRYPTO if ARM_CRYPTO +config ARM_AS_HAS_CE + def_bool $(as-instr,.fpu crypto-neon-fp-armv8) + +config ARM_AS_HAS_CRC + def_bool $(as-instr,.arch armv8-a\n.arch_extension crc) + config CRYPTO_SHA1_ARM tristate "SHA1 digest algorithm (ARM-asm)" select CRYPTO_SHA1 @@ -30,21 +36,21 @@ config CRYPTO_SHA1_ARM_NEON config CRYPTO_SHA1_ARM_CE tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)" - depends on KERNEL_MODE_NEON + depends on KERNEL_MODE_NEON && ARM_AS_HAS_CE select CRYPTO_SHA1_ARM select CRYPTO_HASH help SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented - using special ARMv8 Crypto Extensions. + using special ARMv8 Crypto Extensions (need binutils 2.23 or higher). config CRYPTO_SHA2_ARM_CE tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)" - depends on KERNEL_MODE_NEON + depends on KERNEL_MODE_NEON && ARM_AS_HAS_CE select CRYPTO_SHA256_ARM select CRYPTO_HASH help SHA-256 secure hash standard (DFIPS 180-2) implemented - using special ARMv8 Crypto Extensions. + using special ARMv8 Crypto Extensions (need binutils 2.23 or higher). config CRYPTO_SHA256_ARM tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)" @@ -87,16 +93,16 @@ config CRYPTO_AES_ARM_BS config CRYPTO_AES_ARM_CE tristate "Accelerated AES using ARMv8 Crypto Extensions" - depends on KERNEL_MODE_NEON + depends on KERNEL_MODE_NEON && ARM_AS_HAS_CE select CRYPTO_BLKCIPHER select CRYPTO_SIMD help Use an implementation of AES in CBC, CTR and XTS modes that uses - ARMv8 Crypto Extensions + ARMv8 Crypto Extensions (need binutils 2.23 or higher) config CRYPTO_GHASH_ARM_CE tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions" - depends on KERNEL_MODE_NEON + depends on KERNEL_MODE_NEON && ARM_AS_HAS_CE select CRYPTO_HASH select CRYPTO_CRYPTD select CRYPTO_GF128MUL @@ -104,17 +110,22 @@ config CRYPTO_GHASH_ARM_CE Use an implementation of GHASH (used by the GCM AEAD chaining mode) that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64) that is part of the ARMv8 Crypto Extensions, or a slower variant that - uses the vmull.p8 instruction that is part of the basic NEON ISA. + uses the vmull.p8 instruction that is part of the basic NEON ISA (need + binutils 2.23 or higher). config CRYPTO_CRCT10DIF_ARM_CE tristate "CRCT10DIF digest algorithm using PMULL instructions" - depends on KERNEL_MODE_NEON && CRC_T10DIF + depends on KERNEL_MODE_NEON && CRC_T10DIF && ARM_AS_HAS_CE select CRYPTO_HASH + help + Need binutils 2.23 or higher config CRYPTO_CRC32_ARM_CE tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions" - depends on KERNEL_MODE_NEON && CRC32 + depends on KERNEL_MODE_NEON && CRC32 && ARM_AS_HAS_CRC select CRYPTO_HASH + help + Need binutils 2.23 or higher config CRYPTO_CHACHA20_NEON tristate "NEON accelerated ChaCha20 symmetric cipher" diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile index bd5bcee..e897327 100644 --- a/arch/arm/crypto/Makefile +++ b/arch/arm/crypto/Makefile @@ -11,32 +11,13 @@ obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o obj-$(CONFIG_CRYPTO_SHA512_ARM) += sha512-arm.o obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha20-neon.o -ce-obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o -ce-obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o -ce-obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o -ce-obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o -ce-obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o -crc-obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o +obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o +obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o +obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o +obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o +obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o -ifneq ($(crc-obj-y)$(crc-obj-m),) -ifeq ($(call as-instr,.arch armv8-a\n.arch_extension crc,y,n),y) -ce-obj-y += $(crc-obj-y) -ce-obj-m += $(crc-obj-m) -else -$(warning These CRC Extensions modules need binutils 2.23 or higher) -$(warning $(crc-obj-y) $(crc-obj-m)) -endif -endif - -ifneq ($(ce-obj-y)$(ce-obj-m),) -ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y) -obj-y += $(ce-obj-y) -obj-m += $(ce-obj-m) -else -$(warning These ARMv8 Crypto Extensions modules need binutils 2.23 or higher) -$(warning $(ce-obj-y) $(ce-obj-m)) -endif -endif +obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o aes-arm-y := aes-cipher-core.o aes-cipher-glue.o aes-arm-bs-y := aes-neonbs-core.o aes-neonbs-glue.o