[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 02/15] s390x/cpumodel: add msa11 subfunctions
From: |
Hendrik Brueckner |
Subject: |
[RFC PATCH v2 02/15] s390x/cpumodel: add msa11 subfunctions |
Date: |
Fri, 6 Dec 2024 13:27:38 +0100 |
MSA11 introduces new HMAC subfunctions.
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
target/s390x/cpu_features.c | 2 ++
target/s390x/cpu_features_def.h.inc | 10 ++++++++++
target/s390x/cpu_models.c | 8 ++++++++
target/s390x/gen-features.c | 24 ++++++++++++++++++++++++
4 files changed, 44 insertions(+)
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index a3c239595a..36930feccd 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -254,6 +254,8 @@ static S390FeatGroupDef s390_feature_groups[] = {
FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO,
"Message-security-assist-extension 9 PCKMO subfunctions"),
FEAT_GROUP_INIT("msa10", MSA_EXT_10, "Message-security-assist-extension 10
facility"),
FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO,
"Message-security-assist-extension 10 PCKMO subfunctions"),
+ FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11
facility"),
+ FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO,
"Message-security-assist-extension 11 PCKMO subfunctions"),
FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements
introduced with Multiple-epoch facility"),
FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"),
FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion
facility"),
diff --git a/target/s390x/cpu_features_def.h.inc
b/target/s390x/cpu_features_def.h.inc
index 104d186c3f..15ea51fc54 100644
--- a/target/s390x/cpu_features_def.h.inc
+++ b/target/s390x/cpu_features_def.h.inc
@@ -200,6 +200,14 @@ DEF_FEAT(KMAC_AES_256, "kmac-aes-256", KMAC, 20, "KMAC
AES-256")
DEF_FEAT(KMAC_EAES_128, "kmac-eaes-128", KMAC, 26, "KMAC Encrypted-AES-128")
DEF_FEAT(KMAC_EAES_192, "kmac-eaes-192", KMAC, 27, "KMAC Encrypted-AES-192")
DEF_FEAT(KMAC_EAES_256, "kmac-eaes-256", KMAC, 28, "KMAC Encrypted-AES-256")
+DEF_FEAT(KMAC_HMAC_SHA_224, "kmac-hmac-sha-224", KMAC, 112, "KMAC
HMAC-SHA-224")
+DEF_FEAT(KMAC_HMAC_SHA_256, "kmac-hmac-sha-246", KMAC, 113, "KMAC
HMAC-SHA-256")
+DEF_FEAT(KMAC_HMAC_SHA_384, "kmac-hmac-sha-384", KMAC, 114, "KMAC
HMAC-SHA-384")
+DEF_FEAT(KMAC_HMAC_SHA_512, "kmac-hmac-sha-512", KMAC, 115, "KMAC
HMAC-SHA-512")
+DEF_FEAT(KMAC_HMAC_ESHA_224, "kmac-hmac-esha-224", KMAC, 120, "KMAC
HMAC-Encrypted-SHA-224")
+DEF_FEAT(KMAC_HMAC_ESHA_256, "kmac-hmac-esha-246", KMAC, 121, "KMAC
HMAC-Encrypted-SHA-256")
+DEF_FEAT(KMAC_HMAC_ESHA_384, "kmac-hmac-esha-384", KMAC, 122, "KMAC
HMAC-Encrypted-SHA-384")
+DEF_FEAT(KMAC_HMAC_ESHA_512, "kmac-hmac-esha-512", KMAC, 123, "KMAC
HMAC-Encrypted-SHA-512")
/* Features exposed via the KMC instruction. */
DEF_FEAT(KMC_DEA, "kmc-dea", KMC, 1, "KMC DEA")
@@ -275,6 +283,8 @@ DEF_FEAT(PCKMO_ECC_P384, "pckmo-ecc-p384", PCKMO, 33,
"PCKMO Encrypt-ECC-P384-Ke
DEF_FEAT(PCKMO_ECC_P521, "pckmo-ecc-p521", PCKMO, 34, "PCKMO
Encrypt-ECC-P521-Key")
DEF_FEAT(PCKMO_ECC_ED25519, "pckmo-ecc-ed25519", PCKMO, 40 , "PCKMO
Encrypt-ECC-Ed25519-Key")
DEF_FEAT(PCKMO_ECC_ED448, "pckmo-ecc-ed448", PCKMO, 41 , "PCKMO
Encrypt-ECC-Ed448-Key")
+DEF_FEAT(PCKMO_HMAC_512, "pckmo-hmac-512", PCKMO, 118, "PCKMO
Encrypt-HMAC-512-Key")
+DEF_FEAT(PCKMO_HMAC_1024, "pckmo-hmac-1024", PCKMO, 122, "PCKMO
Encrypt-HMAC-1024-Key")
/* Features exposed via the KMCTR instruction. */
DEF_FEAT(KMCTR_DEA, "kmctr-dea", KMCTR, 1, "KMCTR DEA")
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 3eb8276aee..a62a3c3771 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -477,6 +477,14 @@ static void check_consistency(const S390CPUModel *model)
{ S390_FEAT_KLMD_SHA3_512, S390_FEAT_MSA },
{ S390_FEAT_KLMD_SHAKE_128, S390_FEAT_MSA },
{ S390_FEAT_KLMD_SHAKE_256, S390_FEAT_MSA },
+ { S390_FEAT_KMAC_HMAC_SHA_224, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_SHA_256, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_SHA_384, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_SHA_512, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_ESHA_224, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_ESHA_256, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_ESHA_384, S390_FEAT_MSA_EXT_3 },
+ { S390_FEAT_KMAC_HMAC_ESHA_512, S390_FEAT_MSA_EXT_3 },
{ S390_FEAT_KM_FULL_XTS_AES_128, S390_FEAT_MSA_EXT_4 },
{ S390_FEAT_KM_FULL_XTS_AES_256, S390_FEAT_MSA_EXT_4 },
{ S390_FEAT_KM_FULL_XTS_EAES_128, S390_FEAT_MSA_EXT_4 },
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 06c3bf64f3..d6305f945a 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -256,6 +256,20 @@
S390_FEAT_PCKMO_AES_XTS_128_DK, \
S390_FEAT_PCKMO_AES_XTS_256_DK
+#define S390_FEAT_GROUP_MSA_EXT_11 \
+ S390_FEAT_KMAC_HMAC_SHA_224, \
+ S390_FEAT_KMAC_HMAC_SHA_256, \
+ S390_FEAT_KMAC_HMAC_SHA_384, \
+ S390_FEAT_KMAC_HMAC_SHA_512, \
+ S390_FEAT_KMAC_HMAC_ESHA_224, \
+ S390_FEAT_KMAC_HMAC_ESHA_256, \
+ S390_FEAT_KMAC_HMAC_ESHA_384, \
+ S390_FEAT_KMAC_HMAC_ESHA_512
+
+#define S390_FEAT_GROUP_MSA_EXT_11_PCKMO \
+ S390_FEAT_PCKMO_HMAC_512, \
+ S390_FEAT_PCKMO_HMAC_1024
+
#define S390_FEAT_GROUP_ENH_SORT \
S390_FEAT_ESORT_BASE, \
S390_FEAT_SORTL_SFLR, \
@@ -321,6 +335,10 @@ static uint16_t group_MSA_EXT_10[] = {
S390_FEAT_GROUP_MSA_EXT_10,
};
+static uint16_t group_MSA_EXT_11[] = {
+ S390_FEAT_GROUP_MSA_EXT_11,
+};
+
static uint16_t group_MSA_EXT_9_PCKMO[] = {
S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
};
@@ -329,6 +347,10 @@ static uint16_t group_MSA_EXT_10_PCKMO[] = {
S390_FEAT_GROUP_MSA_EXT_10_PCKMO,
};
+static uint16_t group_MSA_EXT_11_PCKMO[] = {
+ S390_FEAT_GROUP_MSA_EXT_11_PCKMO,
+};
+
static uint16_t group_ENH_SORT[] = {
S390_FEAT_GROUP_ENH_SORT,
};
@@ -878,6 +900,8 @@ static FeatGroupDefSpec FeatGroupDef[] = {
FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO),
FEAT_GROUP_INITIALIZER(MSA_EXT_10),
FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_11),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO),
FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF),
FEAT_GROUP_INITIALIZER(ENH_SORT),
FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION),
--
2.43.5
- Re: [RFC PATCH v2 09/15] s390x/cpumodel: add Miscellaneous-Instruction-Extensions Facility 4, (continued)
- [RFC PATCH v2 14/15] s390x/cpumodel: Add PLO-extension facility, Hendrik Brueckner, 2024/12/06
- [RFC PATCH v2 01/15] s390x/cpumodel: add msa10 subfunctions, Hendrik Brueckner, 2024/12/06
- [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes, Hendrik Brueckner, 2024/12/06
- Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes, Janosch Frank, 2024/12/09
- Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes, Hendrik Brueckner, 2024/12/09
- Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes, Janosch Frank, 2024/12/09
- Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes, Hendrik Brueckner, 2024/12/09
- Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes, Janosch Frank, 2024/12/10
- [RFC PATCH] s390x/cpumodel: add MSA 12 consistency checks, Hendrik Brueckner, 2024/12/10
[RFC PATCH v2 02/15] s390x/cpumodel: add msa11 subfunctions,
Hendrik Brueckner <=
Re: [RFC PATCH v2 00/15] KVM: s390: CPU model for gen17, Richard Henderson, 2024/12/06