Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp52260lqp; Fri, 12 Apr 2024 10:12:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnwRP1UxZgnDp7q6xzszNnjXVQluez8YMXtd8pvJffeveY3pIPH+ZSv7t2Vx9dhQ7rI0QEaqCxFZwateppZryCcYysd9TpDbMJhMOoHw== X-Google-Smtp-Source: AGHT+IFyrhVMjYcN/G4A2zybMNRTyGc2KN0vtJhiUmNoqiMWepbloqp4yxBPyCLOOWqtviKNG8+F X-Received: by 2002:a17:90a:c397:b0:2a4:9836:aa2c with SMTP id h23-20020a17090ac39700b002a49836aa2cmr2970141pjt.28.1712941954228; Fri, 12 Apr 2024 10:12:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712941954; cv=pass; d=google.com; s=arc-20160816; b=JLBIEcv5RjNbvR3aPP3FZITeLvSX9bzPhs2vgWT9hiIiiDVYWsk7Leay07rziBfXy7 qvz/cGYt5Rte3Qm2Fm3uv0gFfg9Qn8QNIjKZZSRk5yTavg4yrBiMDG4lBcXV9ZvOGlfc oKzKtw4pKKicXXEdefwWtj6HVbxiZHm81B8Mtjv8TSFpFEkaPu/2vjfdHXB+Yiyb2GBq LYosRM+zjBT3fBwTHxm64Vv2lruRAHHi4JOA4E23T4ax1+6+HlPN6UZxPxbjvQgFpF5z +OmTdvI0PmpL6SIaWNiezSDbT3tYZkh7QIJ3kz5DzN6+YSQ9HLkzR1XMyOlx1icApITv 1kUg== 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=V6RQsJgA0sqhyVb4iUdwKlWBxVZP7PvFbdqSmnVezOg=; fh=17S64bsz5D64gva8K/nO0msHvXTXnmWprO+8Ox9Aq7Q=; b=yUR3ZdUPr4AgQkEpelSHG57BGcx4aFObPbn7+ys/5qNpkJ2DTRWqAu+eOl7m0cvVOm IJ5djfMKCgp5MKMahOZsZkjVXIqwISHA0JWXI/PpznzmnbgOT3UzUfidazCEGsvElSpt z/6DUQlhMP9eTL3TiOLrCDalge5Kw5cD3GDbJpPT7cUC9nWBI72kdUjZjyQTUQrZa+lc ZVdhGppN3wg3kS4MmoAHBNmjj2DNBZR2vbC0z8+Mg0bLi/Or/QwwLdz0qfXmK//NEjZG x6TCUZqxD490L76zNbQHJ9qRAVvHo1jyMQcGzPOXTA7oVlxB2+6A6dPVN4VzOXJGPpJP uDDw==; 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=D+RLPQOu; 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-143117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143117-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ss13-20020a17090b2ecd00b002a763fe2b52si150691pjb.50.2024.04.12.10.12.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 10:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=D+RLPQOu; 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-143117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143117-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CB39A285817 for ; Fri, 12 Apr 2024 17:12:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA40914BFB1; Fri, 12 Apr 2024 17:12:26 +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="D+RLPQOu" Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 96A1414B065 for ; Fri, 12 Apr 2024 17:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712941946; cv=none; b=UNWfOfJu3ELjdqzNwoZ5KV5sxb4872rJRpHkh6gsMx8mDhRPcUpH0TDBYU+XmQt1OpdOlQAhHsY6ig772YgYtwOwUMqZS4AndxHYUuEahw/RfwbLLnAfzB3Lyr70e6yQ4yTtJFNIoVgDoYZZy9mN6HONjD3zo1YFhWcbe+ajUx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712941946; c=relaxed/simple; bh=zqFAuUa4RtTLPiQXk/lFHSFz6oHcmMCx6C1nVyRW8AM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VlbTEsGjkXPcNX44Q5PX4rru4N+tei5tJI8TBg2emWZKZ/1NObsfxWX6GlyhofCOUZZ7TJIOB89SxwmlJGQwaD5iVPd3JlzsN6VImCkfjMMoLNoU4M8wIJRv3zNQn3QigbFln0UQKzsu+RiAsIg65GGaH2TdMUUBmGLHYeMC4TY= 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=D+RLPQOu; arc=none smtp.client-ip=209.85.215.173 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-pg1-f173.google.com with SMTP id 41be03b00d2f7-5bdbe2de25fso849949a12.3 for ; Fri, 12 Apr 2024 10:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712941943; x=1713546743; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=V6RQsJgA0sqhyVb4iUdwKlWBxVZP7PvFbdqSmnVezOg=; b=D+RLPQOuO59Frl872Dq1M1BXp+H6DMxSrUpYFhphqoStzdMR5F5CmS+v7VjCYYBFk9 VyxPjF2P2a1sfW38Msxs07wCvPIk2OrtWZgnAsOywGWA3zUK9yUwUDtvhnE/C/mBYoR0 3a84ssdOeskMF336DP4192GCjKJfsIckDwa0AMlqoR1t/B1NK6oewhuFNNL7FsK4nhuS /1yWKDVCK68KPbJyV6Aduv9vOwdsH2s11d3Oqhj42xAmT4gl2Di5xiRfsPjFvNi2Dkcw dT9j3BRnG98HpCXMy7mPTICPjclKHObbjsaoZlVL20yrmIJIWgErGX0eAuoTxXaWQj8T Klrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712941943; x=1713546743; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V6RQsJgA0sqhyVb4iUdwKlWBxVZP7PvFbdqSmnVezOg=; b=Dk4yt0nFG03lUR59I1IbJ+OTBE6EnfH2fnyoEKSvg5F9Mn9nTZCbshjP0TqzQ77Klw eUs0P8KHsDKnT0cIhWx1ZL2W2o/GW0angoQJioCoRGKiqtaF85lLyOND3Qe0xraiMTsm N6fw/wCuOZ3/bXiBPbREWhE5hgqgbrUCJiZN2zMcWVtLq1PR8khpCjGGWyhCARyU6fh1 57UsrrV2hNlzVAkiZimLrq3ro+D0QEQ54YiSoq2Gb9wZTJH2jLl7eizpJNHggkndaM9n +AFDEBARoeJHfVtDKgkI042+/hFJRyLLCAU+k08w92zim8hscRvU7ORX0yHZmsEUlKJD xCaw== X-Forwarded-Encrypted: i=1; AJvYcCVaI8BTVaQG71AwQWcTXHgBojdQ8kP+0w20Xo1wkBeNfQQwwQCUsIY4xZ7eeO6Gi09Y5c928hxPJeXsHgoFL2DMgk4FqlFcFePmmnMP X-Gm-Message-State: AOJu0YywuLwBi5QCrYlRw0XJTYseZGdozN3gWgjVSO2xjyd7oSRjUKtg R+RPN1XGy/idzx7/E0KdSNYCdcg0tmHrzJVxMkLfeLjB0aMYEZIiyXqL5KTBsb8= X-Received: by 2002:a05:6a20:550a:b0:1a9:4343:765f with SMTP id ko10-20020a056a20550a00b001a94343765fmr3511412pzb.23.1712941942911; Fri, 12 Apr 2024 10:12:22 -0700 (PDT) Received: from ghost ([2601:647:5700:6860:121b:da6b:94f1:304]) by smtp.gmail.com with ESMTPSA id u4-20020aa78484000000b006ed59179b14sm3114754pfn.83.2024.04.12.10.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 10:12:22 -0700 (PDT) Date: Fri, 12 Apr 2024 10:12:20 -0700 From: Charlie Jenkins To: Conor Dooley Cc: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , 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 02/19] riscv: cpufeature: Fix thead vector hwcap removal Message-ID: 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412-tuesday-resident-d9d07e75463c@wendy> On Fri, Apr 12, 2024 at 11:25:47AM +0100, 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 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. Yes, the DT those shipped with will not have the property in the DT so will fall back on the boot hart. The addition of the DT properties allow future heterogenous systems to be able to function. > 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. Yeah that is a minor optimization that can I can apply. > > 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. They have an mvendorid of 0x5b7. This is already falling back on the boot CPU, but that is not a solution that scales. Even though all systems currently have homogenous marchid/mvendorid I am hesitant to assert that all systems are homogenous without providing an option to override this. The overhead is looking for a field in the DT which does not seem to be impactful enough to prevent the addition of this option. > > > Signed-off-by: Charlie Jenkins > > > @@ -514,12 +521,23 @@ static void __init riscv_fill_hwcap_from_isa_string(unsigned long *isa2hwcap) > > pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); > > continue; > > } > > + if (of_property_read_u64(node, "riscv,vendorid", &this_vendorid) < 0) { > > + pr_warn("Unable to find \"riscv,vendorid\" devicetree entry, using boot hart mvendorid instead\n"); > > This should 100% not be a warning, it's not a required property in the > binding. Yes definitely, thank you. - Charlie > > Cheers, > Conor. > > > + this_vendorid = boot_vendorid; > > + } >