Received: by 2002:a05:7208:13c3:b0:82:bbfa:f723 with SMTP id r3csp41586rbe; Thu, 9 May 2024 09:28:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsEtd7m8JBZ5v4u+o1KpBKWBtWH3Kg0K2cyUHX3rr31rMgVQOrlQuibg/tjSp59fwRMXG1JQs6md0DGsrrf4QlzIY/LaMyJ4Ph9l3D/A== X-Google-Smtp-Source: AGHT+IH2e7R45RefkjflClJl4+LoI499uDKUlb8QZWvwP6EY6Mt0vwowmPeDnrHvHDC6cH1MReOZ X-Received: by 2002:a05:622a:28a:b0:43a:bd5b:9657 with SMTP id d75a77b69052e-43dfcc64ed0mr4336621cf.1.1715272082845; Thu, 09 May 2024 09:28:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715272082; cv=pass; d=google.com; s=arc-20160816; b=AXnsNW3ePE+4LUJh2m1kIUczY15/kWc+D0Z1BXRLCMDf8KaPxEGBLPqXdB/lBAMr/K lmc3O2AtCghki/pnTZVg03oBCQ/74yDJKUA0McEjZM9PmSA1Bdg6UJMGoVGXTLuzHm6a pDMZ+0UrBGCIcLNHjAI1Bqet2IxKALOdAOv+zGZmZxcwSZr46IY2X+WkeOVXLdSstUBF pgD3bItnp0SLJo8qRyb0M24wA3/LuJCBaHFK27fFZ/47wP4B5KEnuJTNQJ0SFHYxc2S+ 6Xm9Z713mCwCOoShjEQ0E8UyTWyGCoXVAls5KLf7B7+cmy59xlh0Ytc8rnzPm9rsA9TF 1QGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=F/faDAFpSR0nEREgruz48ieW2Rr4UgJ9rT3PHGQFx6A=; fh=X3YzDjJYGysDlynKzQ0zXWknnRshrk6avKVBDYFG1ms=; b=ktCce6ev4GZwO091JEpIAR5rBj78FwfWXGUxYmkNBZ/klMq7miHlhLQzFQ1hnyJan2 +0Ln9rqzTtRuRF7VAnTPckgmhI2fOe9EGO5Ty2GECoyJ+8ZJ8nUxrNtZBg2UoyT5jPu4 FzAxPATWoG+wmatpAQLf8FXytWNfhyp2alUogAIysZmhO748JdW98/3UCpFDDkHgbIia eBqZlnTs6jQL1IyXmONG3kNfCTESMbjXKWi1vR80MHRJn1fWOBBhBnL4MwLmA9x/MPeY qF9NgLOHriz6yxWpImJ9vvXXSsJ5gXwvExcZTjIYjObSlZlnpHPxZAnGecIidXpuJAmM 5vaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=En9K9tMx; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-174674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df549d153si15573591cf.111.2024.05.09.09.27.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 09:28:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174674-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=@sifive.com header.s=google header.b=En9K9tMx; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-174674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 41C281C2185E for ; Thu, 9 May 2024 16:27:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 331AC170835; Thu, 9 May 2024 16:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="En9K9tMx" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 F043E16F90E for ; Thu, 9 May 2024 16:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715272048; cv=none; b=tHwjwwuheQYFZonRa09Wzgzv6b0jGYdXudPInc6eDU/mc4CqVq8vEtIF2A917kNOnNI+N5Afjr93JPZOXDuhaF5+lxkVGd8jSwxHlHUAh/MqGcxylTHFI72iF/5wubQEtoeihgsTxO4Grji/myIn4wbUuJL6J6xvp/I5JKSVNI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715272048; c=relaxed/simple; bh=txdYUVokTSzAJWgps5DIN7AP0OOCMWGT5bqowv6DVAA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OHw0lbOPHxvV8UIi4+TVpWuqu0rCUDTfX3ePEI8ArUNzT+8O7kFaiHVAqL/0NfN2BCOOO2MfCXNCXq3UM/yguB/1W6N4YdoDqtI+xRZvZJyR0P1bgaw3p/X3kDf9AI+0AIELZoraBb5SR4d2ZIWiHw1Ky0ZGS8nUP2EQPmMvJiQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=En9K9tMx; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1ee38966529so15744155ad.1 for ; Thu, 09 May 2024 09:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1715272046; x=1715876846; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=F/faDAFpSR0nEREgruz48ieW2Rr4UgJ9rT3PHGQFx6A=; b=En9K9tMxV+BgA5qJDmFpFJMxYnWGmi242mUodDISytkRNITJhg/nH9oEsEDmlWsZer OV8/bEj3mJ6PFHe1ZjSwa6Nh+g4lVmm+iOy5LYOUpTRPoX+y4cPfcSLCV+6hTewRVcYV tkQNEdk0bOZEZKPLZ/AHpBXIBvNjybM71JouBhaRrAO4Ht2Fgv/O1FX0bW9uHpNLWQsW AjsVIZuJ7wg/jgKdxMI8euB+Cl9680NYOu8Q1mT5/k/rVLh4lcYGHf7NrcBxoX6JTpw/ /5Pyvz917i9S/MuZIbqZHVfZSeMIEeDzxAGpT83zeI9EM9uBM3+8Pze//UstNaeVEXEQ i/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715272046; x=1715876846; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F/faDAFpSR0nEREgruz48ieW2Rr4UgJ9rT3PHGQFx6A=; b=PJjYoyJ90clrw6BWKQHf2uGOLqxvrVy6bps2/+kn+KpOTgqiQTZURdRdHHVtVPVWYa gO/7B+PfsuSsVvRQpmx167ED4MhYmavKblduRU9jm3EV+mpRAxHvOyzrhaNVCffm+tC7 1Y7Awxp4pDF6L/oW3sekJIVjj2ygV3D5WYBBZml4jjFOfdvZlj9FdVXfMXhk89u4YpjI 2eg74t0uOIVHi3EZi55ERGGhozEBBpPQ8AHi32QsVG/MgqzJSlFz5xwHbH1Ap4EoTHrH 9BXvepultwyh9CRZoOpMCf827ime52vuZ+Ykb/hXDsBuowSi7EzP3ttZamFoNtyZlXJM kOxQ== X-Forwarded-Encrypted: i=1; AJvYcCXMvYa3/oO6eqUnJ7xO8xYlEmjnH1Q5FZ7o1gm8iF1m/UPjJD9FFIyDVBCVKne1X2W0JilD6D+NziLNc5tfClVKXdleSX72N5mFV9pz X-Gm-Message-State: AOJu0Yx4dZfLxpdlMF19nYg8xq4iILk5nip5QPZiSZv8PRKDMZmwWzKm GE1n7lpL4HvsMFVvJvE99pwtAimWCQRLD0s4LRAYM7Q36Aw5MZ/rhUhONlYoYLU= X-Received: by 2002:a17:902:e74f:b0:1eb:7162:82c7 with SMTP id d9443c01a7336-1ef42f74f9amr2694775ad.18.1715272046337; Thu, 09 May 2024 09:27:26 -0700 (PDT) Received: from [127.0.1.1] (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c13805asm16210285ad.264.2024.05.09.09.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 09:27:26 -0700 (PDT) From: Andy Chiu Date: Fri, 10 May 2024 00:26:51 +0800 Subject: [PATCH v5 1/8] riscv: vector: add a comment when calling riscv_setup_vsize() 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240510-zve-detection-v5-1-0711bdd26c12@sifive.com> References: <20240510-zve-detection-v5-0-0711bdd26c12@sifive.com> In-Reply-To: <20240510-zve-detection-v5-0-0711bdd26c12@sifive.com> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Heiko Stuebner , Andy Chiu , Guo Ren , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Evan Green , =?utf-8?q?Cl=C3=A9ment_L=C3=A9ger?= , Shuah Khan Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Vincent Chen , Greentime Hu , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org X-Mailer: b4 0.13-dev-a684c 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. Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley --- Changelog v2, v5: - update the comment (Conor) --- arch/riscv/kernel/cpufeature.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3ed2359eae35..15ffda1968d8 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -683,6 +683,9 @@ void __init riscv_fill_hwcap(void) } if (elf_hwcap & COMPAT_HWCAP_ISA_V) { + /* + * This cannot fail when called on the boot hart + */ riscv_v_setup_vsize(); /* * ISA string in device tree might have 'v' flag, but -- 2.44.0.rc2