Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()

2023-03-27 Thread Richard Henderson
On 3/27/23 15:15, Daniel Henrique Barboza wrote: On 3/27/23 15:52, Richard Henderson wrote: On 3/27/23 05:42, Daniel Henrique Barboza wrote: +static void cpu_set_misa_ext_cfg(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ +   

Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()

2023-03-27 Thread Daniel Henrique Barboza
On 3/27/23 15:52, Richard Henderson wrote: On 3/27/23 05:42, Daniel Henrique Barboza wrote: +static void cpu_set_misa_ext_cfg(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ +    RISCVCPUMisaExtConfig *misa_ext_cfg = opaque; const

Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()

2023-03-27 Thread Daniel Henrique Barboza
On 3/27/23 15:43, Richard Henderson wrote: On 3/27/23 05:42, Daniel Henrique Barboza wrote: +    g_autofree char *name = g_strdup_printf("%s", misa_cfg->name); +    g_autofree char *desc = g_strdup_printf("%s", misa_cfg->description); What is the point of this?  It would seem that

Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()

2023-03-27 Thread Richard Henderson
On 3/27/23 05:42, Daniel Henrique Barboza wrote: +static void cpu_set_misa_ext_cfg(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ +RISCVCPUMisaExtConfig *misa_ext_cfg = opaque; const +static void cpu_get_misa_ext_cfg(Object

Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()

2023-03-27 Thread Richard Henderson
On 3/27/23 05:42, Daniel Henrique Barboza wrote: +g_autofree char *name = g_strdup_printf("%s", misa_cfg->name); +g_autofree char *desc = g_strdup_printf("%s", misa_cfg->description); What is the point of this? It would seem that you could simply pass the original string

[PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()

2023-03-27 Thread Daniel Henrique Barboza
Ever since RISCVCPUConfig got introduced users are able to set CPU extensions in the command line. User settings are reflected in the cpu->cfg object for later use. These properties are used in the target/riscv/cpu.c code, most notably in riscv_cpu_validate_set_extensions(), where most of our