On 5/11/2026 2:17 AM, Zishun Yi wrote:
> The RISC-V unpriv specification (zvk.adoc) states that "Zvknhb
> implies Zvknha". This means that enabling Zvknhb should automatically
> enable Zvknha.
>
> Add Zvknha to ZVKNHB_IMPLIED to ensure the dependency is correctly
> enforced.
>
> This issue was discovered and reported by SpecHunter, an AI-driven
> architecture specification analysis tool.
>
> Link:https://github.com/yizishun/rv-isa-sec/blob/master/output/riscv-isa-manual/pr-2635/qemu.txt
> Signed-off-by: Zishun Yi <vulab@iscas.ac.cn>
> ---
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
> target/riscv/cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index ce15a17c37de..61430e44020e 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -2542,7 +2542,7 @@ static RISCVCPUImpliedExtsRule ZVKNG_IMPLIED = {
> static RISCVCPUImpliedExtsRule ZVKNHB_IMPLIED = {
> .ext = CPU_CFG_OFFSET(ext_zvknhb),
> .implied_multi_exts = {
> - CPU_CFG_OFFSET(ext_zve64x),
> + CPU_CFG_OFFSET(ext_zve64x), CPU_CFG_OFFSET(ext_zvknha),
>
> RISCV_IMPLIED_EXTS_RULE_END
> },