@samitouri / QOSamiQemu / commits / e66a14dfda

target/riscv/tcg: use only isa_edata_arr[] in cpu_cfg_ext_get_name()

We're using both isa_edata_arr[] and riscv_cpu_named_features[] to find an extension name based on a cfg offset. This is reminiscent of a past where isa_edata_arr[] didn't include entries for internal extensions. At this point we can use just isa_edata_arr[]. Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20260512032926.1978818-6-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 e66a14dfdabf0499c0dc473e66905bc8ab9ceb9d
1 file changed -7
target/riscv/tcg/tcg-cpu.c
-7
@@ -311,7 +311,6 @@ static int cpu_cfg_ext_get_min_version(uint32_t ext_offset)
311
312 static const char *cpu_cfg_ext_get_name(uint32_t ext_offset)
313 {
314 - const RISCVCPUMultiExtConfig *feat;
314 const RISCVIsaExtData *edata;
315
316 for (edata = isa_edata_arr; edata->name != NULL; edata++) {
@@ -320,12 +319,6 @@ static const char *cpu_cfg_ext_get_name(uint32_t ext_offset)
319 }
320 }
321
323 - for (feat = riscv_cpu_named_features; feat->name != NULL; feat++) {
324 - if (feat->offset == ext_offset) {
325 - return feat->name;
326 - }
327 - }
328 -
322 g_assert_not_reached();
323 }
324