Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp983145lqo; Thu, 9 May 2024 00:50:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGsXFRVolFwPW1g2UGv3O14oD9eMJiuAXPpchKcy2+hvj1oQF+TdM7e/B9XSTW3Veh61QXRM3El/R+gWtfovAjqfl2VgralciDr/3sMQ== X-Google-Smtp-Source: AGHT+IHZk3jc0xKoh6GHXTa9IhSgCEN0w+a65v1VNFuMwW3AzEhQgRhX8gHsBVs6oGCc0mUAt8os X-Received: by 2002:a17:902:edc5:b0:1e4:60d4:916b with SMTP id d9443c01a7336-1eeb0aa49acmr41238945ad.64.1715241014133; Thu, 09 May 2024 00:50:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715241014; cv=pass; d=google.com; s=arc-20160816; b=zGueNjd79R0d25KdP+fscNgRnmfXxpgD76drlK7XbPqHZyiqN2qZxMTiQXL/ViV9SE 1YOfDy9fGheMOPCFXz8P4CVmSXWK9LbPoz+CbRhN53ajUPoU+J7fWc73m9f9QOI7wjoQ 8qbWiBN8H27pSfOm5+FvMXfzyF4arEUgiyCJ3sQLoQCT1BmcPnNDQX2BJxBZcjuTdNTr 3eI0FkPc935K97PUO4BbRnDztnUFvzr5yMADmYjVDFm6g+nH/pmEdXDStGPY3+H59Lxg sZUVeHzCDpzGuisn6YU1mmMHBp3FZTNXFlN8B9Qrsve15tK6LGYAIf36Z6/FLr4OBeAg 2ywQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sDwPafMpIIsl7Mu2sC8mUTOsijZlaGt+V4EsD8yPch4=; fh=NTDwbQR1+YYxY7uj71slzRStiVTx5176TxnBN0QOCes=; b=EmxYqroIga3E00dzf9QoFG75bDIn/N5MzDSkHzUp82ReMgn1SvNvKqwv8A0orynn2Z xk7YLlw3ZXvlRXbnIN7Jfy8bjcbdVdr6OIfShQHkbmeOr2sOJdHaTvqqOwfB88HOBvwB TVnESMlFUcFqjzlzxOF7n1hsm7o+kwDDvpuhZuDlAFJEfgcT4kC/n3iVG9RHOZb1Lpdf LdPIOq8UVzaVXbDOfIxzkqQgum85RCyfnoUNM2k9ijBa3TXVMYCccRZ2J2yHuUHXjTqz B+a/1dTI7XViEEw0EPQ3aLi17914tUXrq2Y/Zq5fMcaLKps53s+qTyh4bnlu9gFspP8D jTQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=sibTL0dW; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-174252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c039c47si9190335ad.417.2024.05.09.00.50.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 00:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=sibTL0dW; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-174252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7EA8BB22D3E for ; Thu, 9 May 2024 07:49:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44CCF149DF8; Thu, 9 May 2024 07:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="sibTL0dW" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 F35C513C9C0; Thu, 9 May 2024 07:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715240953; cv=none; b=GD2fjvZDuvIzq7pJoemrMGRte+hTs8PNoJnf39nqDGAZOGO3gcdczQBeNrJPggv77PQ+8Kiu2FkvgMQcbEY5lwYiSc1uH+WqiKK3IJ/UZP49EhQGVZmIv3mB2C90mmVa1eB78FgDy2+nUE6GhPcLVXfLnqs4wZBIuldMm3nUATI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715240953; c=relaxed/simple; bh=sDwPafMpIIsl7Mu2sC8mUTOsijZlaGt+V4EsD8yPch4=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hp1GKOd+InBotM3fe/O0nvBulhag2NM3S+Jou3RvBd0sqm2BooRUv9Jgu24zE4tPMGZlGFmvHEY8tuvbGwegoXulLWc6wCtY5+arcI+mJFzwsfvMg7lW7odFquxE+npCt55E1VnubiIQtvtBIo44lTjKoPQ2Qyj7WEp3XFFngbU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=sibTL0dW; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1715240950; x=1746776950; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sDwPafMpIIsl7Mu2sC8mUTOsijZlaGt+V4EsD8yPch4=; b=sibTL0dWHltkqoG9/79SI/g3961GGl49C0NOZk1xzzGFx5uxjPTDYSqM m97+EU60v2YFxWuZ7Qvl8EjJCi6ItYpj6X3bUlV88oHgGxLEtbWyk5RMo qR4FnTK/EhHaVkfA7f1YJ5DJGsUstvOzTuJP/Yf3xBNkjYO7YVXpPnvkg kIN093h3owUFPCNhDpY5qegz4aPYGmnOUeGXtozQG5JGBY95AscCw5Ems SFDhcdVGIQck758msQv3unoMbsRGKoN+gVzOMYM6fjIceqhdGuK6cEhKm o7L9J1+t+Dwl5Tr2N3gHpaguzoeN0xUoD/FioUwJ/lW4jQsv8p66kq/f+ g==; X-CSE-ConnectionGUID: b4TAGUWbRRaXvl7Tlp/mVw== X-CSE-MsgGUID: 0hMmNNlFTQa1/hvoYYDwrg== X-IronPort-AV: E=Sophos;i="6.08,147,1712646000"; d="asc'?scan'208";a="191609229" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 May 2024 00:49:03 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 9 May 2024 00:48:23 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 9 May 2024 00:48:19 -0700 Date: Thu, 9 May 2024 08:48:09 +0100 From: Conor Dooley To: Andy Chiu CC: Conor Dooley , Eric Biggers , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Stuebner , Guo Ren , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Shuah Khan , , , Palmer Dabbelt , Vincent Chen , Greentime Hu , , , , Joel Granados , Jerry Shih Subject: Re: [PATCH v4 7/9] riscv: vector: adjust minimum Vector requirement to ZVE32X Message-ID: <20240509-mandatory-monsieur-dfa4d7881fa9@wendy> References: <20240412-zve-detection-v4-0-e0c45bb6b253@sifive.com> <20240412-zve-detection-v4-7-e0c45bb6b253@sifive.com> <20240418-brook-chili-4d3e61d1a55c@wendy> <20240418155256.GA2410@sol.localdomain> <20240418-ultimatum-yam-11de4b063b83@spud> <20240418173203.GA1081@sol.localdomain> <20240418173946.GB1081@sol.localdomain> <20240418-sterling-sanding-d59c3b0a2aaa@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ILfmNxMoEmQr18uK" Content-Disposition: inline In-Reply-To: --ILfmNxMoEmQr18uK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 09, 2024 at 02:56:30PM +0800, Andy Chiu wrote: > Hi Conor, >=20 > Should we check if "v" presents for vector crypto extensions in > riscv_isa_extension_check()? We are not checking this for now. So a > kernel compiled with RISCV_ISA_V still has a problem if its isa-string > includes any of vector crypto ("zvbb, zvkg, etc") but not "v". Yeah, one of the things I took away from this discussion is that we need to improve the implementation of both the methods we have at the moment for drivers etc to check if extensions are present and usable. In general, I don't think checks like that are "safe" to do in riscv_isa_extension_check(), because the dependencies may not all have been resolved when we probe an extension (Clement's current Zca etc series improves the situation though by only calling the checks after we probe all extensions). The simple V cases are all fine though - the DT binding and ACPI rules for compatible strings all mandate that single-letter extensions must come before multi-letter ones. For riscv,isa-extensions we control the probe ordering and probe V before any multi-letter stuff. Additionally, we should make it a requirement for V to be present if things that depend on it are. That said, is it permitted by the specs to have any of the extensions you mention without the full V extension, but with one of the cut-down variants you mention here? If not, I'd be more interested in figuring out the non-extension dependencies: whether or not the kernel itself supports vector and if the kernel has opted to disable vector due to detecting that harts have mismatching vector lengths. TL;DR: I think we should add some checks in riscv_isa_extension_check(). Thanks, Conor. --ILfmNxMoEmQr18uK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZjx/qQAKCRB4tDGHoIJi 0nmVAP9L+cHjupn5RAFkHpZYc5Cnnq2E5GdciRokz+M5dfaZiwEA9ymnxi2cQa7X f5iK/7u9QwmQNblOabpPI5z1wq28rAo= =dW2A -----END PGP SIGNATURE----- --ILfmNxMoEmQr18uK--