Re: Does the SPARC optimized crypto and CRC code actually work?
Eric Biggers <[email protected]>
| Newsgroups | org.kernel.vger.sparclinux,org.kernel.vger.linux-crypto |
|---|---|
| Message-ID | <20260323182042.GA2205@quark> |
On Mon, Mar 23, 2026 at 06:36:52PM +0800, Nathaniel Roach wrote:
> On 17/3/26 15:16, John Paul Adrian Glaubitz wrote:
> > Hi Eric,
> >
> > On Tue, 2026-03-17 at 03:45 +0000, Eric Biggers wrote:
> > > On Tue, Mar 17, 2026 at 10:48:52AM +0800, Nathaniel Roach wrote:
> > > > I've been testing some of the PCI changes that have come through on my T5-2.
> > > > I'll happily add some tests for the crypto functions, I've just got no idea
> > > > how to do so.
> > > Well, try enabling all KUnit tests in lib/crc/ and lib/crypto/, as well
> > > as CONFIG_CRYPTO_SELFTESTS=y and CONFIG_CRYPTO_SELFTESTS_FULL=y.
> > >
> > > However, will this be a regular testing run, or only a one-off run? If
> > > it will only be one-off, we'll quickly be back to where we started.
> > >
> > > We need regular testing on either hardware or QEMU.
> > If Nathaniel can test the code from time to time for the time being, we should
> > already get some coverage. In the near future, we could certainly set up a CI
> > job if you let me know what infrastructure to use for it.
> >
> > Please keep in mind that a lot of us are doing this as volunteers and we don't
> > always have the possibilities to respond to such requests within a short time.
> >
> > Feel free to use the sparclinux issue tracker if you want to file any requests:
> >
> > https://github.com/sparclinux/issues/issues
> >
> > Adrian
> I enabled the below options, based on what I could find, in my test config:
>
> CONFIG_CRYPTO_SELFTESTS=y
> CONFIG_CRYPTO_SELFTESTS_FULL=y
> CONFIG_CRYPTO_ARIA,BLOWFISH,CAMELLIA,CAST5,CAST6,DES,FCRYPT,SERPENT,
> Â SM4_GENERIC,TWOFISH,CTR=m
> CONFIG_CRC_KUNIT_TEST=m
> CONFIG_CRC_BENCHMARK=y
> CONFIG_CRYPTO_LIB_BENCHMARK=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_KUNIT=m
I recommend using the latest linux-next, to get the latest KUnit-related
kconfig updates, and using the following on top of sparc64_defconfig:
(
cat lib/{crc,crypto}/.kunitconfig
echo CONFIG_EXPERT=y
echo CONFIG_CRYPTO=y
echo CONFIG_CRYPTO_SELFTESTS=y
echo CONFIG_CRYPTO_SELFTESTS_FULL=y
echo CONFIG_CRYPTO_DES_SPARC64=y
echo CONFIG_CRYPTO_AES_SPARC64=y
echo CONFIG_CRYPTO_CAMELLIA_SPARC64=y
echo CONFIG_CRYPTO_AES=y
echo CONFIG_CRYPTO_DES=y
echo CONFIG_CRYPTO_CAMELLIA=y
echo CONFIG_CRYPTO_ECB=y
echo CONFIG_CRYPTO_CBC=y
echo CONFIG_CRYPTO_CTR=y
) >> .config
Note: most of the complexity here is to fully enable the traditional
crypto self-tests to cover arch/sparc/crypto/. The plan is to finish
migrating those into lib/crypto/, in which case that code will become
covered by the lib/crypto/ tests and only the kunitconfigs would be
needed. But for now, the traditional tests are still needed too.
- Eric