]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
arm: add nocrypto TUNE_FEATURE to complement crypto
authorJon Mason <jdmason@kudzu.us>
Tue, 12 Aug 2025 22:21:42 +0000 (18:21 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Aug 2025 09:14:30 +0000 (10:14 +0100)
Add a `nocrypto` TUNE_FEATURE option to `feature-arm-crypto.inc`
to explicitly disable ARM crypto extensions via GCC flags. This
provides an opposing state to the existing `crypto` feature,
enabling more explicit control over crypto-related tuning.

Some vendors ship cores without crypto support, and this change
allows disabling it without requiring extensive audits of
dependent code paths. This approach avoids the knock-on effects
caused when `nocrypto` is applied implicitly in the absence of
`crypto` in TUNE_FEATURES.

TUNECONFLICTS was added to prevent both features from being
enabled simultaneously. When both are added, the following error
is seen during build:

  Feature 'nocrypto' conflicts with 'crypto'.
  Feature 'crypto' conflicts with 'nocrypto'.

Signed-off-by: Jon Mason <jon.mason@arm.com>
Cc: Ryan Eatmon <reatmon@ti.com>
Cc: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/machine/include/arm/feature-arm-crypto.inc

index aade6ce08d5ee96bd34833e2843b5cabf676dac9..c1f5b1225dfd54244e05c3ededb59704c3d16086 100644 (file)
@@ -3,3 +3,8 @@
 
 TUNEVALID[crypto] = "Enable cryptographic instructions for ARMv8"
 TUNE_CCARGS_MARCH_OPTS .= "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '+crypto', '', d)}"
+TUNECONFLICTS[crypto] = "nocrypto"
+
+TUNEVALID[nocrypto] = "Disable cryptographic instructions for ARMv8"
+TUNE_CCARGS_MARCH_OPTS .= "${@bb.utils.contains('TUNE_FEATURES', 'nocrypto', '+nocrypto', '', d)}"
+TUNECONFLICTS[nocrypto] = "crypto"