Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp102698lqp; Fri, 12 Apr 2024 11:38:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMVV4hzrouT7I/+dtSkfgwjVF0opqfyJ7McfGAPVML6IICTiHQsg2UooX+m1kgTvrbqBeloWyGJ05bSuR6XEHU0nwtYE4yopxDgnjG6A== X-Google-Smtp-Source: AGHT+IEKQG8fpF7KpeNP7cPl3YYs31ESQlNaex0HTkGEAmUxIQcKUfb6Ggv6l0MPqzDuAdZBKknY X-Received: by 2002:a17:906:f809:b0:a4d:f5e6:2e34 with SMTP id kh9-20020a170906f80900b00a4df5e62e34mr2261805ejb.19.1712947127860; Fri, 12 Apr 2024 11:38:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712947127; cv=pass; d=google.com; s=arc-20160816; b=gc58I13szhB/k8z1uTqiXcYdJFskemr+3hVhgVc0+Y/fGK3pYrlATJc04PbG5QGL4d n5Y7Vu1yH9IoPUzCv5XomRDD6c/Oo3jNoKlTP3wmof8pFNUPGuzEccGSSsDwKR7IxMwS t5rTSbugi34uwLk9G3d6GRtS1hw0Bh6UYZUNNUburmZdfOlyUgusccEKZa1sxFNOWoSb 8BRQ3mcnUce3gH8d6gLFDVU6jkf9zbI/eITjoVsMC6VQYCaWXfwJ3fTcH6j+g2kxoANB emLyLANX2nqi+nZnXKcFAk3kKjSpprXvtW1TGi9D5DDfnZdhJWe9J7V8T06lV9YOODtb DcPg== 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=F6zQv5ic7tyHfVnV+5BzE9fGTieop/gUlPWBQ1/NTQM=; fh=J2ivcnV/F5kN/L0kVqDnnhscFrqZacJciFL8KTrepTU=; b=CPmxX2l/agLq2ibw1nB0TV4LAM8BpOXwEYq5PLsluIHb4FtGpKGVQnUhJOkb+n2D0x Z/CncB5R0VvTrlUtlxGxePJRqmGidkiFM3Clc0PHot7Cj9ToLMpFvdAXBtHfuj4/Qv1U jJHMwRsC6LLvrSaufCw5mHQZZ+5EBEK7dWwmAgrNsgTaP6+yOkWUCx4+wPGZJ5GrqRhg 4Cugr/9kMzFZiqMXdnNpzD5oYSCAlYhEQG9Mzy2ZnoU7xCXjrvyib+D6YdCuLQrcnlcK RcuQo2KJa96wREG6NHCgaNuL/IH4mismSWX7W0QmIa+NRAzeJOkyhPNQEwkI/IBAito9 gfGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TqNKaNJy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g19-20020a1709067c5300b00a46629b7ff4si1942675ejp.966.2024.04.12.11.38.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 11:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TqNKaNJy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143218-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 97AC41F247FB for ; Fri, 12 Apr 2024 18:38:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3A8E14F9CF; Fri, 12 Apr 2024 18:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TqNKaNJy" 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 B16BB14F10A; Fri, 12 Apr 2024 18:38: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=1712947091; cv=none; b=GsE1x6v9u8m9SrxJSuxh4d557vYjmUq5+uGXhZEC/cm8cFOdaJfYd1/hyq72G6ACik8uLyb7dycu/1n3xr0gbJtRuS/S8CcSA+5ReknbU4LoQIudgrok+UwIn7E4o2Sc/LOsxOY7zMIr2nGxALEG2peYOTCfLOzXPrQ+2KqvhnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712947091; c=relaxed/simple; bh=F6zQv5ic7tyHfVnV+5BzE9fGTieop/gUlPWBQ1/NTQM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AfSxleR3b6sBM88Ik3b0iRLQyKdeSxlewjeFW01hKcqdmFeQGYghUox6A2oKEaHmT3OxS4qL3lylWLupm7OWJmfW3UyMn3NLzTq5LZ4Pt4//30FhsK6kwDHvgrXlCDzPeFU4C7+5YZAzqHWqB62Wpvl07+6B8zvhg0TMt5RYnVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TqNKaNJy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9E42C113CC; Fri, 12 Apr 2024 18:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712947091; bh=F6zQv5ic7tyHfVnV+5BzE9fGTieop/gUlPWBQ1/NTQM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TqNKaNJyrcbRforb/MYgMOxrEDl0SnFDz+UiLgKXR0VegcimDJL8+gNaAxjh9arLZ j62nWhmhH0h7D1Bmhba/CnW9u/YGgTofj+BAjD10gL0TDJCs0f3Z1UujiCzKi6GAFk YEK3dm5xQ8+PL2KeHe3w+isaK+CMqV7wVeCklahS/AVcxH4s+CpCV3GOFnMAoH1Gk8 IdV5QM/34y7EioeIdQiUM8Z/ntcFPAm3ef00weUono8+NlvVOID5lvimmTOKcm0lbr FeG93C8vNVD9g4HsuYhpsnenlo3aCiD7XrPo4S8dV5SLWn3U3VoSz1oBTBARD9gD+j IjG9UHOou+uXw== Date: Fri, 12 Apr 2024 19:38:04 +0100 From: Conor Dooley To: Evan Green Cc: Conor Dooley , Charlie Jenkins , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , =?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 02/19] riscv: cpufeature: Fix thead vector hwcap removal Message-ID: <20240412-employer-crier-c201704d22e3@spud> References: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> <20240411-dev-charlie-support_thead_vector_6_9-v1-2-4af9815ec746@rivosinc.com> <20240412-tuesday-resident-d9d07e75463c@wendy> 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="gRwXSR6OMoeFGriG" Content-Disposition: inline In-Reply-To: --gRwXSR6OMoeFGriG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 12, 2024 at 10:04:17AM -0700, Evan Green wrote: > On Fri, Apr 12, 2024 at 3:26=E2=80=AFAM Conor Dooley wrote: > > > > On Thu, Apr 11, 2024 at 09:11:08PM -0700, Charlie Jenkins wrote: > > > The riscv_cpuinfo struct that contains mvendorid and marchid is not > > > populated until all harts are booted which happens after the DT parsi= ng. > > > Use the vendorid/archid values from the DT if available or assume all > > > harts have the same values as the boot hart as a fallback. > > > > > > Fixes: d82f32202e0d ("RISC-V: Ignore V from the riscv,isa DT property= on older T-Head CPUs") > > > > If this is our only use case for getting the mvendorid/marchid stuff > > from dt, then I don't think we should add it. None of the devicetrees > > that the commit you're fixing here addresses will have these properties > > and if they did have them, they'd then also be new enough to hopefully > > not have "v" either - the issue is they're using whatever crap the > > vendor shipped. > > If we're gonna get the information from DT, we already have something > > that we can look at to perform the disable as the cpu compatibles give > > us enough information to make the decision. > > > > I also think that we could just cache the boot CPU's marchid/mvendorid, > > since we already have to look at it in riscv_fill_cpu_mfr_info(), avoid > > repeating these ecalls on all systems. > > > > Perhaps for now we could just look at the boot CPU alone? To my > > knowledge the systems that this targets all have homogeneous > > marchid/mvendorid values of 0x0. >=20 > It's possible I'm misinterpreting, but is the suggestion to apply the > marchid/mvendorid we find on the boot CPU and assume it's the same on > all other CPUs? Since we're reporting the marchid/mvendorid/mimpid to > usermode in a per-hart way, it would be better IMO if we really do > query marchid/mvendorid/mimpid on each hart. The problem with applying > the boot CPU's value everywhere is if we're ever wrong in the future > (ie that assumption doesn't hold on some machine), we'll only find out > about it after the fact. Since we reported the wrong information to > usermode via hwprobe, it'll be an ugly userspace ABI issue to clean > up. You're misinterpreting, we do get the values on all individually as they're brought online. This is only used by the code that throws a bone to people with crappy vendor dtbs that put "v" in riscv,isa when they support the unratified version. --gRwXSR6OMoeFGriG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZhl/jAAKCRB4tDGHoIJi 0ptyAP0ZNjBpBCn7hL8p0/KqkB5iLRYcgUFzEfFnnLIR4Xu6bQEAnNsKHlMQNDHe Gwr2lxxHHiZdULO9EWHcunPE1hXT4w4= =sTMn -----END PGP SIGNATURE----- --gRwXSR6OMoeFGriG--