mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stian Halseth <stian@itx.no>
To: sparclinux@vger.kernel.org
Cc: Andreas Larsson <andreas@gaisler.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Biggers <ebiggers@kernel.org>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	linux-kernel@vger.kernel.org, Stian Halseth <stian@itx.no>
Subject: [PATCH v2 0/2] sparc64: Read qemu,hwcap-list on sun4u
Date: Wed, 18 Nov 2026 12:55:35 +0100	[thread overview]
Message-ID: <20261118115537.160675-1-stian@itx.no> (raw)

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


             reply	other threads:[~2026-11-18 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 11:55 Stian Halseth [this message]
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

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=20261118115537.160675-1-stian@itx.no \
    --to=stian@itx.no \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=sparclinux@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

all inboxes | Powered by JetHome®