[PATCH v2 0/2] sparc64: Read qemu,hwcap-list on sun4u
From: Stian Halseth
Date: Wed Nov 18 2026 - 06:55:58 EST
QEMU's default sparc64 machine is sun4u. With -cpu ...,+crypto it
emulates the SPARC crypto opcodes and passes the hwcap-list to
OpenBIOS. OpenBIOS puts the list on the cpu node as qemu,hwcap-list.
Patch 2 reads it there. The crypto KUnit tests then run the sparc64
code under QEMU.
Patch 1 is new. Sashiko found that the hwcap-list parser reads past an
entry that has no NUL. The machine description parser has the same
bug, so patch 1 fixes it before patch 2 moves the code.
On sun4u, the ecb-, cbc- and ctr-aes-sparc64 glue loses its round keys
in skcipher_walk_done(). Under QEMU with +crypto, their self-tests
fail. No real sun4u CPU has the crypto opcodes. Eric's series moves
these modes into lib/crypto and fixes it:
https://lore.kernel.org/linux-crypto/20261118041033.50014-1-ebiggers@xxxxxxxxxx/
It is planned for 7.5 via libcrypto-next.
The QEMU side is in master for 11.2, commit a1eb9a1720 ("hw/sparc64:
Pass hwcap-list to OpenBIOS via fw_cfg"). The OpenBIOS side is on the
OpenBIOS list:
https://mail.coreboot.org/archives/list/openbios@xxxxxxxxxxxx/thread/3XVXVLHWT2T63IYWR67WPOHFSJGLP3NP/
Until QEMU ships an OpenBIOS with it, nvramrc can set the property:
NV='" /SUNW,UltraSPARC-IIi" find-device " vis" encode-string " vis2" encode-string encode+ " vis3" encode-string encode+ " aes" encode-string encode+ " sha1" encode-string encode+ " sha256" encode-string encode+ " sha512" encode-string encode+ " crc32c" encode-string encode+ " qemu,hwcap-list" property device-end'
./tools/testing/kunit/kunit.py run --arch=sparc64 \
--kunitconfig=lib/crypto/.kunitconfig \
--kunitconfig=lib/crc/.kunitconfig \
--qemu_args='-cpu TI-UltraSparc-IIi,+vis3,+crypto' \
--qemu_args='-prom-env use-nvramrc?=true' \
--qemu_args="-prom-env 'nvramrc=$NV'"
Changes in v2:
- New patch 1: stop the parser at an entry without a NUL (Sashiko).
- Patch 2: Eric's Tested-by. No other change.
- Dropped the lib/crypto question from the notes. Eric's series
answers it.
v1: https://lore.kernel.org/all/20261117112914.2300417-1-stian@xxxxxx/
Stian Halseth (2):
sparc64: Stop the hwcap-list parser at an unterminated entry
sparc64: Read qemu,hwcap-list from the OF cpu node on sun4u
arch/sparc/kernel/setup_64.c | 68 ++++++++++++++++++++++++++----------
1 file changed, 50 insertions(+), 18 deletions(-)
base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
--
2.43.0