From patchwork Fri Apr 9 22:11:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12195145 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=-22.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 BAEDCC433ED for ; Fri, 9 Apr 2021 22:39:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CA1C611AE for ; Fri, 9 Apr 2021 22:39:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CA1C611AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=wpqNmbkrrOW3NtyBDCd+H0K6Nz14iAy4oEMWClUfWBQ=; b=E203uc9JS51P0/LywE3/9ioef4 3blE6/svtTj5ullBCCYOpfPU25jIPZo8IdYsalxHn7sB0cQmqOciQT73HkHqtvLuvEI77JIuimYS8 OX266qiY7MSNhArzf+qrReadfqT4DwSigQGVwnAnYwd04yxC04Y3+C5aFD0nlwweACwSJ3o5FBYbF zCMLf/DU6bnTdtQF7j8s925rElSYXNuHRt2cFXmAr//Y684JWSUhgsA+MEKnK5tV8uh+WfpKiqRZe u0fr4baU7vWaIn74EUgt2+XWxUB7vBfMNXOdTIoEtEzamVDrPCXt2mO+L/Iz+Xjmz/0P1PsEoclHU BQiv6VlA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUzfJ-001cVb-Qf; Fri, 09 Apr 2021 22:32:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUzMT-001bjI-If for linux-arm-kernel@desiato.infradead.org; Fri, 09 Apr 2021 22:12:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=ixGoym9kEcI52xTFPyPcf2MiQm4nOu0wCYD3mdlEmXY=; b=izrkEwgrn88LIdt0JToqLS9wY0 agByJ6rdHa8aydPouMoyEDxpnvhjOxbS8YATLNEarykfys4yZHfNUckyIbmDyf0wD4fbTSlGRKc7P V18p78xenjC1BztVb2voUMRIN27IbZz9uWFQGSH2TDrAbpNUiCvtN92Jas2H6DLrwABvVAf6ZZiHp zRlgv22UctVkZtW0O14yI2Gg4+uovLQvUGuMFEZSlTfHDSC/LrOcwFvnnwojhWbdA1gtZLS0WEN1j re3QNnr24B7KPPOu+2XLymahFYUHim1taMNT1TL4W7Qszg5PaN0WAmcnozBSNdABaXEzNanKPB0aL 6TElL4wQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUzMQ-004pMp-RN for linux-arm-kernel@lists.infradead.org; Fri, 09 Apr 2021 22:12:20 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0ABB610A8; Fri, 9 Apr 2021 22:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618006337; bh=M7s3pMhdWn3yHEsyevVbXdjmmUWWkdETqRhmlxr/BlU=; h=From:To:Cc:Subject:Date:From; b=u8y2wdd5u/QpjQy7m0Mnv9ezCsy+6q+xfW8jgXnagVFBq5MniZ9a9DTrDCRolQoo5 oI8lvsMs7amktN21+2FJzdF5kbvYLuyYfKXdXKpkfZJVvc0XLX8gaaZK8xAmVYkJy3 hwhOCQiTO6ZUpg6y+Ez9Fo9qD99ihYlmbCxBQYZxdyPhFAkD/2+tIVtfk1KauI7h2w 0rboiSLYcZLBBIycx9UZ/c0QVsBjiUZaTO5xRE4Yw8B/FN15qzo1ANrs8sjPHNhP+g NByXHDb9V0M3wOtvCHGVDXveeFDKPd9SQtCY55QGJCzx34J2b9hkYiGoVFz99dS7wL TY8gT0uhpgaqQ== From: Nathan Chancellor To: Herbert Xu , "David S. Miller" Cc: Russell King , Nick Desaulniers , Ard Biesheuvel , "Jason A. Donenfeld" , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , stable@vger.kernel.org, Arnd Bergmann , Jessica Clarke Subject: [PATCH] crypto: arm/curve25519 - Move '.fpu' after '.arch' Date: Fri, 9 Apr 2021 15:11:55 -0700 Message-Id: <20210409221155.1113205-1-nathan@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_151218_930710_64CAD843 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Debian's clang carries a patch that makes the default FPU mode 'vfp3-d16' instead of 'neon' for 'armv7-a' to avoid generating NEON instructions on hardware that does not support them: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/5a61ca6f21b4ad8c6ac4970e5ea5a7b5b4486d22/debian/patches/clang-arm-default-vfp3-on-armv7a.patch https://bugs.debian.org/841474 https://bugs.debian.org/842142 https://bugs.debian.org/914268 This results in the following build error when clang's integrated assembler is used because the '.arch' directive overrides the '.fpu' directive: arch/arm/crypto/curve25519-core.S:25:2: error: instruction requires: NEON vmov.i32 q0, #1 ^ arch/arm/crypto/curve25519-core.S:26:2: error: instruction requires: NEON vshr.u64 q1, q0, #7 ^ arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON vshr.u64 q0, q0, #8 ^ arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON vmov.i32 d4, #19 ^ Shuffle the order of the '.arch' and '.fpu' directives so that the code builds regardless of the default FPU mode. This has been tested against both clang with and without Debian's patch and GCC. Cc: stable@vger.kernel.org Fixes: d8f1308a025f ("crypto: arm/curve25519 - wire up NEON implementation") Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118 Reported-by: Arnd Bergmann Suggested-by: Arnd Bergmann Suggested-by: Jessica Clarke Signed-off-by: Nathan Chancellor Acked-by: Jason A. Donenfeld Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers --- arch/arm/crypto/curve25519-core.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: e49d033bddf5b565044e2abe4241353959bc9120 diff --git a/arch/arm/crypto/curve25519-core.S b/arch/arm/crypto/curve25519-core.S index be18af52e7dc..b697fa5d059a 100644 --- a/arch/arm/crypto/curve25519-core.S +++ b/arch/arm/crypto/curve25519-core.S @@ -10,8 +10,8 @@ #include .text -.fpu neon .arch armv7-a +.fpu neon .align 4 ENTRY(curve25519_neon)