Skip to content

Commit

Permalink
target/riscv: Add cfg property for Zvkt extension
Browse files Browse the repository at this point in the history
Vector crypto spec defines the Zvkt extension that included all of the
instructions of Zvbb & Zvbc extensions and some vector instructions.

Signed-off-by: Max Chou <max.chou@sifive.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20231026151828.754279-2-max.chou@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
rnax authored and alistair23 committed Nov 7, 2023
1 parent c0ce1f2 commit 5ddbc83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions target/riscv/cpu_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ struct RISCVCPUConfig {
bool ext_zvknhb;
bool ext_zvksed;
bool ext_zvksh;
bool ext_zvkt;
bool ext_zmmul;
bool ext_zvfbfmin;
bool ext_zvfbfwma;
Expand Down
5 changes: 5 additions & 0 deletions target/riscv/tcg/tcg-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp)
return;
}

if (cpu->cfg.ext_zvkt) {
cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zvbb), true);
cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zvbc), true);
}

/*
* In principle Zve*x would also suffice here, were they supported
* in qemu
Expand Down

0 comments on commit 5ddbc83

Please sign in to comment.