From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2FF3D334688 for ; Wed, 26 Aug 2026 09:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787735218; cv=none; b=XD2M/0Wvnpxu+eOpnlNhsRtkUU4HRvuQUnQ+NFPUbiUH9UzeGWn1Ql0R4HPTg28GwLV7BCC2ZreVGnwsuKh1kyTZjZU00Zv65Zq+16S42Dq0NtFgFaqOzKM9UK4GoU/LnrMRXMoX+uuYV/Y4d1u+9yBljLCHReQZ3sEbGkkzQCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787735218; c=relaxed/simple; bh=dSGMPneMfZKQ0ZYKn8QArG0aOC8EFyrNhxpT6fiRsbA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gh6FLmfrnFWt0jkhFI391Y02tSMNYfht9cbDLSxLrjMU3QyN/HyWDgUjEWy4dQlKPUUq8HtizzEa6l+8yUJUFR3NZVANj1WPpmF/2W45wAOlBLtcNKKj6CB0WgTz4IaMAb6gfbvFBBpH6aPC5Uh5U1HiPoTy71j6uncQyqqIxHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gTGCPmH1; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gTGCPmH1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB5671F000E9; Wed, 26 Aug 2026 09:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787735216; bh=5Zp9HVJGLJXFioAWmyLaqG8DBEM9eunnr/XLWmrWKqc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=gTGCPmH1YwFWcXRbvM+YXFZr87qYLjoZdA2/ox+EUR6b9fAA6Q551yKKQsNYV3/yl CJmk/6Y0nzoL9PKvOHdXv4COHUtfve8dpZIzk7Sy/DRhbuwO+Sfq3/GS1grxQd2rk5 pB0vXBRpq09Xa3r7NCasJ204I0z4vwNDodkcL1B9dF4VdU+pznoQ7kEijQE7sUPFyE poJKOCyA9DCeTXYC444robNUku8AxLZHVEX6a7M4fFlRRfaRIX/V32t/2isC29uy6y EC6fw8Q41ddp0UaOt35Gqz2zJJbTaEELD1+q1fR/pme29LI3TI7M1TbA4gWHGnPv/K hDmjpQtRZ8rHA== Date: Wed, 26 Aug 2026 10:06:52 +0100 From: Conor Dooley To: Andreas Schwab Cc: Ivy Lopez , pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, andrew.jones@oss.qualcomm.com, conor.dooley@microchip.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] riscv: hwprobe: fix has_fpu() to require D extension only Message-ID: <20260826-coherent-foe-41863a83bc80@spud> References: <20260825191950.42614-1-skunkolee@gmail.com> 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-sha512; protocol="application/pgp-signature"; boundary="evfZneV6jjhPu/de" Content-Disposition: inline In-Reply-To: --evfZneV6jjhPu/de Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 26, 2026 at 07:53:05AM +0200, Andreas Schwab wrote: > On Aug 25 2026, Ivy Lopez wrote: >=20 > > The kernel never supports F without D, since D depends on F. As such, > D without F |The kernel never supports F without D, since D depends on F. As such, |has_fpu() checking either extension with '||' is incorrect: it |reports FPU support when only F is present, which is not sufficient |for D-dependent state save/restore, and weakens |RISCV_HWPROBE_IMA_FD semantics to "F or D" instead of "F and D". Thinking about it, this whole thing really is not right. > The kernel never supports F without D This is actually correct, the kernel itself doesn't support doing this. > since D depends on F But this is not the rationale, the rationale is simplicity of implementation etc. > As such, > has_fpu() checking either extension with '||' is incorrect: it > reports FPU support when only F is present, which is not sufficient And this cannot happen, because the kernel will not enable F support if D is not present, it clears the relevant flag during devicetree/acpi parsing. > for D-dependent state save/restore, and weakens > RISCV_HWPROBE_IMA_FD semantics to "F or D" instead of "F and D". The reason I would cite for changing the is matching the expectations set elsewhere in the kernel, rather than impact on userspace or behaviour, since F without D is not possible so there's no potential impact here at all. Cheers, Conor. --evfZneV6jjhPu/de Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCao6srAAKCRB4tDGHoIJi 0iABAQC7qU1KJAa0TNawlU7Zt7hFd/iodzc7RI1QT19YcqvKtwEAsG8sUebC6w8O 0RcbM2eEtgPYhDRzz9r4+C78M/8psQE= =9uBQ -----END PGP SIGNATURE----- --evfZneV6jjhPu/de--