Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp260689lqn; Thu, 11 Apr 2024 23:49:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwxytFJ2lXZjOQr6wqbOczVvmFwyK/UJwlfFMTYmYsKpME7sZARHZun4qU81Z1PpM4tPfZ10dVoi/dOuEwixw3iQW6gI55i7whgFAkjA== X-Google-Smtp-Source: AGHT+IGBoFJCrIvXNGiyl5TwuS5CV/fTb77Ai2uPoM4b+MM6+Xvh2cOo1ygVxWEcQ7DeDOSKcPUh X-Received: by 2002:a50:d6db:0:b0:56e:2cbc:db77 with SMTP id l27-20020a50d6db000000b0056e2cbcdb77mr1160262edj.33.1712904575513; Thu, 11 Apr 2024 23:49:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712904575; cv=pass; d=google.com; s=arc-20160816; b=wtYVrEPJjAmGx8ekYJJNAuDXR0UuSbTmjDmEltSlhdx+PK7pvRMQjwc7BzFoTUmXxP py5Mlevcik3eoX7eByLRlDnpfFVq9ty+1Fg2eanUUuS+h9vqqIGKVm8duOKYm8igXdmj 8bRpnkPqAVVC0EP7xqkGIR+UxyASSeNQt4xByicXBqb/Tc11Sneym+76wOEUBlMPYRV0 4TySlPqa36Eyqild02uIIhXru+35JaYggSChsJTc5wLli91RY26Zi6IwlR23osr1b8BU gldtlPri8wDoujwfBDI7RNfBbdL2U786TfNl+snqmtl4ABI7FnWnoaWe+Wn2rPAeK8Wm EY2g== 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=srXw+GM0AbxLDkn2sukHjOTHYGaz4TEKS2v/bKB+HwE=; fh=prcT5yo+zRA0ekXb5JT68SxhbDitpBPN0woRO0W9DJc=; b=pwhY+dmqGGUqCTtmn59HkFnTBYhvQPvx1JBUr9UMmElrWXLMgYV1Aub3IZwiWfWBhV mrfiusnttPh0MH8A/KOaFdXfmhW4cGRSHkPOxhYa5N+Sx98W/F9rchhrPGO5S5ssrgrP 58Q+VAcCl+KcdYg++Rj+sfc9Gwk4jA7ca5GF/338cVZGs0ZGitfEFagP6cgLvKFGrUHW nVl677Q37sfe3uh3HxPvo+H4vAkS1Csm04xQ1kzDSh3dPocwzh3kkJbQgR09RPS7oqz7 atf8fC87Kkp4STiVjQHI0Crk5sS4zdfriJKmKKeaU6JWpgtWSZXaFszZxabIkppVjncV NzkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=mJjHeDEN; 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-142066-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u21-20020a50d515000000b0056e0e0ce7fasi1421439edi.342.2024.04.11.23.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 23:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142066-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=@sifive.com header.s=google header.b=mJjHeDEN; 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-142066-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142066-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 41D511F23B42 for ; Fri, 12 Apr 2024 06:49:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B8A6481DB; Fri, 12 Apr 2024 06:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="mJjHeDEN" Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 645904653C for ; Fri, 12 Apr 2024 06:49:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712904548; cv=none; b=Jk+H/cJWEuo966GJRILZPSoe49lyg3CNC4hQWkmH4qPxD5HyH1lnvg7cA0mo0lw/mHqP2BhgvsEsdNKDyHAckMLgnGFCaKcQOskKCn9J7zLZQ5/NRCXBBlQiRvaQbPQaTi9zvUH83diB6CNXcSU4pbd7jqdoE7pC6yrIUTO4RnE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712904548; c=relaxed/simple; bh=v5lsx72T+bwwkalmCViShoyQqewfBPUAjK8ziKGVSKw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IwfxTFBRxOObCmDNsYeKHslRwBCjP28YPWzxzg1prfPCs/Te5Z/y5s2KUGtNIKs4sh7TjjJdZodOxiakuh1XhIv8ZMIKRNhGYEigoOdD7CATcXw0Zpbw4N5FGuFLXzjnIHr6623AlPRAPoSGHeVaEJYTmKq049mYvDftGxzr8k8= 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=mJjHeDEN; arc=none smtp.client-ip=209.85.215.179 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-pg1-f179.google.com with SMTP id 41be03b00d2f7-5d8b519e438so488642a12.1 for ; Thu, 11 Apr 2024 23:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1712904547; x=1713509347; 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=srXw+GM0AbxLDkn2sukHjOTHYGaz4TEKS2v/bKB+HwE=; b=mJjHeDENzgG4gDckyAKh9nUWEQvpsykJTysvaHQg+0FZVclPPl7jziP1Sd8XitEerd uF4oYbbNXMxkb3o9ZPPnRd+pB+eklLTV1n2pou/6m3mtzThBA7B97hurWEL3FpQQkcbt B4z9vOtuYdADtpz3QQhStgbOYBrJsaJEMWVwnYCuL697Z+up/YlFPrMZDBvlt6k17klD etmxmqDxrkPEwmWHMm88r0Nzjk7c0VIgYHAwMyp0eF5hsqIyicqWJRk6+aU86MPlEfAk 9DNCvqvzoiKUKjLKpyF7VycrlEmu42jbj2X9FSLsJ7oHawx3gsAT8jNMDpIB4UKEL+fT BGiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712904547; x=1713509347; 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=srXw+GM0AbxLDkn2sukHjOTHYGaz4TEKS2v/bKB+HwE=; b=AROxvKDERcgSasr2ILbXuMwUoqNvAMJZSPe7ymMATotIGinwmUrU637vY9LEej0cyf pG+FNDAKziGRyTpfJFbjoF2lOBYcUvSlvt3GEbCkOO2E6P4QBkCEyWYP3IUkcQ5eWmXF BoxKGfKoGqCCVkymsOvZcNYAt4yZTFSWRmU7xnPhGvjJdt7nKXhahZJb84j9AqzsWM3P 9ChjiHbzgt6UalcVNNu6vCSZMU9OzHs9cNactUJWJ+ftHfSCnpp76z6+utNN/deOQtuB fP9BaWb2kg/T1TrPxWIPPguN8tqRPhGzc/GKQUUlULSqgWcWDw40wt/9qY0JGF9E3N2A rhdw== X-Forwarded-Encrypted: i=1; AJvYcCXdQqUZkwM47Bqc7WmUB6gY076UpXqGBMY1xt/P67CK58TeR4XhXEFb10srSg3J5XBD+Vh0EVFFdFIKKOK/IZvtuYWRcnf/mxG5J1xG X-Gm-Message-State: AOJu0YyZYjU5jGh5wLdMKfqQGHg2peVwVR0StZhX63EINtUrEk2Le3dr RnFAl4md3CrjLLbm3WGYB6fpxRG81xfae5pjwRLsTnVB759OIcOtucxmo4PHkrQ= X-Received: by 2002:a05:6a20:bf2a:b0:1a3:afdc:fe5 with SMTP id gc42-20020a056a20bf2a00b001a3afdc0fe5mr1702435pzb.42.1712904546736; Thu, 11 Apr 2024 23:49:06 -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 q8-20020a170902b10800b001e107222eb5sm2258818plr.191.2024.04.11.23.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 23:49:06 -0700 (PDT) From: Andy Chiu Date: Fri, 12 Apr 2024 14:48:57 +0800 Subject: [PATCH v4 1/9] 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: <20240412-zve-detection-v4-1-e0c45bb6b253@sifive.com> References: <20240412-zve-detection-v4-0-e0c45bb6b253@sifive.com> In-Reply-To: <20240412-zve-detection-v4-0-e0c45bb6b253@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 --- Changelog v2: - update the comment (Conor) --- arch/riscv/kernel/cpufeature.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.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) } if (elf_hwcap & COMPAT_HWCAP_ISA_V) { + /* + * This callsite can't fail here. It 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