All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] sparc64: Read qemu,hwcap-list on sun4u
@ 2026-11-18 11:55 Stian Halseth
  2026-11-18 11:55 ` [PATCH v2 1/2] sparc64: Stop the hwcap-list parser at an unterminated entry Stian Halseth
  2026-11-18 11:55 ` [PATCH v2 2/2] sparc64: Read qemu,hwcap-list from the OF cpu node on sun4u Stian Halseth
  0 siblings, 2 replies; 5+ messages in thread
From: Stian Halseth @ 2026-11-18 11:55 UTC (permalink / raw)
  To: sparclinux
  Cc: Andreas Larsson, David S . Miller, Eric Biggers, Mark Cave-Ayland,
	linux-kernel, Stian Halseth

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@kernel.org/
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@openbios.org/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@itx.no/

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-18 12:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 11:55 [PATCH v2 0/2] sparc64: Read qemu,hwcap-list on sun4u Stian Halseth
2026-11-18 11:55 ` [PATCH v2 1/2] sparc64: Stop the hwcap-list parser at an unterminated entry Stian Halseth
2026-11-18 12:07   ` sashiko-bot
2026-11-18 12:53     ` Stian Halseth
2026-11-18 11:55 ` [PATCH v2 2/2] sparc64: Read qemu,hwcap-list from the OF cpu node on sun4u Stian Halseth

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.