Skip to content

Commit 7e4f75c

Browse files
danielhbalistair23
authored andcommitted
target/riscv/tcg: hide warn for named feats when disabling via priv_ver
Commit 68c9e54 handled a situation where a warning was being shown when using the 'sifive_e' cpu when disabling the named extension zic64b. It makes little sense to show user warnings for named extensions that users can't control, and the solution taken was to disable zic64b manually in riscv_cpu_update_named_features(). This solution won't scale well when adding more named features, and can eventually end up repeating riscv_cpu_disable_priv_spec_isa_exts(). Change riscv_cpu_disable_priv_spec_isa_exts() to not show warnings when disabling a named feature. This will accomplish the same thing we're doing today while avoiding having two points where we're disabling exts via priv_ver mismatch. Signed-off-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Message-ID: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
1 parent fcea54c commit 7e4f75c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

target/riscv/tcg/tcg-cpu.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@ static void riscv_cpu_disable_priv_spec_isa_exts(RISCVCPU *cpu)
304304
}
305305

306306
isa_ext_update_enabled(cpu, edata->ext_enable_offset, false);
307+
308+
/*
309+
* Do not show user warnings for named features that users
310+
* can't enable/disable in the command line. See commit
311+
* 68c9e54bea for more info.
312+
*/
313+
if (cpu_cfg_offset_is_named_feat(edata->ext_enable_offset)) {
314+
continue;
315+
}
307316
#ifndef CONFIG_USER_ONLY
308317
warn_report("disabling %s extension for hart 0x" TARGET_FMT_lx
309318
" because privilege spec version does not match",
@@ -331,11 +340,9 @@ static void riscv_cpu_update_named_features(RISCVCPU *cpu)
331340
cpu->cfg.has_priv_1_13 = true;
332341
}
333342

334-
/* zic64b is 1.12 or later */
335343
cpu->cfg.ext_zic64b = cpu->cfg.cbom_blocksize == 64 &&
336344
cpu->cfg.cbop_blocksize == 64 &&
337-
cpu->cfg.cboz_blocksize == 64 &&
338-
cpu->cfg.has_priv_1_12;
345+
cpu->cfg.cboz_blocksize == 64;
339346
}
340347

341348
static void riscv_cpu_validate_g(RISCVCPU *cpu)

0 commit comments

Comments
 (0)