Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp49466lql; Fri, 12 Apr 2024 03:27:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURVzW2gJhy/WbxuZGVbycGscOHnlM531NA+tDLpJ45ViuiVocrrKoJ1brLknGMMjj9+lBC6eyjbeBkp/49A3mHxcKYEtk4olvi9GER6A== X-Google-Smtp-Source: AGHT+IHRGI9t+a9QheaLiQv5TwPn1PJZwxm2zF8rt2qrirG1CVwkJtMWtpf8yLkuxnmzQwFkgETm X-Received: by 2002:a05:6a00:a8c:b0:6ec:f28b:659f with SMTP id b12-20020a056a000a8c00b006ecf28b659fmr2348726pfl.3.1712917652813; Fri, 12 Apr 2024 03:27:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712917652; cv=pass; d=google.com; s=arc-20160816; b=v2nHmQVL7wnfZxnGGejuCEU+QJ0j4+cpw5ztPBWWpe2+9H4CrH3GBwErtyVfZTltv5 L3l5TwVHiqN7YiUcj0OeiFxhaAKnxyz+QZ5Ztz4o9L6F2umKGGq79DIPEn75Eyb1OYYw IhB08frJXGrbvpu8AQbip4kcdNSBMfYjB639XlhrxohNI/qLu0YeXskI4MP/ReKIx5NX d/FQ5DaeBlkgZpiqOiq61X7KASMPHI5J2oYuqREqphoerGwG2fPnszkrxmWU/I2Cfp3/ oq79U/gakPsKshXqXk1QFPyMvcDiymNpEVTF9VnmCN5lr76uWVqcWBtsDGEFMnvmzCw/ m6qw== 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=teeSVPGs8jK3FdllqvDzr1yH9/shpEM1TNC2nCiRD2Q=; fh=4jyGPlIgBC+cOBl2betKVRRu896Cfe1VEzAQNc3FCOU=; b=z3aWeznRqZoes0b9EIAIKVurcxDSt8LteMhuPsg3370Fuy9yMfOftVsCAuVe7Pn5j9 hyOvlpiyUBXox7qhro78OSLyQj3xJuRCLN1ukmGEZckbOltKcFHzfK5FH7FSWHwWu0zn oW+Dwj64vlP4kyQEESx3gUfrpJHS9Qk9W+Bo5Svfz3OYGaxAbhpFl+IbMrtFTsHFjR0u Bt4F6F98mPsolQ64C+AIu3x6zjvzxnuIcKKggZsENVNO2vrm4zRLNqOoE1qEVIFqwqSK lCA0JF/POQig8WrYpflvq/rq8Ynv5RhLS5Ub7vQTgNfsRuJKBIfs4NTXZ3EjN+P+2Pn7 7TGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=lRQnW+lm; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-142496-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142496-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x47-20020a056a000bef00b006ede4553cf8si3047633pfu.106.2024.04.12.03.27.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 03:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142496-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=lRQnW+lm; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-142496-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142496-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com 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 227F928604A for ; Fri, 12 Apr 2024 10:27:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBD2F53E1B; Fri, 12 Apr 2024 10:26:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="lRQnW+lm" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 D9B7653E16; Fri, 12 Apr 2024 10:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712917613; cv=none; b=od2mWTXwCglC2tIj5Nc33X7dBomn3p3/MNspcQba+HHppECPU7jxfu0BOSh7F8V6eO6QU6aCByPS6vzqsxt8AKvQ+iZLUSBEGZZr/6A3n/OYh7SZZLj5N4mRVLHBxpIZTPPctyYCwj/PJUFG+kTVk8DxcQHTGUhaPa2uDK7lF84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712917613; c=relaxed/simple; bh=40Wqfd4r8w7pmze5vM3OJGtDYx+IFl6psH0Cqec/ypk=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U8UIfWcnT9ci7FsbgXXRFXOf+hmXngAexlSeYCWJRGGosPIBepSzOpQVrCjtp+Fa07gh3/uG2gV63qKxQYSrJcwDU0cywgifCAEg5ibbtN8yE4uSIBxOSs/jfZBS3CwxA5xc1n4vFJha5vZ6WQ8XqLxMqquK0cXa4Ly9XyTALFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=lRQnW+lm; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712917610; x=1744453610; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=40Wqfd4r8w7pmze5vM3OJGtDYx+IFl6psH0Cqec/ypk=; b=lRQnW+lmw/ugcL+EeAwVlQ9h+O2E4vuk98PZxGapJqzeBWlPOyA5/BId YTzEh2G0HyCggmnxQpZ/K2BtKdEnnS//61XNZjLklIM+vShe/SyOQS116 F7t9dMkYRRQVx6hbVWMrYr/RTOeZ8gHCUpXiREzSNig1z+2O1NESuaAg3 csFV7HE9ZSqr2iEUibEnzEDJtvHrg9TaCArBJ1MHFV4vTdR/oAlBLwWIG yohc25n4oWEl0A3phVdxRSgiTEsUlBZcuSOWAO6omZ/BPiPkgjgdPa34n g4X8tZTosne0NBJ1eLjlF/9lQqG13dDSAiC3dJIIBpyE/DvkLNJOPxHJw A==; X-CSE-ConnectionGUID: ZU7OXHjzTCmT3jYqw1Xv5g== X-CSE-MsgGUID: x9xw3+4GQs2S7ff9t2+dXw== X-IronPort-AV: E=Sophos;i="6.07,195,1708412400"; d="asc'?scan'208";a="188003463" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 Apr 2024 03:26:48 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 03:26:42 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 03:26:38 -0700 Date: Fri, 12 Apr 2024 11:25:47 +0100 From: Conor Dooley To: Charlie Jenkins 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 , , , , Palmer Dabbelt , , , , Subject: Re: [PATCH 02/19] riscv: cpufeature: Fix thead vector hwcap removal Message-ID: <20240412-tuesday-resident-d9d07e75463c@wendy> 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> 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="9J4y1ZtcO1sNylrs" Content-Disposition: inline In-Reply-To: <20240411-dev-charlie-support_thead_vector_6_9-v1-2-4af9815ec746@rivosinc.com> --9J4y1ZtcO1sNylrs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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 =66rom 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. > 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 b= oot hart mvendorid instead\n"); This should 100% not be a warning, it's not a required property in the binding. Cheers, Conor. > + this_vendorid =3D boot_vendorid; > + } --9J4y1ZtcO1sNylrs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZhkMKwAKCRB4tDGHoIJi 0v68AQD669QXYYGZU4Sw+Wu1jBsENutdxevRVfy9dIk6oB75uwEAp3mGiS9zEGbC gOmDF/36Lm2Mc4K4SgfZISRAD+65oAI= =tAZ7 -----END PGP SIGNATURE----- --9J4y1ZtcO1sNylrs--