Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp115874rdb; Wed, 20 Dec 2023 07:40:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbBJpdcDp5cmehS1bLBmKI7USsZ3RsG+HyQ1JxvaRENO2h4K0cTxGAKqKzE597GTL4jwc8 X-Received: by 2002:a17:902:c40d:b0:1d0:6ffd:837d with SMTP id k13-20020a170902c40d00b001d06ffd837dmr12773457plk.136.1703086831635; Wed, 20 Dec 2023 07:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703086831; cv=none; d=google.com; s=arc-20160816; b=JqJ5Nqdf3VPGrMZlTf3mv1KFOgrm04E8NOgR6kMnLZOXXmHSx6fktHVTqvN5bmAk9Q PGqWgh1Mnv3lEW5gV53pwj3W2e0Mx2KaIy0UiOLEQNXNOlOHt2qZh070MyJ0u5HuihBV cFLzgSmuILjrZ5ff/hXVmtf1HUBsFQZZvwzZWQjNoOqCWK4GL6Hmev5IEoVPYxwN4YTa gBDha+ljrPve9HWucZXqruey6Z9qc1eLxRt4rNoxfdnfzHA6u8zZ59aPY5i3dq4hFEbx r+DwVcHsF69fff2d3ujNRWxuqGFtR2Qizjijlg2p0D4KMtc65Ts9WAX/HXAjs+S4ni4+ TBCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7FoV5KJePcjmjfijItZqp6uE+mKHpmQjhKsGUKgu+iU=; fh=KcnIljtstfl9TdpxZeGotglJ/S3Dh6JlN7k++VnpfIA=; b=tqiUUo1vnabAHDScB0/ZjGtdmMKYKuWC2fgoZ/Akz58l5gvew92F1BHIQLui3w8G00 HvC9bFh83gd7PanCoNYaQt3yTBvD9a3OX3r2AAQsbwyxEXdfpBh5qGHJAc9paSQhP0u2 rjHmj2HYkiUwIGs4+ZurpumCty1aq3T7BGW3zxv8roAV9FqB5Qd7cE1K51ZbBuB0ohXg Vbbz452fpI76IyYaZGY8yTdaNKHPG0M9wvDTnKTNGIo9J0DbaD5TWLf6UPtzMPcQXrbp l575JPyoG7UXen8bcA3vB099kbnUILK+m0/hNXiChX1GN87jVoojBO6lUfDMlo21g2B3 miwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oJpmbySA; spf=pass (google.com: domain of linux-crypto+bounces-940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s11-20020a170902988b00b001d3d7ee2563si3632785plp.456.2023.12.20.07.40.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 07:40:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oJpmbySA; spf=pass (google.com: domain of linux-crypto+bounces-940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 67534289FE3 for ; Wed, 20 Dec 2023 15:32:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96C633FE30; Wed, 20 Dec 2023 15:32:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oJpmbySA" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FF6A3FB04 for ; Wed, 20 Dec 2023 15:32:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF40CC433C9; Wed, 20 Dec 2023 15:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703086320; bh=bJrXRcY+g/Zhyk8TW6XZqRLmOKlhPoFZoeRcr95OHAk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oJpmbySAxKPqvlBNNh0uHDkKT392pfPwzUcxeMf1SAQwSzPm3LIZJcf5o+oCD/R3Y 6Cjn6qo7opW3EyTozovruSthCjWFVVSa06SX6ZsSUeGw5UwPXEsKQpf/etNetMl+Lp vd5dhQzaSLh9DMoy23FTdHsOUftdzC5HFBApSDmepwOm5kWcQfg+hPipRc4NPL5Y+w 7iAbKvDaAVZwgS9amxh+1g6k37+BmWL7MOn2pdRGVIJcgS6wRtGV3rQiR863vCJ8Sq US3Vvcqj5l3vvaU8RQXzJDDXtXAjAHtyR4S023FAL4lb2JKQ51Wg/6IynUL68hC4ms eKiTS2oQHAwCw== Date: Wed, 20 Dec 2023 09:31:55 -0600 From: Eric Biggers To: Christoph =?iso-8859-1?Q?M=FCllner?= Cc: Jerry Shih , linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH] crypto: riscv - use real assembler for vector crypto extensions Message-ID: <20231220153155.GA817@quark.localdomain> References: <20231220065648.253236-1-ebiggers@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Dec 20, 2023 at 08:52:45AM +0100, Christoph Müllner wrote: > On Wed, Dec 20, 2023 at 7:57 AM Eric Biggers wrote: > > > > From: Eric Biggers > > > > LLVM main and binutils master now both fully support v1.0 of the RISC-V > > vector crypto extensions. Therefore, delete riscv.pm and use the real > > assembler mnemonics for the vector crypto instructions. > > > > Signed-off-by: Eric Biggers > > For OpenSSL, these hand-written assembler functions were mainly written > to make OpenSSL's CI builds happy, which run on the latest Ubuntu LTS. > > I'm happy to see these functions disappear, but I wonder if there is a > guideline or best-practice for assembly optimizations like this. > > The upcoming Binutils release (presumably available in Jan 24) will > (presumably) be available in Ubuntu 24.10. > And until then most users won't be even building the code. > > > > Reviewed-by: Christoph Müllner As far as I can tell, kernel code usually just relies on assembler support for new instructions. See e.g. CONFIG_AS_AVX512 for x86's AVX-512. You can't build the AVX-512 optimized crypto code unless your assembler supports AVX-512. Beyond that observation, I don't think there's a specific guideline. The kernel doesn't have CI on Ubuntu, at least not officially for upstream. Either way, it's possible to install newer LLVM and binutils on old Linux distros anyway. Also, the RISC-V crypto code won't make it into v6.8 since it depends on a separate patch that adds support for kernel mode vector. It will be merged into v6.9 at the earliest. So my vote is to just rely on the LLVM and binutils support. - Eric