From mboxrd@z Thu Jan 1 00:00:00 1970 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 41D6EC1975A for ; Wed, 25 Mar 2020 11:45:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 13DDC20772 for ; Wed, 25 Mar 2020 11:45:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U40sjllU"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="PLp3qnAw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13DDC20772 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+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ubYkhz+oDsAEwZFY3aC0QYfiur2PQRsbz60hX4t+8/Y=; b=U40sjllU+nikSt Aosg8WNNKfmMF9BBt+9m4wmNl5GUryl+FdDQEEIkPjdIESAZGMv6cR8qRwM3dA/jMk5qjexBlWKXP f+G7Y56qrAv2xgAdxM0ObeBZE0/BQ1JSDy/FHPnF6WLjCPIcCKhwkQHowlO2WfBvE9WmdvG6WoNSj Lv411QM3XLyKLCdZE7VTiNQkPoZrCD0Sky6A0YRcE35mFEU4MVGklf8lJRcsrATsZ5AtcLrJJN3O6 1khcX4NHfzRzYD39/K6QmzklgFlvHuCJRmK6ooruh3yybn1T9WdWIszHtYOOVzwiYEb4jZibdk/9T byEZrK+v3SXMIHQBtnvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jH4TR-0004Mv-Pn; Wed, 25 Mar 2020 11:45:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jH4TL-0004HX-S7 for linux-arm-kernel@lists.infradead.org; Wed, 25 Mar 2020 11:45:25 +0000 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 819742078A for ; Wed, 25 Mar 2020 11:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585136722; bh=feUfzVqMn/cgtqqVh3lV2rv2NlCW5TbLBBgFLBvyE1A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PLp3qnAwb8amqv0P0bKEFsufSmvqhwWehGPGhIDseAV6mVlS6vxqn2EqiCh1Go5sa YAIAjk93N8l/y98GZ0XUNIyaIHRjZIh7dOgT7kGSlAVAfcoSQTRSLIxOgVK1n5Z0P3 xr2+ciJJZz+FsxwFv9QCiurfNGUsWd/1BxdTLxRs= Received: by mail-io1-f52.google.com with SMTP id q9so1897452iod.4 for ; Wed, 25 Mar 2020 04:45:22 -0700 (PDT) X-Gm-Message-State: ANhLgQ25cv/n6s476iJWoSe9SSBuER2B8qDi4G3O9yOxdT4yLrhVpbSu oYNHa5JxhN2NnylaaPlqqKgnJdOXBAzkUcWckHg= X-Google-Smtp-Source: ADFU+vsgn5bSaiqX53PNf/K2+W1ldzxeeGFCyDOP7aQcyvzAirF/46cbqggUvktMRaBAUXCbyx3LmgaoJyyYiNzjQls= X-Received: by 2002:a05:6602:2546:: with SMTP id j6mr2450622ioe.171.1585136721872; Wed, 25 Mar 2020 04:45:21 -0700 (PDT) MIME-Version: 1.0 References: <20200325114110.23491-1-broonie@kernel.org> In-Reply-To: <20200325114110.23491-1-broonie@kernel.org> From: Ard Biesheuvel Date: Wed, 25 Mar 2020 12:45:11 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] arm64: Open code .arch_extension To: Mark Brown X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200325_044523_994523_25DAB87F X-CRM114-Status: GOOD ( 18.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Eric Biggers Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 25 Mar 2020 at 12:41, Mark Brown wrote: > > Currently several assembler files override the default architecture to > enable extensions in order to allow them to implement optimised routines > for systems with those extensions. Since inserting BTI landing pads into > assembler functions will require us to change the default architecture we > need a way to enable extensions without hard coding the architecture. > The assembler has the .arch_extension feature but this was introduced > for arm64 in gas 2.26 which is too modern for us to rely on it. > > We could just update the base architecture used by these assembler files > but this would mean the assembler would no longer catch attempts to use > newer instructions so instead introduce a macro which sets the default > architecture centrally. Doing this will also make our use of .arch and > .cpu to select the base architecture more consistent. > > Mark Brown (3): > arm64: asm: Provide macro to control enabling architecture extensions > arm64: lib: Use ARM64_EXTENSIONS() > arm64: crypto: Use ARM64_EXTENSIONS() > Hi Mark, I don't think this is the right fix. What is wrong with keeping these .cpu and .arch directives in the .S files, and simply make SYM_FUNC_START() expand to something that includes .arch_extension pac or .arch_extension bti when needed? That way, we only use .arch_extension when we know the assembler supports it (given that .arch_extension support itself should predate BTI or PAC support in GAS or Clang) > arch/arm64/crypto/aes-ce-ccm-core.S | 3 ++- > arch/arm64/crypto/aes-ce-core.S | 2 +- > arch/arm64/crypto/aes-ce.S | 2 +- > arch/arm64/crypto/crct10dif-ce-core.S | 3 ++- > arch/arm64/crypto/ghash-ce-core.S | 3 ++- > arch/arm64/crypto/sha1-ce-core.S | 3 ++- > arch/arm64/crypto/sha2-ce-core.S | 3 ++- > arch/arm64/include/asm/linkage.h | 6 ++++++ > arch/arm64/lib/crc32.S | 2 +- > 9 files changed, 19 insertions(+), 8 deletions(-) > > -- > 2.20.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel