From: Rosen Penev <rosenp@gmail.com>
To: linux-crypto@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
James Hsiao <jhsiao@amcc.com>, Rosen Penev <rosenp@gmail.com>,
Christian Lamparter <chunkeey@gmail.com>
Subject: [PATCH 0/8] crypto: amcc - fixes for the crypto4xx driver
Date: Thu, 26 Nov 2026 20:04:15 -0800 [thread overview]
Message-ID: <20261127040423.1023233-1-rosenp@gmail.com> (raw)
These fix bugs in the AMCC PPC4xx crypto driver (crypto4xx), found while
working on the driver on an APM82181-based Meraki MX60.
Patch 1 fixes a typo in the scatter ring full check. With it, batched
requests could overrun the scatter ring and leave the engine parked on a
descriptor with no further interrupts.
Patch 2 adds the missing DMA barriers when building and completing packet
descriptors. It also clears the stale PE_DONE bit of a reused descriptor,
so the completion handler cannot take a half-built descriptor for a
finished one.
Patches 3 and 4 make probe allocate all algorithm wrappers and set up the
TRNG before registering any algorithm. A registered algorithm's
self-tests can start on the engine right away, so probe cannot safely
unregister it again when a later step fails.
Patch 5 stops using memcpy() on the cache-inhibited SA and state record
pools, where its dcbz takes an alignment exception. Removing those traps
also made batched requests up to 3.8 times faster on the MX60.
Patch 6 fixes the DMA mappings: the source was never unmapped, the
destination was mapped and unmapped with different directions, and
neither mapping was checked.
Patch 7 fixes the inverted AEAD error ratelimit, and patch 8 wipes the SA
key material when it is freed.
Patches 1 to 6 were tested on the MX60 with the driver backported to an
OpenWrt 6.18.64 kernel, together with the first seven patches of the
follow-up modernization series. The full crypto self-tests pass for all
six algorithms. A test module comparing the engine against the software
implementations, with random lengths, scatterlist splits and in-place
requests, ran about 4 million requests without a mismatch and exercised
the backlog and ring-full paths. With CONFIG_DMA_API_DEBUG there were no
DMA API errors and no leaked mappings. Patches 7 and 8 were only
compile-tested.
An AI coding assistant (Claude Code, Claude Opus 5.5) was used to find
the bugs, write the fixes and the test module, run the tests on the MX60,
and draft the commit messages and this cover letter.
Rosen Penev (8):
crypto: amcc - fix scatter ring full check
crypto: amcc - fix missing DMA memory barriers in descriptor handling
crypto: amcc - allocate all algorithm wrappers before registering
crypto: amcc - set up the TRNG before registering the algorithms
crypto: amcc - don't use memcpy() on the coherent SA and state record
crypto: amcc - fix the DMA mappings of the source and destination
crypto: amcc - fix the inverted AEAD error ratelimit
crypto: amcc - wipe the SA key material when freeing it
drivers/crypto/amcc/crypto4xx_core.c | 237 +++++++++++++++++----------
drivers/crypto/amcc/crypto4xx_core.h | 24 ++-
2 files changed, 175 insertions(+), 86 deletions(-)
base-commit: 04cd6899aaaeeab82afb97e58eb8619fde35b47d
--
2.56.1
next reply other threads:[~2026-11-27 4:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 4:04 Rosen Penev [this message]
2026-11-27 4:04 ` [PATCH 1/8] crypto: amcc - fix scatter ring full check Rosen Penev
2026-11-27 4:04 ` [PATCH 2/8] crypto: amcc - fix missing DMA memory barriers in descriptor handling Rosen Penev
2026-11-27 4:04 ` [PATCH 3/8] crypto: amcc - allocate all algorithm wrappers before registering Rosen Penev
2026-11-27 4:04 ` [PATCH 4/8] crypto: amcc - set up the TRNG before registering the algorithms Rosen Penev
2026-11-27 4:04 ` [PATCH 5/8] crypto: amcc - don't use memcpy() on the coherent SA and state record Rosen Penev
2026-11-27 4:04 ` [PATCH 6/8] crypto: amcc - fix the DMA mappings of the source and destination Rosen Penev
2026-11-27 4:04 ` [PATCH 7/8] crypto: amcc - fix the inverted AEAD error ratelimit Rosen Penev
2026-11-27 4:04 ` [PATCH 8/8] crypto: amcc - wipe the SA key material when freeing it Rosen Penev
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=20261127040423.1023233-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=chunkeey@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jhsiao@amcc.com \
--cc=linux-crypto@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox