Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp759219pxm; Thu, 3 Mar 2022 04:11:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF8krvWZl2zSAWYapXm2z1qw2/Z/l/kiRwRUoMJu5U3D5ZIatQ5/V6Yyrnt8jgsQYGiR9g X-Received: by 2002:a17:90b:4b0e:b0:1bf:749:952 with SMTP id lx14-20020a17090b4b0e00b001bf07490952mr5022104pjb.68.1646309472859; Thu, 03 Mar 2022 04:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646309472; cv=none; d=google.com; s=arc-20160816; b=nV4zimbF6bYsYPhyugEFbd7Ewuvt/7gZaz8p6b7xrJG3HtUXxmM6WVpdmz047bMuQq Pcjr41pAm3WTqE6F+Oyr0wlQjz9Z4+7yWRJJTFCL5Xq5HrFgwflj/py0w3ZY6Mn/rCzB fDugyFEtI0St6NG7+SC4UrE49OMZYjrDFKG9SVQ+/HPLRFsUuAMvrSHJim6ZuweF/+ZR pK2hyHoEq92owO4PbC1erMglJ3/xu6ARJCwYBkDn5zq6QRpr4x40zePLGIAT9z0RJ+5W 1ZlmR150bd3PaL8cSkmKG7575auWB4g8p9LLrS2c1BWP+uLTwilPtspWPenuTQnxFgDQ j4Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=bIEGLr7GUogV3+J6UxYXP8uTIacC30gif9fUOmkRYKc=; b=bk90Bq6Mc8WaKutsSdN1WfK/613U3GDhrGDbysQMWg98itLGa6zXHlO1Wm+4Ks7G0J DTf9x3dlkpSRLuaKkcMxL2IOnXKzt0tdyf5phLh2zSYLcMbXZEGbtZPrUIXSiBjXr9ll f+ZOD8DwzUbYZqmcHiuIgWp+p6NQ5MH0MhfB28IvhbX0p5O6XcrH/SN33sNfm1xYFbf5 MfPrMSVcvZ8EdfIuXSPXWlyKDtjftYZLQY26c8Nk/VosxrbNHRuI37dP6EjLROtOp/Vi dddkMKao5bdyvBaqXpIB6ojuHe0xgD3AN+O0GhxlGAowxaz4n2+i9q7pv68+ljkqMerK C3AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="div/YSHj"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a056a00170100b004cc95270639si2059989pfc.80.2022.03.03.04.10.45; Thu, 03 Mar 2022 04:11:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="div/YSHj"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232685AbiCCLRR (ORCPT + 99 others); Thu, 3 Mar 2022 06:17:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231971AbiCCLRR (ORCPT ); Thu, 3 Mar 2022 06:17:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09DE216E7F2 for ; Thu, 3 Mar 2022 03:16:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8F53C61689 for ; Thu, 3 Mar 2022 11:16:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA7C8C340EF; Thu, 3 Mar 2022 11:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646306191; bh=VUwkrK39WEvpiwdRpPCpjr3baRsJTQ1IDZXIQ/K1M9U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=div/YSHjxwUWA2VHysN2fA/mtp6tv4HlTxEAV4ZRVoPTxWucZZoOoYooJ2wSsq5b1 bPEhM7NYFKzBJ5a5rtIusGYeFXIKTP7nGP0faWDCUmO5y3StnTnkVdStJqPIX2UeYT jNaDzGRUyxkN2blfsozEdbAQ0ue31GVfbQmyiPOCIZA4+aS2bHF6vre/RsqrS1FLzj HS4r5SZdOpFtA3V983XpavM1bRmLpTqS3T7gVY2Sl3tAtUa/ep0vwQ6z3mESTIco2D fIEwM/2EN5GYpOvwy+a4QEKDIhxn5VsnGzjTpcnQKYrS8vQ5lZuY6CQdy0EIQgdGNk qK02Xyv/Atw2A== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nPjRc-00BwFP-HH; Thu, 03 Mar 2022 11:16:28 +0000 Date: Thu, 03 Mar 2022 11:16:28 +0000 Message-ID: <87y21r1e2b.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown , Ard Biesheuvel Cc: Herbert Xu , "David S . Miller" , Catalin Marinas , Will Deacon , Linux Crypto Mailing List , Linux ARM Subject: Re: [PATCH] arm64: crypto: Don't allow v8.2 extensions to be used with BROKEN_GAS_INST In-Reply-To: References: <20220302165438.1140256-1-broonie@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: broonie@kernel.org, ardb@kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, catalin.marinas@arm.com, will@kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 03 Mar 2022 07:26:45 +0000, Ard Biesheuvel wrote: > > On Wed, 2 Mar 2022 at 16:54, Mark Brown wrote: > > > > We support building the kernel with archaic versions of binutils which > > had some confusion regarding how instructions should be encoded for .inst > > which we work around with the __emit_inst() macro. Unfortunately we have > > not consistently used this macro, one of the places where it's missed being > > the macros that manually encode v8.2 crypto instructions. This means that > > kernels built with such toolchains have never supported use of the affected > > instructions correctly. > > > > Since these toolchains are very old (some idle research suggested 2015 > > era) it seems more sensible to just refuse to build v8.2 crypto support > > with them, in the unlikely event that someone has a need to use such a > > toolchain to build a kernel which will run on a system with v8.2 crypto > > support they can always fix this properly but it seems more likely that > > we will deprecate support for these toolchains and remove __emit_inst() > > before that happens. > > > > Signed-off-by: Mark Brown > > IIRC this is not about .inst getting the encoding wrong, but about > confusion over the size of the generated opcode, resulting in problems > generating constants involving relative offsets between labels. (The > endian swap is there so that .long can be used on BE to emit the LE > opcodes) > > This is not an issue here, so I don't think this change is necessary. Indeed. The only case where the broken GAS .inst has hit us was in combination with alternatives (see eb7c11ee3c5c for details). The encoding itself is always correct, and it is only the label generation that was broken. If we were affected by this, the kernel would simply fail to build with these toolchains. If this ever happens (because we'd add some extra alternative sequences to the crypto code?), we can revisit this. But in the meantime, I don't see anything warranting this extra dependency. Thanks, M. -- Without deviation from the norm, progress is not possible.