[PATCH v2 0/2] target/sparc: Block-init stores for the crypto feature

Stian Halseth posted 2 patches 3 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261028113816.1651212-1-stian@itx.no
Maintainers: Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>
linux-user/sparc/elfload.c |  1 +
target/sparc/translate.c   | 43 ++++++++++++++++++++++++++++++++++++--
2 files changed, 42 insertions(+), 2 deletions(-)
[PATCH v2 0/2] target/sparc: Block-init stores for the crypto feature
Posted by Stian Halseth 3 weeks, 4 days ago
With the crypto feature, guests treat the CPU as a T4 or later. On those
CPUs a block-initializing store (ASI 0xe2 and the other twin ASIs) to the
start of a 32-byte block also zeroes the rest of the block. glibc's
niagara4 memset and Linux's NG4memset depend on it, and OpenSSL's T4 AES
code uses the FP form (stdfa). Patch 1 models this for both forms; patch
2 then reports HWCAP_SPARC_CRYPTO in linux-user.

v2:
- Test the alignment with TCG_COND_TSTNE (Richard)
- Skip offset 0 for 8-byte stores, which write it themselves (Richard).
  stba/stha/stwa at offset 0 still zero it: a T4 zeroes the rest of the
  first doubleword for those too.
- Rebased on master, now that the crypto instructions are in

v1: https://lore.kernel.org/qemu-devel/20261023114303.576319-1-stian@itx.no/

Stian Halseth (2):
  target/sparc: Model block-initializing stores
  linux-user/sparc: Report HWCAP_SPARC_CRYPTO for crypto CPU feature

 linux-user/sparc/elfload.c |  1 +
 target/sparc/translate.c   | 43 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 42 insertions(+), 2 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/2] target/sparc: Block-init stores for the crypto feature
Posted by Stian Halseth 3 weeks, 4 days ago
Hi Mark,

Would it be possible to get these two patches into your next sparc pull
request, before the soft freeze on Monday?

They complete the crypto series for linux-user, so it would be good to have
them in 11.2 together with patches 1-6.

Thanks!

/Stian


On Wed, 2026-10-28 at 12:38 +0100, Stian Halseth wrote:
> With the crypto feature, guests treat the CPU as a T4 or later. On those
> CPUs a block-initializing store (ASI 0xe2 and the other twin ASIs) to the
> start of a 32-byte block also zeroes the rest of the block. glibc's
> niagara4 memset and Linux's NG4memset depend on it, and OpenSSL's T4 AES
> code uses the FP form (stdfa). Patch 1 models this for both forms; patch
> 2 then reports HWCAP_SPARC_CRYPTO in linux-user.
> 
> v2:
> - Test the alignment with TCG_COND_TSTNE (Richard)
> - Skip offset 0 for 8-byte stores, which write it themselves (Richard).
>   stba/stha/stwa at offset 0 still zero it: a T4 zeroes the rest of the
>   first doubleword for those too.
> - Rebased on master, now that the crypto instructions are in
> 
> v1: https://lore.kernel.org/qemu-devel/20261023114303.576319-1-stian@itx.no/
> 
> Stian Halseth (2):
>   target/sparc: Model block-initializing stores
>   linux-user/sparc: Report HWCAP_SPARC_CRYPTO for crypto CPU feature
> 
>  linux-user/sparc/elfload.c |  1 +
>  target/sparc/translate.c   | 43 ++++++++++++++++++++++++++++++++++++--
>  2 files changed, 42 insertions(+), 2 deletions(-)
> 
Re: [PATCH v2 0/2] target/sparc: Block-init stores for the crypto feature
Posted by Mark Cave-Ayland 3 weeks, 4 days ago
On 28/10/2026 18:22, Stian Halseth wrote:

> Hi Mark,
> 
> Would it be possible to get these two patches into your next sparc pull
> request, before the soft freeze on Monday?
> 
> They complete the crypto series for linux-user, so it would be good to have
> them in 11.2 together with patches 1-6.
> 
> Thanks!
> 
> /Stian
Hi Stian,

I'll do my best to look at these patches over the weekend.


ATB,

Mark.