Skip to contentSkip to conversation

Revert "feature-arm-crypto: Add +nocrypto to -mcpu when crypto not in features"

PATCH In review Jon Mason 2 participants 3 messages Aug 12, 2025

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/2 Revert "feature-arm-crypto: Add +nocrypto to -mcpu when crypto not in features"

This reverts commit db1b355b2b15ba57bd89c2dfb88c2c667551863e.

---
 meta/conf/machine/include/arm/feature-arm-crypto.inc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/conf/machine/include/arm/feature-arm-crypto.inc +1 -2
index 8202de78e46e..aade6ce08d5e 100644
@@ -2,5 +2,4 @@
 # armv8-a, armv8.1-a, armv8.3-a, armv8.4-a, armv8.5-a, armv8.6-a, and armv8-r
 
 TUNEVALID[crypto] = "Enable cryptographic instructions for ARMv8"
-# See  https://github.com/llvm/llvm-project/issues/85699
-TUNE_CCARGS_MARCH_OPTS .= "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '+crypto', '+nocrypto', d)}"
+TUNE_CCARGS_MARCH_OPTS .= "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '+crypto', '', d)}"
Signature · 1 line
2.39.5
author
#1 lore raw

PATCH 2/2 arm: add nocrypto TUNE_FEATURE to complement crypto

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'.

Cc Ryan Eatmon <[email protected]>
Cc Khem Raj <[email protected]>
---
 meta/conf/machine/include/arm/feature-arm-crypto.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/conf/machine/include/arm/feature-arm-crypto.inc +5 -0
index aade6ce08d5e..c1f5b1225dfd 100644
@@ -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"
Signature · 1 line
2.39.5
#2 lore raw

Re: [PATCH 2/2] arm: add nocrypto TUNE_FEATURE to complement crypto

Quoted 12 lines · Jon Mason

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.

Quoted 7 lines

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'.

This looks fine to me. We need to add additional tunes in the cortexa72 tune file to have a tune using it.

Quoted 23 lines
Cc Ryan Eatmon <[email protected]>
Cc Khem Raj <[email protected]>
---
 meta/conf/machine/include/arm/feature-arm-crypto.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/conf/machine/include/arm/feature-arm-crypto.inc +5 -1
index aade6ce08d5e..c1f5b1225dfd 100644
@@ -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"
--

2.39.5