Next patch will add KVM specific user properties for both MISA and
multi-letter extensions. For MISA extensions we want to make use of what
is already available in misa_ext_cfgs[] to avoid code repetition.
misa_ext_info_arr[] array will hold name and description for each MISA
extension that misa_ext_cfgs[] is declaring. We'll then use this new
array in KVM code to avoid duplicating strings.
There's nothing holding us back from doing the same with multi-letter
extensions. For now doing just with MISA extensions is enough.
Suggested-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
---
target/riscv/cpu.c | 60 ++++++++++++++++++++++++++--------------------
target/riscv/cpu.h | 11 ++++++++-
2 files changed, 44 insertions(+), 27 deletions(-)
+const MISAExtInfo misa_ext_info_arr[] = {
+ [RVA] = {"a", "Atomic instructions"},
+ [RVC] = {"c", "Compressed instructions"},
+ [RVD] = {"d", "Double-precision float point"},
+ [RVF] = {"f", "Single-precision float point"},
+ [RVI] = {"i", "Base integer instruction set"},
+ [RVE] = {"e", "Base integer instruction set (embedded)"},
+ [RVM] = {"m", "Integer multiplication and division"},
+ [RVS] = {"s", "Supervisor-level instructions"},
+ [RVU] = {"u", "User-level instructions"},
+ [RVH] = {"h", "Hypervisor"},
+ [RVJ] = {"x-j", "Dynamic translated languages"},
+ [RVV] = {"v", "Vector operations"},
+ [RVG] = {"g", "General purpose (IMAFD_Zicsr_Zifencei)"},
+};