On 17.06.26 11:48, Harald Freudenberger wrote:
Add a new file cpacf_sha256.c which implements sha256.
Add support for the sha256 subfuction for CPACF kimd and klmd.

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      |   2 +
  target/s390x/tcg/cpacf.h         |   5 +
  target/s390x/tcg/cpacf_sha256.c  | 232 +++++++++++++++++++++++++++++++
  target/s390x/tcg/crypto_helper.c |   8 ++
  target/s390x/tcg/meson.build     |   1 +
  5 files changed, 248 insertions(+)
  create mode 100644 target/s390x/tcg/cpacf_sha256.c

diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 8218e6470e..5cf5b92c37 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -916,7 +916,9 @@ static uint16_t qemu_V7_1[] = {
   */
  static uint16_t qemu_MAX[] = {
      S390_FEAT_MSA_EXT_5,
+    S390_FEAT_KIMD_SHA_256,
      S390_FEAT_KIMD_SHA_512,
+    S390_FEAT_KLMD_SHA_256,
      S390_FEAT_KLMD_SHA_512,
      S390_FEAT_PRNO_TRNG,
  };
diff --git a/target/s390x/tcg/cpacf.h b/target/s390x/tcg/cpacf.h
index d27839ddd9..e2c36306b2 100644
--- a/target/s390x/tcg/cpacf.h
+++ b/target/s390x/tcg/cpacf.h
@@ -8,6 +8,11 @@
  #ifndef S390X_CPACF_H
  #define S390X_CPACF_H
+/* from crypto_sha256.c */

The comment should be cpacf_sha256.c instead of crypto_sha256.c

+int cpacf_sha256(CPUS390XState *env, const int mmu_idx, uintptr_t ra,
+                 uint64_t param_addr, uint64_t *message_reg, uint64_t *len_reg,
+                 uint32_t type);
+
[ snip ]

Reply via email to