From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Kane Chen" <kane_chen@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>, "Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>, Troy Lee <troy_lee@aspeedtech.com>
Subject: [PATCH v2 00/17] Support the ASPEED HACE crypto command
Date: Wed, 15 Jul 2026 03:33:13 +0000 [thread overview]
Message-ID: <20260715033311.1648424-1-jamin_lin@aspeedtech.com> (raw)
The ASPEED HACE model only emulated the hash command; the crypto (cipher)
command was stubbed out. On the AST2700 the kernel runs the crypto driver
self-tests at boot, so without crypto emulation booting floods the log
with failures:
root@ast2700-default:~# dmesg | grep "self"
[ 6.078446] alg: self-tests for ctr(des) using aspeed-ctr-des failed (rc=-22)
[ 6.079295] alg: self-tests for ctr(des) using aspeed-ctr-des failed (rc=-22)
[ 6.089924] alg: self-tests for ctr(des3_ede) using aspeed-ctr-tdes failed (rc=-22)
[ 6.090629] alg: self-tests for ctr(des3_ede) using aspeed-ctr-tdes failed (rc=-22)
[ 6.100134] alg: self-tests for cbc(des3_ede) using aspeed-cbc-tdes failed (rc=-22)
[ 6.100416] alg: self-tests for ecb(des3_ede) using aspeed-ecb-tdes failed (rc=-22)
[ 6.100576] alg: self-tests for cbc(des3_ede) using aspeed-cbc-tdes failed (rc=-22)
[ 6.101411] alg: self-tests for ecb(des3_ede) using aspeed-ecb-tdes failed (rc=-22)
[ 6.152954] alg: self-tests for ecb(des) using aspeed-ecb-des failed (rc=-22)
[ 6.153701] alg: self-tests for ecb(des) using aspeed-ecb-des failed (rc=-22)
[ 6.180101] alg: self-tests for cbc(des) using aspeed-cbc-des failed (rc=-22)
[ 6.180747] alg: self-tests for cbc(des) using aspeed-cbc-des failed (rc=-22)
[ 6.206437] alg: self-tests for ctr(aes) using aspeed-ctr-aes failed (rc=-22)
[ 6.206910] alg: self-tests for ctr(aes) using aspeed-ctr-aes failed (rc=-22)
[ 6.215313] alg: self-tests for cbc(aes) using aspeed-cbc-aes failed (rc=-22)
[ 6.215698] alg: self-tests for cbc(aes) using aspeed-cbc-aes failed (rc=-22)
[ 6.227173] alg: self-tests for ecb(aes) using aspeed-ecb-aes failed (rc=-22)
[ 6.228027] alg: self-tests for ecb(aes) using aspeed-ecb-aes failed (rc=-22)
[ 6.276878] alg: self-tests for gcm(aes) using aspeed-gcm-aes failed (rc=-22)
[ 6.277541] alg: self-tests for gcm(aes) using aspeed-gcm-aes failed (rc=-22)
This series implements the HACE crypto command: AES/DES/3DES in ECB/CBC/CTR
over direct and scatter-gather DMA, and AES-GCM with 64-bit DMA on the
AST2700. It also adds GCM to the qcrypto cipher API (gcrypt backend) that
the AST2700 path needs, plus qtest and unit-test coverage.
With crypto emulated the self-tests pass, the warnings above disappear, and
the temporary 'cryptomgr.notests=1' boot workaround in the AST2700
functional tests is dropped.
v1:
1. Support the crypto command in direct access mode
2. Support scatter-gather mode for the crypto command
3. Support the AES-GCM mode for the crypto command
4. Support 64-bit DMA for the crypto command
5. Test the crypto command
6. Drop the AST2700 crypto self-test/model workaround
v2:
1. Add AES-GCM to the nettle and gnutls crypto backends
2. Skip crypto tests for cipher modes the
compiled backend does not support, via qcrypto_cipher_supports()
3. Check qcrypto_cipher_supports() before running a
crypt command and report the mode as unimplemented when the backend lacks it
Note: the gnutls crypto backend does not support CTR mode.
Jamin Lin (17):
hw/misc/aspeed_hace: Support the crypto command in direct access mode
tests/qtest/aspeed-hace: Test the crypto command on the AST2500
hw/misc/aspeed_hace: Support scatter-gather mode for the crypto
command
hw/misc/aspeed_hace: Support the CTR mode for the crypto command
tests/qtest/aspeed-hace: Test the crypto command on the AST2600
tests/qtest/aspeed-hace: Test the crypto command on the AST1030
crypto/cipher: Add GCM to QCryptoCipherMode
crypto/cipher: Add setaad/gettag for AEAD modes
crypto/cipher-gcrypt: Implement AES-GCM
crypto/cipher-nettle: Implement AES-GCM
crypto/cipher-gnutls: Implement AES-GCM
tests/unit/test-crypto-cipher: Test AES-GCM mode
hw/misc/aspeed_hace: Support 64-bit DMA for the crypto command
hw/misc/aspeed_hace: Support the AES-GCM mode for the crypto command
hw/misc/aspeed_hace: Enable the crypto command on the AST2700
tests/qtest/aspeed-hace: Test the crypto command on the AST2700
tests/functional/aarch64/test_aspeed_ast2700: Drop the AST2700 crypto
self-test workaround
qapi/crypto.json | 4 +-
crypto/cipherpriv.h | 8 +
include/crypto/cipher.h | 36 +
include/hw/misc/aspeed_hace.h | 1 -
tests/qtest/aspeed-hace-utils.h | 20 +
crypto/cipher.c | 32 +
hw/misc/aspeed_hace.c | 461 +++++++++++-
tests/qtest/aspeed-hace-utils.c | 693 ++++++++++++++++++
tests/qtest/aspeed_hace-test.c | 18 +
tests/qtest/ast2700-hace-test.c | 9 +
tests/unit/test-crypto-cipher.c | 240 ++++++
crypto/cipher-gcrypt.c.inc | 101 +++
crypto/cipher-gnutls.c.inc | 154 ++++
crypto/cipher-nettle.c.inc | 128 ++++
.../aarch64/test_aspeed_ast2700a1.py | 5 -
.../aarch64/test_aspeed_ast2700a2.py | 5 -
.../aarch64/test_aspeed_ast2700fc.py | 5 -
tests/qtest/meson.build | 6 +-
18 files changed, 1887 insertions(+), 39 deletions(-)
--
2.43.0
next reply other threads:[~2026-07-15 3:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 3:33 Jamin Lin [this message]
2026-07-15 3:33 ` [PATCH v2 01/17] hw/misc/aspeed_hace: Support the crypto command in direct access mode Jamin Lin
2026-07-15 3:33 ` [PATCH v2 02/17] tests/qtest/aspeed-hace: Test the crypto command on the AST2500 Jamin Lin
2026-07-15 3:33 ` [PATCH v2 03/17] hw/misc/aspeed_hace: Support scatter-gather mode for the crypto command Jamin Lin
2026-07-15 3:33 ` [PATCH v2 04/17] hw/misc/aspeed_hace: Support the CTR " Jamin Lin
2026-07-15 3:33 ` [PATCH v2 05/17] tests/qtest/aspeed-hace: Test the crypto command on the AST2600 Jamin Lin
2026-07-15 3:33 ` [PATCH v2 06/17] tests/qtest/aspeed-hace: Test the crypto command on the AST1030 Jamin Lin
2026-07-15 3:33 ` [PATCH v2 07/17] crypto/cipher: Add GCM to QCryptoCipherMode Jamin Lin
2026-07-15 4:51 ` Markus Armbruster
2026-07-15 3:33 ` [PATCH v2 08/17] crypto/cipher: Add setaad/gettag for AEAD modes Jamin Lin
2026-07-15 3:33 ` [PATCH v2 09/17] crypto/cipher-gcrypt: Implement AES-GCM Jamin Lin
2026-07-15 3:33 ` [PATCH v2 10/17] crypto/cipher-nettle: " Jamin Lin
2026-07-15 3:33 ` [PATCH v2 11/17] crypto/cipher-gnutls: " Jamin Lin
2026-07-15 3:33 ` [PATCH v2 12/17] tests/unit/test-crypto-cipher: Test AES-GCM mode Jamin Lin
2026-07-15 3:33 ` [PATCH v2 13/17] hw/misc/aspeed_hace: Support 64-bit DMA for the crypto command Jamin Lin
2026-07-15 3:33 ` [PATCH v2 14/17] hw/misc/aspeed_hace: Support the AES-GCM mode " Jamin Lin
2026-07-15 3:33 ` [PATCH v2 15/17] hw/misc/aspeed_hace: Enable the crypto command on the AST2700 Jamin Lin
2026-07-15 3:33 ` [PATCH v2 16/17] tests/qtest/aspeed-hace: Test " Jamin Lin
2026-07-15 3:33 ` [PATCH v2 17/17] tests/functional/aarch64/test_aspeed_ast2700: Drop the AST2700 crypto self-test workaround Jamin Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715033311.1648424-1-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=andrew@codeconstruct.com.au \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=joel@jms.id.au \
--cc=kane_chen@aspeedtech.com \
--cc=leetroy@gmail.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
--cc=troy_lee@aspeedtech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.