From patchwork Tue Mar 24 00:13:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 197953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09817C4332B for ; Tue, 24 Mar 2020 00:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6689206F9 for ; Tue, 24 Mar 2020 00:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585008947; bh=/t8E5mF7gLl3InIp7W2BY/pKTGVQfH//5zDOuzQasXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=A7DTjUwWKg3qL/aLL7Cf2pZ91Nv5k2DpAyNbPGNSAjx/z7pFWJJpuxm7YrT68G/ix htR5PWtOCM78zn7uqr97TCAg+u/eSDFVPwwMp3t9CpVD3Ue5M0o31ma7N6AROBtpGq iewk9iKpIknZVNH2jZPmNHVUD164p1yK993vPqrw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727474AbgCXAPr (ORCPT ); Mon, 23 Mar 2020 20:15:47 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:29705 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727467AbgCXAPr (ORCPT ); Mon, 23 Mar 2020 20:15:47 -0400 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-09.nifty.com with ESMTP id 02O0EHnp026701; Tue, 24 Mar 2020 09:14:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 02O0EHnp026701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585008860; bh=w76PdnLBUJ71LHvA8T4MOfRPh/Z+7+i64nMxwKp/rWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dL37O19aq5cHlCk6J0qsXuZHNPVvSsdRbW3xKUBbMxhvYTs7svhNT2REU6qk8LbCa Qc8Hp8lGkbZaXqpNvajFhjA3MaxCl9oWxk/7WfM0HNiyLkoOjup6YElbSO26liMtv1 BHRS40hQCZ6KOlUPhvJVnOyAfH1GdGFXPbPDQmj6Jqn7EEgRhMC0miqp9cJiP4Wmq3 OAvNhdVzVmK8u1CT6xTgz5j+vWfVtVvEm5EkPcLrg/f3TMaYdYNXkZ1Ra5ECeHECRV frcdJZxpBQSkxim19W9eOobt3mHmm3CrqKaEsf/DYncI5hPsQtWOOgapTibiQtXQng c0PYQql0NhnXg== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld" , Masahiro Yamada , Ingo Molnar Subject: [PATCH v2 2/9] x86: remove unneeded defined(__ASSEMBLY__) check from asm/dwarf2.h Date: Tue, 24 Mar 2020 09:13:51 +0900 Message-Id: <20200324001358.4520-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324001358.4520-1-masahiroy@kernel.org> References: <20200324001358.4520-1-masahiroy@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This header file has the following check at the top: #ifndef __ASSEMBLY__ #warning "asm/dwarf2.h should be only included in pure assembly files" #endif So, we expect defined(__ASSEMBLY__) is always true. Signed-off-by: Masahiro Yamada Acked-by: Jason A. Donenfeld --- Changes in v2: None arch/x86/include/asm/dwarf2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index ae391f609840..5a0502212bc5 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -36,7 +36,7 @@ #define CFI_SIGNAL_FRAME #endif -#if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__) +#if defined(CONFIG_AS_CFI_SECTIONS) #ifndef BUILD_VDSO /* * Emit CFI data in .debug_frame sections, not .eh_frame sections. From patchwork Tue Mar 24 00:13:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 197952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20C14C43331 for ; Tue, 24 Mar 2020 00:15:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA15F20714 for ; Tue, 24 Mar 2020 00:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585008957; bh=lkibHm9F4rNasjAG95t2w9zsGP7F3aiRE0T7IgbxTTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OHthYMdcYzVxWfeUer5S3qFX98mx5BIE1wLvoKK29rhGlaXhGiAK211MYYjE3pbJI zeg8QNkoPuqJLQja/uVk4bqxqaxIb4igo5B7rOed/GeBgjpTSlAu0+545kHTW8umjl vGhPMx1OMHODekhYlJNQEHI+5Ox6bQF3vex0fCjU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbgCXAPv (ORCPT ); Mon, 23 Mar 2020 20:15:51 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:29770 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbgCXAPu (ORCPT ); Mon, 23 Mar 2020 20:15:50 -0400 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-09.nifty.com with ESMTP id 02O0EHns026701; Tue, 24 Mar 2020 09:14:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 02O0EHns026701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585008863; bh=PXf90zEL0PBjxAqiIelC9lPpjynKaO7oTN5qSukZw9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vNHVDqn0n6+005Ynu+20MgPJrYvvF8RyIWdmGr6LWGtvMoFJyxw6Mws0aBx7XjTAH biGuW+2/odEx5og6G+EwC35JJcGLegJBQs0qXM+xP1RqxSdCL2rBVhgpSWm5gR3WP1 Ns8WY4pfBnR/qQ2Hhu29fANWa2hqQa8E7+ppFkQuNL2Qy9/2hYFHp3RCyNfaAt2c0T VQweCj511vsWrKqxYRqhhpRdpj26L6cOnTHgylfc+07TOs3LSZNEbQiiCfx+R5jjC/ ElnXBRqNpfZKOnwYqLp5NTY1kDAO1+1IIpSLZMPrTwr70afxxC5Ix0auF9nBeDIJTH pKkm+vhVSoorA== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld" , Masahiro Yamada , Ingo Molnar , clang-built-linux@googlegroups.com Subject: [PATCH v2 5/9] x86: remove always-defined CONFIG_AS_CFI_SECTIONS Date: Tue, 24 Mar 2020 09:13:54 +0900 Message-Id: <20200324001358.4520-6-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324001358.4520-1-masahiroy@kernel.org> References: <20200324001358.4520-1-masahiroy@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org CONFIG_AS_CFI_SECTIONS was introduced by commit 9e565292270a ("x86: Use .cfi_sections for assembly code"). We raise the minimal supported binutils version from time to time. The last bump was commit 1fb12b35e5ff ("kbuild: Raise the minimum required binutils version to 2.21"). I confirmed the code in $(call as-instr,...) can be assembled by the binutils 2.21 assembler and also by LLVM integrated assembler. Remove CONFIG_AS_CFI_SECTIONS, which is always defined. Signed-off-by: Masahiro Yamada Acked-by: Jason A. Donenfeld Reviewed-by: Nick Desaulniers --- Changes in v2: None arch/x86/Makefile | 6 ++---- arch/x86/include/asm/dwarf2.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index dd275008fc59..e4a062313bb0 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -177,8 +177,6 @@ ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1) KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,) endif -cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1) - # does binutils support specific instructions? asinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1) avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) @@ -188,8 +186,8 @@ sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI= sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1) adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1) -KBUILD_AFLAGS += $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) -KBUILD_CFLAGS += $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) +KBUILD_AFLAGS += $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) +KBUILD_CFLAGS += $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index f440790f09f9..c1e0c315a622 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -21,7 +21,6 @@ #define CFI_UNDEFINED .cfi_undefined #define CFI_ESCAPE .cfi_escape -#if defined(CONFIG_AS_CFI_SECTIONS) #ifndef BUILD_VDSO /* * Emit CFI data in .debug_frame sections, not .eh_frame sections. @@ -38,6 +37,5 @@ */ .cfi_sections .eh_frame, .debug_frame #endif -#endif #endif /* _ASM_X86_DWARF2_H */ From patchwork Tue Mar 24 00:13:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 197950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ED60C4332B for ; Tue, 24 Mar 2020 00:16:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D971420714 for ; Tue, 24 Mar 2020 00:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585008970; bh=M3i+esipc/7RxjC4LIZ1nh9blbZcFkjp/UfIDebVeM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TALzrC+kcd/6CJc+DQ3ZRCSNqFZ3E+5fogy8RbJczt8qZluBaVJjXYEL6ZWiALeMZ zyyvimyluhDJfl7K25gLRDD7KY1Mf2nj8C+D8u58p+AD93NdEAgxUvR5qceuzAuZvc xqxNWdBJ1dKPiMSEWPIsag5YriZAvq9bQV8BYyHw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727639AbgCXAQK (ORCPT ); Mon, 23 Mar 2020 20:16:10 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:30312 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbgCXAQK (ORCPT ); Mon, 23 Mar 2020 20:16:10 -0400 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-09.nifty.com with ESMTP id 02O0EHnt026701; Tue, 24 Mar 2020 09:14:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 02O0EHnt026701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585008864; bh=R0STIziFjPNP3E34qfzmQ6u1ZNlYmWgDS8/ChcGBd/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hpHQGA+nZfdPtj8G28GbRdvidfq5s2iIfLA0qB3v6lkhLGJ5/UpJKa0hDNawptDiI 35m6TF68KRZ66hcbFhbykObdb2I+BjXji9sE+e6fYLbKA2Grn1OJ7vqLkPnDEAWDeP bu77UxPrdatwSNjKUhNnj6eZ4zZpBYuIauZ/MpF/dlOR6Gl+pcXPm1ODp4hzVLIwGK 1BGbRCH/QtYv/YFyLHAH552H6e4PVjx+8HzWFWZLFGrHuZHlyMCHYpHbPjF/ytmM/q X2zAtRe9jnDrwLPfVel2dIE7zhwAxncOqvGdwG8ayj0DNB8UI8iroJ1BxsAeoERna/ 6wpRTLa7qHA/w== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld" , Masahiro Yamada , "David S. Miller" , Herbert Xu , Ingo Molnar , clang-built-linux@googlegroups.com Subject: [PATCH v2 6/9] x86: remove always-defined CONFIG_AS_SSSE3 Date: Tue, 24 Mar 2020 09:13:55 +0900 Message-Id: <20200324001358.4520-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324001358.4520-1-masahiroy@kernel.org> References: <20200324001358.4520-1-masahiroy@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org CONFIG_AS_SSSE3 was introduced by commit 75aaf4c3e6a4 ("x86/raid6: correctly check for assembler capabilities"). We raise the minimal supported binutils version from time to time. The last bump was commit 1fb12b35e5ff ("kbuild: Raise the minimum required binutils version to 2.21"). I confirmed the code in $(call as-instr,...) can be assembled by the binutils 2.21 assembler and also by LLVM integrated assembler. Remove CONFIG_AS_SSSE3, which is always defined. I added ifdef CONFIG_X86 to lib/raid6/algos.c to avoid link errors on non-x86 architectures. lib/raid6/algos.c is built not only for the kernel but also for testing the library code from userspace. I added -DCONFIG_X86 to lib/raid6/test/Makefile to cator to this usecase. Signed-off-by: Masahiro Yamada Acked-by: Jason A. Donenfeld --- Changes in v2: - add ifdef CONFIG_X86 to fix build errors on non-x86 arches arch/x86/Makefile | 5 ++--- arch/x86/crypto/blake2s-core.S | 2 -- lib/raid6/algos.c | 2 +- lib/raid6/recov_ssse3.c | 6 ------ lib/raid6/test/Makefile | 4 +--- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index e4a062313bb0..94f89612e024 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -178,7 +178,6 @@ ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1) endif # does binutils support specific instructions? -asinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1) avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) avx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1) @@ -186,8 +185,8 @@ sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI= sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1) adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1) -KBUILD_AFLAGS += $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) -KBUILD_CFLAGS += $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) +KBUILD_AFLAGS += $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) +KBUILD_CFLAGS += $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) diff --git a/arch/x86/crypto/blake2s-core.S b/arch/x86/crypto/blake2s-core.S index 24910b766bdd..2ca79974f819 100644 --- a/arch/x86/crypto/blake2s-core.S +++ b/arch/x86/crypto/blake2s-core.S @@ -46,7 +46,6 @@ SIGMA2: #endif /* CONFIG_AS_AVX512 */ .text -#ifdef CONFIG_AS_SSSE3 SYM_FUNC_START(blake2s_compress_ssse3) testq %rdx,%rdx je .Lendofloop @@ -174,7 +173,6 @@ SYM_FUNC_START(blake2s_compress_ssse3) .Lendofloop: ret SYM_FUNC_END(blake2s_compress_ssse3) -#endif /* CONFIG_AS_SSSE3 */ #ifdef CONFIG_AS_AVX512 SYM_FUNC_START(blake2s_compress_avx512) diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c index bf1b4765c8f6..df08664d3432 100644 --- a/lib/raid6/algos.c +++ b/lib/raid6/algos.c @@ -97,13 +97,13 @@ void (*raid6_datap_recov)(int, size_t, int, void **); EXPORT_SYMBOL_GPL(raid6_datap_recov); const struct raid6_recov_calls *const raid6_recov_algos[] = { +#ifdef CONFIG_X86 #ifdef CONFIG_AS_AVX512 &raid6_recov_avx512, #endif #ifdef CONFIG_AS_AVX2 &raid6_recov_avx2, #endif -#ifdef CONFIG_AS_SSSE3 &raid6_recov_ssse3, #endif #ifdef CONFIG_S390 diff --git a/lib/raid6/recov_ssse3.c b/lib/raid6/recov_ssse3.c index 1de97d2405d0..4bfa3c6b60de 100644 --- a/lib/raid6/recov_ssse3.c +++ b/lib/raid6/recov_ssse3.c @@ -3,8 +3,6 @@ * Copyright (C) 2012 Intel Corporation */ -#ifdef CONFIG_AS_SSSE3 - #include #include "x86.h" @@ -328,7 +326,3 @@ const struct raid6_recov_calls raid6_recov_ssse3 = { #endif .priority = 1, }; - -#else -#warning "your version of binutils lacks SSSE3 support" -#endif diff --git a/lib/raid6/test/Makefile b/lib/raid6/test/Makefile index b9e6c3648be1..60021319ac78 100644 --- a/lib/raid6/test/Makefile +++ b/lib/raid6/test/Makefile @@ -34,9 +34,7 @@ endif ifeq ($(IS_X86),yes) OBJS += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o - CFLAGS += $(shell echo "pshufb %xmm0, %xmm0" | \ - gcc -c -x assembler - >/dev/null 2>&1 && \ - rm ./-.o && echo -DCONFIG_AS_SSSE3=1) + CFLAGS += -DCONFIG_X86 CFLAGS += $(shell echo "vpbroadcastb %xmm0, %ymm1" | \ gcc -c -x assembler - >/dev/null 2>&1 && \ rm ./-.o && echo -DCONFIG_AS_AVX2=1) From patchwork Tue Mar 24 00:13:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 197951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E09ADC10DCE for ; Tue, 24 Mar 2020 00:16:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFB4520714 for ; Tue, 24 Mar 2020 00:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585008961; bh=mqzxW3gm9wBGAnFt4a3L8KwySLgV5DfRyUD7HC4ModU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wumkVIYQDGimluDuXCr5UAQtEY4h/vZZJR2Mn+heiMyPOzZss/yziyUhn3Q9Xnmdx xRDf2Y9l+nkZJBBc9E+zji8zbHMwgRk4nBLdEYQhtlU8TcyhA5P0v7YsEPUlY925tD AsBVcz9hnFNkY8WRaKWxUBAMfMF7sSyH5UPo1+zw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727499AbgCXAPr (ORCPT ); Mon, 23 Mar 2020 20:15:47 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:29697 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727395AbgCXAPr (ORCPT ); Mon, 23 Mar 2020 20:15:47 -0400 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-09.nifty.com with ESMTP id 02O0EHnv026701; Tue, 24 Mar 2020 09:14:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 02O0EHnv026701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585008866; bh=kQokSOGafKM9qlMy9Knp7M7g8No8/5Dc4IXiyrgHWNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kKLMYgiC0h8xGXZ+vkn32yE2vMwKGCmJDFBEK0pcJQYejUEkp8oA7wrQfhVfyoBv6 xsqRdj3hJhEyPw0iKcAolxDhBsxQ3Fif3ZtfbqMf0OLP7MVN3SvmkWaGLeys7mwBpx hr7rmt3hkP8O/wEt4UW0kesGPQZsf97budesAb3tsIfASyS7TMn10G2sQldtEz3plu UIzzg7lOQ6ykVt4blr/uVxZWQSH6iHT1O8+J/xdErOSNiAX+UZbnjxrsnRBX3B6zup rh4qu13PclcrfOg/esoEXrxkOmL7RTFTjyPPmFrHRuiyJO5sL5mNdZaLuNmoCkqFPw 86qFI+k9csL4A== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld" , Masahiro Yamada , Ingo Molnar , clang-built-linux@googlegroups.com Subject: [PATCH v2 8/9] x86: add comments about the binutils version to support code in as-instr Date: Tue, 24 Mar 2020 09:13:57 +0900 Message-Id: <20200324001358.4520-9-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324001358.4520-1-masahiroy@kernel.org> References: <20200324001358.4520-1-masahiroy@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org We raise the minimal supported binutils version from time to time. The last bump was commit 1fb12b35e5ff ("kbuild: Raise the minimum required binutils version to 2.21"). We need to keep these as-instr checks because binutils 2.21 does not support them. I hope this will be a good hint which one can be dropped when we bump the minimal binutils version next time. As for the Clang/LLVM builds, we require very new LLVM version, so the LLVM integrated assembler supports all of them. Signed-off-by: Masahiro Yamada Acked-by: Jason A. Donenfeld --- Changes in v2: None arch/x86/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index f32ef7b8d5ca..4c57cb3018fb 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -178,10 +178,15 @@ ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1) endif # does binutils support specific instructions? +# binutils >= 2.22 avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) +# binutils >= 2.25 avx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1) +# binutils >= 2.24 sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI=1) +# binutils >= 2.24 sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1) +# binutils >= 2.23 adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1) KBUILD_AFLAGS += $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr)