On 17.06.26 11:48, Harald Freudenberger wrote:
Support the subfunctions CPACF_KM_AES_128, CPACF_KM_AES_192
and CPACF_KM_AES_256 for the cpacf km instruction.

Signed-off-by: Harald Freudenberger <[email protected]>
Tested-by: Holger Dengler <[email protected]>

With the one typo (see below) fixed:

Reviewed-by: Finn Callies <[email protected]>

---
  target/s390x/gen-features.c      |   3 +
  target/s390x/tcg/cpacf.h         |   6 ++
  target/s390x/tcg/cpacf_aes.c     | 113 +++++++++++++++++++++++++++++++
  target/s390x/tcg/crypto_helper.c |  24 +++++++
  target/s390x/tcg/meson.build     |   1 +
  5 files changed, 147 insertions(+)
  create mode 100644 target/s390x/tcg/cpacf_aes.c

diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 5cf5b92c37..a35d1fd2f9 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -921,6 +921,9 @@ static uint16_t qemu_MAX[] = {
      S390_FEAT_KLMD_SHA_256,
      S390_FEAT_KLMD_SHA_512,
      S390_FEAT_PRNO_TRNG,
+    S390_FEAT_KM_AES_128,
+    S390_FEAT_KM_AES_192,
+    S390_FEAT_KM_AES_256,
  };
/****** END FEATURE DEFS ******/
diff --git a/target/s390x/tcg/cpacf.h b/target/s390x/tcg/cpacf.h
index e2c36306b2..36d0c81893 100644
--- a/target/s390x/tcg/cpacf.h
+++ b/target/s390x/tcg/cpacf.h
@@ -18,4 +18,10 @@ int cpacf_sha512(CPUS390XState *env, const int mmu_idx, 
uintptr_t ra,
                   uint64_t param_addr, uint64_t *message_reg, uint64_t 
*len_reg,
                   uint32_t type);
+/* from crypto_aes.c */

Should be cpacf_aes.c instead of crypto_aes.c

+int cpacf_aes_ecb(CPUS390XState *env, const int mmu_idx, uintptr_t ra,
+                  uint64_t param_addr, uint64_t *dst_ptr_reg,
+                  uint64_t *src_ptr_reg, uint64_t *src_len_reg,
+                  uint32_t type, uint8_t fc, uint8_t mod);
+
[ snip ]

Reply via email to