[PATCH v9b 12/14] x86/Kconfig: Add symbols for Key Locker

Chang S. Bae
2024-06-11T21:36:12Z

Add CONFIG_X86_KEYLOCKER to control whether Key Locker is initialized at
boot. Additionally, add the AS_KEYLOCKER config symbol to indicate
whether the assembler supports Key Locker.

The former will be selected, and the latter will be referenced by the Key
Locker cipher module CRYPTO_AES_KL, to be added in a later patch.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
---
Changes from v9:
* Include AS_KEYLOCKER symbol (Eric Biggers).
* Revoke the earlier tag.
---
arch/x86/Kconfig | 3 +++
arch/x86/Kconfig.assembler | 5 +++++
2 files changed, 8 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1d7122a1883e..ce4e4c1641da 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1881,6 +1881,9 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS

If unsure, say y.

+config X86_KEYLOCKER
+ bool
+
choice
prompt "TSX enable mode"
depends on CPU_SUP_INTEL
diff --git a/arch/x86/Kconfig.assembler b/arch/x86/Kconfig.assembler
index 59aedf32c4ea..e6ce80d23113 100644
--- a/arch/x86/Kconfig.assembler
+++ b/arch/x86/Kconfig.assembler
@@ -35,6 +35,11 @@ config AS_VPCLMULQDQ
help
Supported by binutils >= 2.30 and LLVM integrated assembler

+config AS_KEYLOCKER
+ def_bool $(as-instr,encodekey256 %eax$(comma)%eax)
+ help
+ Supported by binutils >= 2.36 and LLVM integrated assembler >= V12
+
config AS_WRUSS
def_bool $(as-instr,wrussq %rax$(comma)(%rbx))
help
--
2.34.1