Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp535074lqo; Thu, 16 May 2024 13:31:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAJkW47TBVZKjJKYeSVPgNiGO0PyH/YRGLbRAFWbPm2tGPTthElFw9Yzxk0IxBnCzsioGxsx87RoVZQvviHee+q95+2wB89lebWvUyrg== X-Google-Smtp-Source: AGHT+IEnuIa9QZBHBXFNhD9NQIKbNgYpOuP2lU1tfAJ+gEs7vG5bIieBsO9T7ZHsiSbSMVfyep35 X-Received: by 2002:a05:6102:3e26:b0:47b:b8a7:7ddc with SMTP id ada2fe7eead31-48077eb4acdmr25375131137.30.1715891480584; Thu, 16 May 2024 13:31:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715891480; cv=pass; d=google.com; s=arc-20160816; b=ThBeK9Bpscx4Co0cCEAL9SWqW7JohgiyBencr2UCQh0mGl2BZqD7baVTTqpqDBe05i rXXrR8Gx4Tp1z8IdXevYo1C4I94a1Rne4Ag7MIDWBz175T2yN4Mwmm0O7fDZMOzqz0xn sF5a7HuBpifDhoNthMcrAvouoxrjT+nGlMmv2WXDPyciyQd3vzWzknZtcCswUufTEurX fh2qxghR8plGBInLU1uR/16Y+3zvJlK/dZIMO64PRT8YjuSrK6pJkMflNVN3BTMW8yv+ HDNuWxCEXEi55eFzp4OxW45UtoeKpD3z/fl6mU30Y3hIaosRC6yIFZVK5NnuJA+bcs+3 VPxA== 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=KH8e6QoW8OwgR1QpvcBvm2psR4bhr82+y7qWRupDrTU=; fh=m1Y4S+o2mk09aebC9f3GSCtAKrUuiqpWmsG26wFNy6I=; b=X1UKzn7lZu1b2RlwuNfbWUTeuZUNqjGRH8g3hBXjRsE1vXkKpoyi2lRauPvEGyS/sL geWZ44bTi9SQT1cw8FiZXB4oIbT4ou5HT+C7fG7eUr8kymRaWm1zsdujOTlsx85+J7Px JrnCxmojJVwEz4pB7cDcNB+wq1kGyipDs+XHONqvuyNwGGRgQooC6exn0n57JSrpCWSb yCnrC5Lg2lwWWjsaOlQY1CCL5lJKlysKjcGmmwriCCVb1PRtCjO4PGQsCKkOYauces5a l+SMLblw9/8UhpgV/9GKw5OQ6wN/BK3L1Kgi6XIpBqnoSb5nyKbyGzEqF26ONdt1qIDX oMkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dDAWhmUD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-181565-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181565-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-4806cb7e2eesi2780100137.80.2024.05.16.13.31.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 13:31:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181565-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dDAWhmUD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-181565-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181565-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 497F81C21385 for ; Thu, 16 May 2024 20:31:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFE99157E78; Thu, 16 May 2024 20:31:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dDAWhmUD" 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 02A27139F; Thu, 16 May 2024 20:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715891472; cv=none; b=C4WanZoJVEq0EZ/whcMMb0yHtlZBxzOacfRF1e9eDf2fzwLbfNi+5pmrs9xXsy+Ng8R5DmghgpWkiPeNWrpufNDZv10BHU6QNEl3VlNVUNPKj1Xelv4DPSUDSM3x00mjxtKMIavFHwN7oPTPiMm4N1OaDRzhAd1gRjAqfD5Mwww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715891472; c=relaxed/simple; bh=vOAyXMvMO4/iJmPTXPfyexrttf8zBjbSgvoi5gnjzLA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tNLvogHrO0c2p570qXRzxGXHHuGBINs51B5/j+66FIsxhHVvE5evJwhrafD6i+wMXcN2+KEOqgc04iM+wlFzcBvo+/5HHjz3JCqCnvPz4JRAXU9gtkiWjLzs3sPFpZxvS6cnLdwsBMFyk9MuC1ZJcx4o/9LX2iCg7eDSMT6lQr8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dDAWhmUD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5EBAC113CC; Thu, 16 May 2024 20:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715891471; bh=vOAyXMvMO4/iJmPTXPfyexrttf8zBjbSgvoi5gnjzLA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dDAWhmUDmLUiJb54Uja30vFjFw9q6NBXP74EOnCuKC8gHyhMuGeRboksCf13pFIJQ rUG5cbU3P18kx+EqmNzzOa9xJsYGNRBuXzKmlMFge9ZqMr6Wh9rJRQgUfPm5AMqGP0 GRqELF2/2r8X5G7YT1C0WY7xdp7oodx3Z47FIVS4O+uOLNKfohAPMByTt+u7Sz0LWS WDd62ipGaHqfNN3abosA1QOOV7K+aYDI2KEZs1kaUQTGR9+CbXOZsgapkjBtIeuWri AN9qyObaZ2Cv/3jMm51bZl3nI90Yvvna1Ko2XgxVzEJqsgvt0JZt/EiSMcYUoo+x0W qk2FTzTBilR5g== Date: Thu, 16 May 2024 21:31:04 +0100 From: Conor Dooley To: Charlie Jenkins Cc: Andy Chiu , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Jonathan Corbet , Shuah Khan , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v6 03/17] riscv: vector: Use vlenb from DT Message-ID: <20240516-sleek-wound-f835b3bf23cf@spud> References: <20240503-dev-charlie-support_thead_vector_6_9-v6-0-cb7624e65d82@rivosinc.com> <20240503-dev-charlie-support_thead_vector_6_9-v6-3-cb7624e65d82@rivosinc.com> <20240516-grandkid-monday-86c698ca4aed@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="HJGHkHICZT5TWk2k" Content-Disposition: inline In-Reply-To: --HJGHkHICZT5TWk2k Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2024 at 01:28:45PM -0700, Charlie Jenkins wrote: > On Thu, May 16, 2024 at 05:24:25PM +0100, Conor Dooley wrote: > > On Thu, May 16, 2024 at 10:00:12PM +0800, Andy Chiu wrote: > > > On Sat, May 4, 2024 at 2:21=E2=80=AFAM Charlie Jenkins wrote: > >=20 > > > > + if (elf_hwcap & COMPAT_HWCAP_ISA_V && has_riscv_hom= ogeneous_vlenb() < 0) { > > > > + pr_warn("Unsupported heterogeneous vlen det= ected, vector extension disabled.\ > > > > + elf_hwcap &=3D ~COMPAT_HWCAP_ISA_V; > > > > + } > > >=20 > > > We only touch COMPAT_HWCAP_ISA_V and the failed case only turns off t= he > > > rectified V. So here we have nothing to do with the Xtheadvector. > >=20 > > There's nothing t-head related in the tree at this point, so doing > > anything with it would cause build issues. > >=20 > > > However, I am still confused because I think Xtheadvector would also > > > need to call into this check, so as to setup vlenb. > >=20 > >=20 > > > Apart from that, it seems like some vendor stating Xtheadvector is > > > actually vector-0.7. > >=20 > > The T-Head implementation is 0.7.x, but I am not really sure what you > > mean by this comment. >=20 > Andy, the idea of this patch was to be able to support this binding on > more than just xtheadvector. >=20 > You are correct though Andy, this is a problem that a later patch in > this series doesn't disable xtheadvector when vlenb is not homogeneous. > I am going to wait to send out any more versions until after this merge > window but I will fix this in the next version. Thank you!=20 Agreed on all counts :) > > > Please correct me if I speak anything wrong. One > > > thing I noticed is that Xtheadvector wouldn't trap on reading > > > th.vlenb but vector-0.7 would. If that is the case, should we require > > > Xtheadvector to specify `riscv,vlenb` on the device tree? > >=20 > > In the world of Linux, "vector-0.7" isn't a thing. There's only 1.0, and > > after this patchset, "xtheadvector". My understanding, from discussion > > on earlier versions of this series the trap is actually accessing > > th.vlenb register, despite the documentation stating that it is > > unprivileged: > > https://github.com/T-head-Semi/thead-extension-spec/blob/master/xtheadv= ector.adoc > > I assume Charlie tried it but was trapping, as v1 had a comment: > > + * Although xtheadvector states that th.vlenb exists and > > + * overlaps with the vector 1.0 extension overlaps, an illegal > > + * instruction is raised if read. These systems all currently > > + * have a fixed vector length of 128, so hardcode that value. >=20 > On my board with a c906 attempting to read th.vlenb (which is supposed > to have the same encoding as vlenb) raises an illegal instruction > exception from S-mode even though the documentation states that it > shouldn't. Because the documentation states that vlenb is available, I > haven't made it required for xtheadvector, I am not sure the proper > solution for that. Would you mind raising an issue on the T-Head extension spec repo about this? Thanks, Conor. --HJGHkHICZT5TWk2k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZkZtCAAKCRB4tDGHoIJi 0iqUAQDoE9mZU3cwwi2L0msRdNJfiKf3sHdTRqTyprp8fMkE0QEA+E4AIm1pM5DV TplcpCK2uFfwFdtBhcs80nkZCt5chgo= =Mu0n -----END PGP SIGNATURE----- --HJGHkHICZT5TWk2k--