mbox series

[RFC,0/6] support subsets of scalar crypto extension

Message ID 20211102031128.17296-1-liweiwei@iscas.ac.cn (mailing list archive)
Headers show
Series support subsets of scalar crypto extension | expand

Message

Weiwei Li Nov. 2, 2021, 3:11 a.m. UTC
This patchset implements RISC-V K-extension v1.0.0.rc5 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

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-with-act)

liweiwei (6):
  target/riscv: rvk: add flag support for Zbk[bcx]
  target/riscv: rvk: add implementation of instructions for Zbk*  -
    reuse partial instructions of Zbb/Zbc extensions  - add brev8 packh,
    unzip, zip, etc.
  target/riscv: rvk: add flag support for
    Zk/Zkn/Zknd/Zknd/Zkne/Zknh/Zks/Zksed/Zksh/Zkr
  target/riscv: rvk: add implementation of instructions for Zk*
  target/riscv: rvk: add CSR support for Zkr:  - add SEED CSR  - add
    USEED, SSEED fields for MSECCFG CSR
  disas/riscv.c: rvk: add disas support for Zbk* and Zk* instructions

 disas/riscv.c                           | 171 +++++++-
 target/riscv/bitmanip_helper.c          |  94 +++++
 target/riscv/cpu.c                      |  45 +-
 target/riscv/cpu.h                      |  12 +
 target/riscv/cpu_bits.h                 |   9 +
 target/riscv/crypto_helper.c            | 540 ++++++++++++++++++++++++
 target/riscv/csr.c                      |  66 +++
 target/riscv/helper.h                   |  47 +++
 target/riscv/insn32.decode              |  94 ++++-
 target/riscv/insn_trans/trans_rvb.c.inc |  91 +++-
 target/riscv/insn_trans/trans_rvk.c.inc | 467 ++++++++++++++++++++
 target/riscv/meson.build                |   1 +
 target/riscv/pmp.h                      |   8 +-
 target/riscv/translate.c                |  83 ++++
 14 files changed, 1690 insertions(+), 38 deletions(-)
 create mode 100644 target/riscv/crypto_helper.c
 create mode 100644 target/riscv/insn_trans/trans_rvk.c.inc