@samitouri / QOSamiQemu / commits / 8f65a2e49a

target/riscv/tcg: treat all exts equally in cpu_disable_priv_spec_isa_exts

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 <daniel.barboza@oss.qualcomm.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20260512032926.1978818-5-daniel.barboza@oss.qualcomm.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Daniel Henrique Barboza committed May 12, 2026 at 00:29 UTC 8f65a2e49a7204f99d9601298fb901fb364d467a
1 file changed +3 -10
target/riscv/tcg/tcg-cpu.c
+3 -10
@@ -484,15 +484,6 @@ static void riscv_cpu_disable_priv_spec_isa_exts(RISCVCPU *cpu)
484 }
485
486 isa_ext_update_enabled(cpu, edata->ext_enable_offset, false);
487 -
488 - /*
489 - * Do not show user warnings for named features that users
490 - * can't enable/disable in the command line. See commit
491 - * 68c9e54bea for more info.
492 - */
493 - if (cpu_cfg_offset_is_named_feat(edata->ext_enable_offset)) {
494 - continue;
495 - }
487 #ifndef CONFIG_USER_ONLY
488 warn_report("disabling %s extension for hart 0x%" PRIx64
489 " because privilege spec version does not match",
@@ -520,9 +511,11 @@ static void riscv_cpu_update_named_features(RISCVCPU *cpu)
511 cpu->cfg.has_priv_1_13 = true;
512 }
513
514 + /* zic64b is 1.12 or later */
515 cpu->cfg.ext_zic64b = cpu->cfg.cbom_blocksize == 64 &&
516 cpu->cfg.cbop_blocksize == 64 &&
525 - cpu->cfg.cboz_blocksize == 64;
517 + cpu->cfg.cboz_blocksize == 64 &&
518 + cpu->cfg.has_priv_1_12;
519
520 cpu->cfg.ext_ssstateen = cpu->cfg.ext_smstateen;
521