mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm64/sve: Document that __SVE_VQ_MAX is much larger than needed
@ 2024-02-06 16:27 Mark Brown
  2024-02-07 12:01 ` Dave Martin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2024-02-06 16:27 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Dave Martin, linux-arm-kernel, linux-kernel, Mark Brown

__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 <broonie@kernel.org>
---
 arch/arm64/include/uapi/asm/sve_context.h | 4 ++++
 1 file changed, 4 insertions(+)

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
 

---
base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478
change-id: 20240206-arm64-sve-vl-max-comment-64efa3f03625

Best regards,
-- 
Mark Brown <broonie@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-07 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 16:27 [PATCH] arm64/sve: Document that __SVE_VQ_MAX is much larger than needed Mark Brown
2024-02-07 12:01 ` Dave Martin
2024-02-07 12:48   ` Mark Brown
2024-02-07 13:39     ` Dave Martin
2024-02-07 15:10       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®