On Tue, May 12, 2026 at 1:31 PM Daniel Henrique Barboza
<[email protected]> wrote:
>
> Commit 7e4f75cadf ("target/riscv/tcg: hide warn for named feats when
> disabling via priv_ver") changed the design of
> disable_priv_spec_isa_exts to not warn when disabling what we were
> calling "named features" at that time.
>
> Back in that time we were adding RVA22 profile support and we were dealing
> with a RVI innovation: named features.  These can be define as cute
> names for pre-existing behavior/parameters, e.g. 'zic64b' means all
> cache blocks must have 64 bytes.  They do get inserted in the riscv,isa
> but they are not "real" extensions because users shouldn't be setting
> them in the command line, or so we thought back then, and we attempted
> to model that by calling it "named features".
>
> This didn't age that well: ziccrse is a so called named feature as far as
> TCG goes, but then KVM had to treat it as a regular extension that can be
> user set and we made an exception: ziccrse is a named feature that is
> user set by KVM.
>
> "Named features" are regular extensions that might or might not be user
> set, and might or might not warrant special handling during realize()
> by setting other parameters.  And we'll being treating them as such,
> which will culminate in the end of riscv_cpu_named_features[] array in
> the end.
>
> This reverts commit 7e4f75cadf44ee67809c7ca82645a289a5268966.
>
> Signed-off-by: Daniel Henrique Barboza <[email protected]>

Acked-by: Alistair Francis <[email protected]>

Alistair

> ---
>  target/riscv/tcg/tcg-cpu.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index a358d91ca5..92406bf41f 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -484,15 +484,6 @@ static void 
> riscv_cpu_disable_priv_spec_isa_exts(RISCVCPU *cpu)
>              }
>
>              isa_ext_update_enabled(cpu, edata->ext_enable_offset, false);
> -
> -            /*
> -             * Do not show user warnings for named features that users
> -             * can't enable/disable in the command line. See commit
> -             * 68c9e54bea for more info.
> -             */
> -            if (cpu_cfg_offset_is_named_feat(edata->ext_enable_offset)) {
> -                continue;
> -            }
>  #ifndef CONFIG_USER_ONLY
>              warn_report("disabling %s extension for hart 0x%" PRIx64
>                          " because privilege spec version does not match",
> @@ -520,9 +511,11 @@ static void riscv_cpu_update_named_features(RISCVCPU 
> *cpu)
>          cpu->cfg.has_priv_1_13 = true;
>      }
>
> +    /* zic64b is 1.12 or later */
>      cpu->cfg.ext_zic64b = cpu->cfg.cbom_blocksize == 64 &&
>                            cpu->cfg.cbop_blocksize == 64 &&
> -                          cpu->cfg.cboz_blocksize == 64;
> +                          cpu->cfg.cboz_blocksize == 64 &&
> +                          cpu->cfg.has_priv_1_12;
>
>      cpu->cfg.ext_ssstateen = cpu->cfg.ext_smstateen;
>
> --
> 2.43.0
>
>

Reply via email to