Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp47153lqp; Fri, 12 Apr 2024 10:05:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+QicVQhuBMI9XbOYwiMqBpzZFHJCx0CgdTnTbrttpO/ULVrXkZLLLIGBASRnANAnwAhOtUC/8sV8syzx6l5BmFg49wA34ZctrW89nPg== X-Google-Smtp-Source: AGHT+IFDNhf/UsWCQLJfjEKqNqTqLaJSe6yKtRyLLUhHwbU9pQ4d/EDEapH4yO5/xN6Wg8gXu/0n X-Received: by 2002:a37:e116:0:b0:78d:5f25:ef66 with SMTP id c22-20020a37e116000000b0078d5f25ef66mr3604395qkm.50.1712941516587; Fri, 12 Apr 2024 10:05:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712941516; cv=pass; d=google.com; s=arc-20160816; b=rpUP5zNXnnj7oMH6uP3e5o0vR5zGUZMh3gVY96P6IWQ9V+24LWZQAwVjxYLOzEvH2g 3i4hpIzALKPye18WJ/i6fBZrY2VAulm7ufIpMZNugz2HlA+Bo5B8TIkhJqTeiTU3Y6/z wpvC9jvEYVajcdITPhDWPEwU9NIbIvyF9Z8mIeDDtWoDXjhF1ON/7wWKVSNGgKrE5xuy E9PWoU8197dg8KpZYDd6zatktVeozLlzH1cE7fUBADRo2vzJc+YzSnzouX8mBxFWM5WI CRtuh6Z6dE4hsOuDNlA7iqFo8+2nD2UG0qJQUrdAjqr/PLIe+RB72WP/yzWUIHNi2JC/ KzeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=tYOCD7qA19/JAXwkJAfYs6ERNWjQ6TGuUnce7Ev3h1g=; fh=T+byEkbqVWK2Xhbyy6zsjbbM6H+ECRiiMaOfDwbPQ7I=; b=z1Ku4Hm6LIYxm8yBvQgdFKvhDlzlERhwdktmDWK0ejTcmtbWGDnqab/ptE1oGCfdPT JbHK82Qo2O5zmKWpjdZuQ9/pY0nVWw/VQiwk+bbaQlzulDQFYTbTuMleNWkKMr6b2bol UT0wEv8pyO11h6X2nKnbQW47ezx5D71dXwvzRiV18XSK2+8J8YmFJi37+qbA87MIJRNJ Eru3yv678JirvqJG65GYoemFX9EYEgIyBBOHfiinKWPOdFejhQmvJbgUu5A6u65HeESS Te3NAuSquNwv6k7Ht/FDGYTBsbRPWtDMbN4QXVCMaPds1roZckV3AlyBkhPBchbrspcX J4eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Xr7YNenY; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-143108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143108-linux.lists.archive=gmail.com@vger.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 u1-20020a05620a084100b0078ecab1c99esi2048851qku.143.2024.04.12.10.05.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 10:05:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143108-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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Xr7YNenY; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-143108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143108-linux.lists.archive=gmail.com@vger.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 E65CE1C21EC4 for ; Fri, 12 Apr 2024 17:05:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61D9614D2B1; Fri, 12 Apr 2024 17:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="Xr7YNenY" Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02F3814B098 for ; Fri, 12 Apr 2024 17:04:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712941496; cv=none; b=kSziFaTdi51NwjGf6yKyXSc6BLMmuoIhoLLhjc7br4Nzj8yKhHIsGjY63MlTEPJsMiRASgnq+qnjaF+64FfpfqAPs5m6eN7MiSR1bJJNF+aXKzWIFj9u9uW/zOQJC6fmjySM/ojMQIqeZa3BhyR8cil9Qg16KwLiA1lpnpv+Wdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712941496; c=relaxed/simple; bh=tYOCD7qA19/JAXwkJAfYs6ERNWjQ6TGuUnce7Ev3h1g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Tx1R1jYXfZ+LtwF9KSO2FukKJ6QhmtPYDYD/oUQgLQxvAcaiiBnihh1xWHON3fpneG2IZtFQn09I6vA9WjFvQClWnp6etHI4FFY75tK7raC0EhPNnfmbk3ZwvKt808uPx7rzmATqKzazIy2CFOZT+Fwu4tXklmGceI48EJHxWUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=Xr7YNenY; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d717603aa5so13563101fa.0 for ; Fri, 12 Apr 2024 10:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712941493; x=1713546293; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tYOCD7qA19/JAXwkJAfYs6ERNWjQ6TGuUnce7Ev3h1g=; b=Xr7YNenY6z2UXlDKpvatz9/y1VFS2A730bzjHAjR79X8VFwTti2DMi3xML+1KdltHW D481BNNJNaMn82LYh08nxknUD3HZhhUuTB9CScjtNbIkClnjmPgIriaj9+V78+LyYgo9 ov/9zQvH0yMwqe4rD+uonDlmQnsQ8f0AThhngxcA2quv5Jw0E1edq7znJpigHEcn+Jef VN6+a0YxzHcO2vLQvfPrXD0M92LkZc1NOVs1a23n6R8YlIEoX8V4xFjeM9F136dSSW80 Eub5ov14n4cpEpK6aXVPojI7nMz/6qidBx3qkqUrj0h9Q9QAuBa25sNfueiSaAlpuBC3 iL6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712941493; x=1713546293; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tYOCD7qA19/JAXwkJAfYs6ERNWjQ6TGuUnce7Ev3h1g=; b=TU89cb5VeNsSbkC/4HyNCsHLieiAwmw7g+zJR1/yAUcu5jVrwYs0KUU2Kn5TZWCrqH 3B84dEbfV2zVpLLxbn7OuipG/MDgpO0XsxwQViHx6qA2Seo/YhO5RIlCzVm2oPHIIcSr XRwSb88C0tlX5McLmo/xCYs/Bs9d+lm4PXsG8C9S0xj0akzuW1NBkHjJgbNGyDjrWEcF ovVWNWv4xIrAqrH1R8tlfrqAkN3IrMsJ+ryJRoDCBGf99KI+TvRRedQSzZwPO2wXuEpx ui0tqHZPH+w0n53TfML32TvG6Bs32P4BlAaEEIURycqKqFrmZc5ruIPobA/JXMaI3Peg IeBg== X-Forwarded-Encrypted: i=1; AJvYcCVLnTiDEAKKRA9VvJB8LKtPo66sb2JzQlgtF448EIosz61ni2iAeGwf2LLg0omup6jyakm5DgHlC4WqLNnkkumNAZQl8ebYgvdb9Hzf X-Gm-Message-State: AOJu0YwacwgWYYsnow71B9qymySk6AyetCuKFym/1YQppqQFbsmuj0V/ KgNOaqR02j+OdlmbKcAM4Mi6CqyoRDk6SrsmtGFbN4PkZ965yjR5Tang4t5qwsHU/OCu/ePN3nU aCNwhwB9+8VnnkHBEAiE0lBg+J6/18syaf/tBpQ== X-Received: by 2002:a2e:95cc:0:b0:2da:7af:e6a0 with SMTP id y12-20020a2e95cc000000b002da07afe6a0mr2360061ljh.38.1712941493181; Fri, 12 Apr 2024 10:04:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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> In-Reply-To: <20240412-tuesday-resident-d9d07e75463c@wendy> From: Evan Green Date: Fri, 12 Apr 2024 10:04:17 -0700 Message-ID: Subject: Re: [PATCH 02/19] riscv: cpufeature: Fix thead vector hwcap removal To: Conor Dooley Cc: Charlie Jenkins , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 parsing= . > > 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 o= n 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. 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. -Evan