Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1191987lqb; Thu, 18 Apr 2024 02:55:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVPWWFwbArxEo33ASAr+WVPI+dPHQVXeDAirA+IotYd6J3w9V1u2HpZkmrreNPrkPSX0cQNTCaex6vuqdyxtIlfFAcPMePkKZQDYEbwg== X-Google-Smtp-Source: AGHT+IFLTRS0HrMKSCy1tZFZa8bBMNHWG7l0japK46vIAF9h/VooZbZAvkqPfBznIA2lsIXTWL7I X-Received: by 2002:a05:6512:10d2:b0:519:5fdb:82b4 with SMTP id k18-20020a05651210d200b005195fdb82b4mr2106451lfg.53.1713434124378; Thu, 18 Apr 2024 02:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713434124; cv=pass; d=google.com; s=arc-20160816; b=ilpnvFH6aqdUnG5x4b+UtxgU8cDVXVOVOZHrSTJQRukLC8eTaKqNYAtYS/ojxOTWB1 V/fo67al7hlTds8Hwfxab0QGqSWK4TYeJujYsyMcFIduo4QmVGJY7bBrBc3jA54phitR uB49D73CEgn3MCeqCqCPBwGTLpldAJx0kqGOJ1Tw8fveNKCaO+095XIzfyppkSGxjPmh gKj8bLlkaOcVUs3FFPh5yRA7M44/Vis2p6v8jMHp/hG1pEu0cpK59GFAj0tEOx/xYusd xQiN5Ro/cdXKFnjy47UkYf3OrPU6qkscn6myRKPoCGNL4LaUhJOc6eAOUZ5YocqQ1Z3S 2XXg== 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=JquJLgUtGYTgZvO28nHMe828KHSl7W0lKyey0Hzzed4=; fh=CPsmOzCfVlAP8dR7BWxb7YcogGpBFmQ0cT6PFKMoHnA=; b=xYoXsNjQ/c1+cjbozdKUU7QMBLYHF8P/SeuvqyCAoWK7nAMa1gZ1kKqxSV74O1okff IfyB+X2bLt9aXywvYhaz8ZYGNk6LSg6s3NU3gRZM5gNxyB0Kskbyvjx7ojcgQqksWjl4 0+rhMVrNug0jAjk8oNU4RxCLSntvFSpL/JES+aXKHWyFUgIwmesg6e4iQ/y+Mbh0+twC yxm5cva1OdcmvYy/dKBEqeer+gUE1MHm42x1paljaxJ0DJrUbbfSlvphov/THO9w/Ry5 eMfEJmLWSRLyCaBe4ibrnJD8QBNexVb7KLu0QE0g//yB9VILRQ2JYjtYe8vgpx+yY74C lc5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=n6YUKBVw; 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-149851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qh15-20020a170906ecaf00b00a553d765fcbsi642764ejb.686.2024.04.18.02.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 02:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149851-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=@microchip.com header.s=mchp header.b=n6YUKBVw; 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-149851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149851-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1A5CD1F23623 for ; Thu, 18 Apr 2024 09:55:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66C7115B559; Thu, 18 Apr 2024 09:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="n6YUKBVw" 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 B40B015AAAD; Thu, 18 Apr 2024 09:55:12 +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=1713434114; cv=none; b=jdbIG+gEqDwBV1Nl1TkLb6K8KIav2KKwh6IORb6poLhE9DdLyJbY5Iji2MgivFGCq/lRX34tiL+WkY8WGILT1u7qjG7Lt/bMSjXgInr67GyyPl8nkUyN39BzANI/jdLUdTytyYwxOCjoCqtjpL/2KDKCgBPqjKM1YovQIT9H/tk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713434114; c=relaxed/simple; bh=duaR1AnrObmqETtxDghvr7defhHd1q2pgv4fpE/MLDo=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VruC80sYECNONcb+ArLC/6ky0kIQuW9mqHH907ndPYf9CH3v/QdaSCmus/NzJYWmnyk9dBDxLsUtVmapfob9ROnGDCCU8mwdi7NwRXqIwpZT46mEPF/SWsucs082dnEQuAi/Y1AhyHV2Y3i1v1zp+bWOgNzDs0aZjrwbK5iJeVk= 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=n6YUKBVw; 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=1713434112; x=1744970112; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=duaR1AnrObmqETtxDghvr7defhHd1q2pgv4fpE/MLDo=; b=n6YUKBVwvB2ol+qn2y164nnedPopKC3VvGAAVR6OBjd6GAr19/BmMgF6 lFdadHIlPA4BP13v7XA1IMZPbvaMdfgrcfuYXEl1mKOZ2sVA7s5rNRAvn rCLlpYkwUZKLX8C00NT1dNpH/cos6I6zD6r2Dz7R7WDQ2fKv+NwA1J3Z6 lBDh2a+UBuNPZbwGcomAKsr1XIVSvpgx6Z4B7ehxuoAEokg8aVTI05/Fk 6osCeQb3ne7x6vhQBxQfsbygRCVTST+rnZX68N8ZApuqkd+ySTf/HN1Oc VS3NfjkL2RZPt/5j7CWX/mmEjLhicRMOtPrkDfX3XQiUqhj9DheiT5i0i Q==; X-CSE-ConnectionGUID: ECU7hUHwT6yX4X4vObkvLg== X-CSE-MsgGUID: G7MHUU6ZS1qzj52fb6t0/g== X-IronPort-AV: E=Sophos;i="6.07,211,1708412400"; d="asc'?scan'208";a="188872991" 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; 18 Apr 2024 02:55:11 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 18 Apr 2024 02:54:31 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 18 Apr 2024 02:54:27 -0700 Date: Thu, 18 Apr 2024 10:54:12 +0100 From: Conor Dooley To: Andy Chiu CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Stuebner , Guo Ren , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Shuah Khan , , , Palmer Dabbelt , Vincent Chen , Greentime Hu , , , Subject: Re: [PATCH v4 1/9] riscv: vector: add a comment when calling riscv_setup_vsize() Message-ID: <20240418-harsh-childlike-94403aa132b3@wendy> References: <20240412-zve-detection-v4-0-e0c45bb6b253@sifive.com> <20240412-zve-detection-v4-1-e0c45bb6b253@sifive.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="stxnFH69aESRe/Ix" Content-Disposition: inline In-Reply-To: <20240412-zve-detection-v4-1-e0c45bb6b253@sifive.com> --stxnFH69aESRe/Ix Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 12, 2024 at 02:48:57PM +0800, Andy Chiu wrote: > The function would fail when it detects the calling hart's vlen doesn't > match the first one's. The boot hart is the first hart calling this > function during riscv_fill_hwcap, so it is impossible to fail here. Add > a comment about this behavior. >=20 > Signed-off-by: Andy Chiu > --- > Changelog v2: > - update the comment (Conor) > --- > arch/riscv/kernel/cpufeature.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeatur= e.c > index 3ed2359eae35..d22b12072579 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -683,6 +683,10 @@ void __init riscv_fill_hwcap(void) > } > =20 > if (elf_hwcap & COMPAT_HWCAP_ISA_V) { > + /* > + * This callsite can't fail here. It cannot fail when called on > + * the boot hart. I am loathe to comment on this again, so=20 Reviewed-by: Conor Dooley but you could just write this as "This cannot fail when called on the boot hart." Cheers, Conor. > + */ > riscv_v_setup_vsize(); > /* > * ISA string in device tree might have 'v' flag, but >=20 > --=20 > 2.44.0.rc2 >=20 --stxnFH69aESRe/Ix Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZiDtuAAKCRB4tDGHoIJi 0vBwAP98Il+vXK4C3r4MkJnr98Iu2kDKN2juNFv17/2CzU01XAD8DKAV9cWacroD OxgMcDQ3nbE0Mhf3iWlSh55SQQYoqQ4= =At92 -----END PGP SIGNATURE----- --stxnFH69aESRe/Ix--