Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3588854rdh; Mon, 27 Nov 2023 19:46:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFg33c7iV8UAB0t14wbhTGkY8Nk2VfzkkAncPg56o8J0fWNfBf1UD7ePbQsd02SLMhF8moF X-Received: by 2002:a05:6a00:e17:b0:6cb:8beb:15dc with SMTP id bq23-20020a056a000e1700b006cb8beb15dcmr12722267pfb.30.1701143168373; Mon, 27 Nov 2023 19:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701143168; cv=none; d=google.com; s=arc-20160816; b=ijQfZOL3hPxhYVjdVvrHoDFdcfZXkjEit8NHJ4QD6C2fxsYfpXlar8Zz5qGF6uWyOo ucpqaOuc088WVc9gNZEtYOSzywzYVMgTs3oPqdYmViXDMCz2f80X12ztHdVcvggBB/u8 h9R1yZOAd/3yEuqPUBK4LIfuW3CbYuZifkGgr+htNHJPpk51ytNtYhnEcjoq9P1LsbCj 26gyTfBwCw8wDRlOl5W+LUJY9j/TQpYDsQdh2beN0XazE5so8b52H7VYplornk3Zm9pI s/JFIwKGb7IzHoi9t8bPTG2R7PB5DBh9dE1l96ksb+NJl7FM691lUDO+J9qEfPmAfjVa il7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SlTlDdUheUupzhECLKjdUholXekCn0xlWOex6peJmHY=; fh=zbDRpcBgg9Y8vPgjc5rEEysmrqOVa145mcP3uY0f1po=; b=MdmgQPRSPNHxCHHwu5e8xL1JaKvg2fPBorUWISTDPBqnrYruZ6xm6zDRQP20CaeRMm zHjPAxcnT7/usfcGvPdJCtkkNHyAraSOx0bPyzvi/tNFXClAY9NazbDavorkgh57/TlU XQMg0s4zFCn5G3mFuYb5NFOXOxdOCAwvd4kiktzi8eLRqxQiWrv8uoNv2QgXIfwxyUgp mkcrgW4+S6soQ02l3LVszPFZfpZwv70XOZPQ0yhPVa4fBkIE/lvUHbayGcrhzHqSCQ0p Oa/YRCDirV6icTvJBOu/OdTLgY5Zdzt54xJ9hGplkxFiLhshZfSDbN10vO5grvzxW+v9 n0Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HtlLnnuU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g9-20020a056a0023c900b0069342eade87si11728627pfc.18.2023.11.27.19.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 19:46:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HtlLnnuU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 840B7807BEF9; Mon, 27 Nov 2023 19:45:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232891AbjK1DpO (ORCPT + 99 others); Mon, 27 Nov 2023 22:45:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjK1DpN (ORCPT ); Mon, 27 Nov 2023 22:45:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D279B131 for ; Mon, 27 Nov 2023 19:45:19 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A3E6C433C8; Tue, 28 Nov 2023 03:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701143119; bh=mAazPanOHbBf1EpbjCncZ4WNSuavZPxp41OW/CwwxRs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HtlLnnuUM2YaMmNqX508S+C7Qp+iKil8+8sWjiu/9VMk7LiQipfCRUzaBwJYhgplP dZxLctoALIyGJzS7OpEHbiEIklOIiiU9dxVxgoE+t5kv5YSKsSsPg2mOl7GCh5gnXj Q0O+zyuy0QM9VvFLnrJlDP4FHgDOq++v/yWGy3tEGRZcz52gGfFhwOhpxaOlGEvvWw 6e6k78IR+guspkCWWf9/iIYFOiCSFAai5hVGBbbRFAtypsZSnj2WK5e2+TDBY1FkwB 5rzKXkYdsaUfYofS5b66O8u4yyzmq5Iy2vK7aMkamVMVXq3SG2VL9gJ53d+TgcsSuy 8tEgq1ZtFO2cw== Date: Mon, 27 Nov 2023 19:45:17 -0800 From: Eric Biggers To: Jerry Shih Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, herbert@gondor.apana.org.au, davem@davemloft.net, conor.dooley@microchip.com, ardb@kernel.org, heiko@sntech.de, phoebe.chen@sifive.com, hongrong.hsu@sifive.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v2 01/13] RISC-V: add helper function to read the vector VLEN Message-ID: <20231128034517.GE1463@sol.localdomain> References: <20231127070703.1697-1-jerry.shih@sifive.com> <20231127070703.1697-2-jerry.shih@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231127070703.1697-2-jerry.shih@sifive.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 27 Nov 2023 19:45:41 -0800 (PST) On Mon, Nov 27, 2023 at 03:06:51PM +0800, Jerry Shih wrote: > From: Heiko Stuebner > > VLEN describes the length of each vector register and some instructions > need specific minimal VLENs to work correctly. > > The vector code already includes a variable riscv_v_vsize that contains > the value of "32 vector registers with vlenb length" that gets filled > during boot. vlenb is the value contained in the CSR_VLENB register and > the value represents "VLEN / 8". > > So add riscv_vector_vlen() to return the actual VLEN value for in-kernel > users when they need to check the available VLEN. > > Signed-off-by: Heiko Stuebner > Signed-off-by: Jerry Shih > --- > arch/riscv/include/asm/vector.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) Reviewed-by: Eric Biggers - Eric