From patchwork Tue Feb 6 16:27:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13547595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68C7EC48297 for ; Tue, 6 Feb 2024 16:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=y4K9toWfUs5qqmjoHhcMW80kJGYYCS4rv5jca2VohEA=; b=qchfT1pIilcNmn LnFy8LQe6vQWkINL0lx/OIy7C+KUE6ZZ7HAloLuxftt8UdebA4Ga+wED/Pm2GwMyoAehl6xxn/+wc 0RPXY5TuwW2FF75Lmcj3Irll3IlnZDaK8h9G7vmSADpoc7uvZmsXP6vPzbvWZUTZCWc+pWF3+VoYy 7qT4Aw2oh9kY2LXe7DpAsM5QPG+i92LBxKoE1ed6wA6Btjs4Gy3HNJ/akjAKuC6IR/RYPfmQR19QX CO0XSm9RoYtsN7yl7Y4i/ljVBev/NLhn+e2l8UXe93QsSdEmOvFqKpm4L86Ow2981rlo+3QogSrT1 hZWSvZ6Kf9IxO1W80zxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXOIh-00000008FxQ-3WKb; Tue, 06 Feb 2024 16:27:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXOIa-00000008FrN-3UTQ for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2024 16:27:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2849D615C4; Tue, 6 Feb 2024 16:27:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05E20C433C7; Tue, 6 Feb 2024 16:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707236870; bh=fRog9coSpdrDKRPeW6Hy2Z/gSCmjUBq/+m0a/5NTav8=; h=From:Date:Subject:To:Cc:From; b=OkWsDSNoWY8FCQEgO0G6MAYEFLmLRO8xubuBvugziOoPoxa+xMwSX76yMmr12AuKB kDq4nVyMnVWtGMHzpaRfHUrGzzhT6psrIG9XSClj56+WQsNhVvaUU99P6DQah5GWlU gGsYkPZI/lqtNyp0AqDZY1V1GMisS08d7ECGlwwWbGC/XZvnoqJQ1ttmomFFpyc8za zD9VlzAQTImWKTEd4q7MWl9KhTA3gKPCF/rpLbsgBYjtCExQuaDtFRpqGgIzVNa2g0 fWO26Gk7/IXE4M9tSHl6nzEcewLCE6uesbB7YSyOxAB7YEaBRYumJK9xP+neZ//Ol9 9csjNBKuwt5ug== From: Mark Brown Date: Tue, 06 Feb 2024 16:27:01 +0000 Subject: [PATCH] arm64/sve: Document that __SVE_VQ_MAX is much larger than needed MIME-Version: 1.0 Message-Id: <20240206-arm64-sve-vl-max-comment-v1-1-dddf16414412@kernel.org> X-B4-Tracking: v=1; b=H4sIANRdwmUC/x3MQQqAIBBA0avErBswMxddJVqIjTWQGhoSSHdPW r7F/xUyJaYMc1chUeHMMTQMfQf2MGEn5K0ZpJBKSKHRJK8V5kJYTvTmQRu9p3CjVuTM6MSo5QQ tvxI5fv71sr7vBw/DDWdqAAAA To: Catalin Marinas , Will Deacon Cc: Dave Martin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=1327; i=broonie@kernel.org; h=from:subject:message-id; bh=fRog9coSpdrDKRPeW6Hy2Z/gSCmjUBq/+m0a/5NTav8=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlwl4DLTjeWojBDQwiaeCesLKB01RBMye6iqVO9 W/87/JHKN+JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZcJeAwAKCRAk1otyXVSH 0F8KB/0dwrDLgl+VpeCMPKSQvsPK0/ZbXt8jR6xLiS04IOvrXQptZgBHtWmY/f5KIQSTdnRkHoj ksAn9CfWWvpUy91iB65q4RxXcGgSE+htmYdXM9ZxdV2RaAzTCVCyjtl6/npVzY4f91tUTx1oqXT h7QwjfMJCTjPfTHtHspOrjSA9WcBOKOqhCTsLxMlYg78TxnaJkSkiloydk3Epp7xUUcDK6JsKjX bfjBKLFnebOVearwBWJ5Dr3c4qGL8DuyQvVtQ5Ur5wu1TT7jL6IFNwu6IfVoQsalQ238+JpdS1H VG2dtOHIhTs2/EjyTMp99SfQqxjOzAw4CpymanzQw5TPUzev X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240206_082753_813862_F3265ADE X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org __SVE_VQ_MAX is defined without comment as 512 but the actual architectural maximum is 16, a substantial difference which might not be obvious to readers especially given the several different units used for specifying vector sizes in various contexts and the fact that it's often used via macros. In an effort to minimise surprises for users who might assume the value is the architectural maximum and use it to do things like size allocations add a comment noting the difference. Signed-off-by: Mark Brown --- arch/arm64/include/uapi/asm/sve_context.h | 4 ++++ 1 file changed, 4 insertions(+) --- base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478 change-id: 20240206-arm64-sve-vl-max-comment-64efa3f03625 Best regards, diff --git a/arch/arm64/include/uapi/asm/sve_context.h b/arch/arm64/include/uapi/asm/sve_context.h index 754ab751b523..59f283f373a6 100644 --- a/arch/arm64/include/uapi/asm/sve_context.h +++ b/arch/arm64/include/uapi/asm/sve_context.h @@ -13,6 +13,10 @@ #define __SVE_VQ_BYTES 16 /* number of bytes per quadword */ +/* + * Note that for future proofing __SVE_VQ_MAX is defined much larger + * than the actual architecture maximum of 16. + */ #define __SVE_VQ_MIN 1 #define __SVE_VQ_MAX 512