qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/7] support subsets of scalar crypto extension
@ 2021-11-16  8:06 liweiwei
  2021-11-16  8:06 ` [RFC PATCH v2 1/7] target/riscv: rvk: add cfg properties for zbk* and zk* liweiwei
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: liweiwei @ 2021-11-16  8:06 UTC (permalink / raw)
  To: richard.henderson, palmer, alistair.francis, bin.meng, qemu-riscv,
	qemu-devel
  Cc: wangjunqiang, liweiwei, lazyparser, luruibo2000, lustrew

This patchset implements RISC-V K-extension v1.0.0.rc6 version instructions. 
Partial instructions are reused from B-extension.

Specification:
https://github.com/riscv/riscv-crypto

The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-k-upstream-v2

To test rvk implementation,  specify cpu argument with 'x-zks=true,x-zkn=true'  
or 
"x-zbkb=true,x-zbkc=true,x-zbkx=true,x-zknd=true,x-zkne=true,x-zknh=true,x-zksed=true,x-zksh=true,x-zkr=true"
 to enable  K-extension support.  This implementation can pass the ACT tests 
for K with our extended act support for qemu (available at 
https://github.com/plctlab/plct-qemu/tree/plct-k-upstream-v2-with-act)

v2:
* optimize implementation for brev8, xperm, zip, unzip
* use aes related sbox array from crypto/aes.h
* move sm4_sbox to crypto/sm4.c, and share it with target/arm

liweiwei (7):
  target/riscv: rvk: add cfg properties for zbk* and zk*
  target/riscv: rvk: add implementation of instructions for Zbk*
  crypto include/crypto target/arm: move sm4_sbox to crypto
  target/riscv: rvk: add implementation of instructions for Zk*
  target/riscv: rvk: add CSR support for Zkr
  disas/riscv.c: rvk: add disas support for Zbk* and Zk* instructions
  target/riscv: rvk: expose zbk* and zk* properties

 crypto/meson.build                      |   1 +
 crypto/sm4.c                            |  37 ++
 disas/riscv.c                           | 171 ++++++++-
 include/crypto/sm4.h                    |   6 +
 meson                                   |   2 +-
 target/arm/crypto_helper.c              |  36 +-
 target/riscv/bitmanip_helper.c          |  74 ++++
 target/riscv/cpu.c                      |  36 ++
 target/riscv/cpu.h                      |  13 +
 target/riscv/cpu_bits.h                 |   9 +
 target/riscv/crypto_helper.c            | 446 ++++++++++++++++++++++
 target/riscv/csr.c                      |  70 ++++
 target/riscv/helper.h                   |  48 +++
 target/riscv/insn32.decode              |  94 ++++-
 target/riscv/insn_trans/trans_rvb.c.inc | 127 ++++++-
 target/riscv/insn_trans/trans_rvk.c.inc | 467 ++++++++++++++++++++++++
 target/riscv/meson.build                |   1 +
 target/riscv/pmp.h                      |   8 +-
 target/riscv/translate.c                |   8 +
 19 files changed, 1583 insertions(+), 71 deletions(-)
 create mode 100644 crypto/sm4.c
 create mode 100644 include/crypto/sm4.h
 create mode 100644 target/riscv/crypto_helper.c
 create mode 100644 target/riscv/insn_trans/trans_rvk.c.inc

-- 
2.17.1



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

end of thread, other threads:[~2021-11-22  1:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16  8:06 [RFC PATCH v2 0/7] support subsets of scalar crypto extension liweiwei
2021-11-16  8:06 ` [RFC PATCH v2 1/7] target/riscv: rvk: add cfg properties for zbk* and zk* liweiwei
2021-11-22  1:58   ` Alistair Francis
2021-11-16  8:06 ` [RFC PATCH v2 2/7] target/riscv: rvk: add implementation of instructions for Zbk* liweiwei
2021-11-16  8:06 ` [RFC PATCH v2 3/7] crypto include/crypto target/arm: move sm4_sbox to crypto liweiwei
2021-11-16  8:06 ` [RFC PATCH v2 4/7] target/riscv: rvk: add implementation of instructions for Zk* liweiwei
2021-11-16  8:06 ` [RFC PATCH v2 5/7] target/riscv: rvk: add CSR support for Zkr liweiwei
2021-11-16  8:06 ` [RFC PATCH v2 6/7] disas/riscv.c: rvk: add disas support for Zbk* and Zk* instructions liweiwei
2021-11-16  8:06 ` [RFC PATCH v2 7/7] target/riscv: rvk: expose zbk* and zk* properties liweiwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).