Skip to content

Commit

Permalink
target/riscv/cpu.c: split non-ratified exts from riscv_cpu_extensions[]
Browse files Browse the repository at this point in the history
Create a new riscv_cpu_experimental_exts[] to store the non-ratified
extensions properties. Once they are ratified we'll move them back to
riscv_cpu_extensions[].

riscv_cpu_add_user_properties() and riscv_cpu_add_kvm_properties() are
changed to keep adding non-ratified properties to users.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Message-ID: <20230901194627.1214811-6-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
danielhb authored and alistair23 committed Sep 8, 2023
1 parent 3ed0b54 commit 4a56b26
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion target/riscv/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1881,8 +1881,11 @@ static Property riscv_cpu_extensions[] = {
DEFINE_PROP_BOOL("xtheadsync", RISCVCPU, cfg.ext_xtheadsync, false),
DEFINE_PROP_BOOL("xventanacondops", RISCVCPU, cfg.ext_XVentanaCondOps, false),

/* These are experimental so mark with 'x-' */
DEFINE_PROP_END_OF_LIST(),
};

/* These are experimental so mark with 'x-' */
static Property riscv_cpu_experimental_exts[] = {
/* ePMP 0.9.3 */
DEFINE_PROP_BOOL("x-epmp", RISCVCPU, cfg.epmp, false),
DEFINE_PROP_BOOL("x-smaia", RISCVCPU, cfg.ext_smaia, false),
Expand Down Expand Up @@ -1975,6 +1978,10 @@ static void riscv_cpu_add_kvm_properties(Object *obj)
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
}

for (prop = riscv_cpu_experimental_exts; prop && prop->name; prop++) {
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
}

for (prop = riscv_cpu_options; prop && prop->name; prop++) {
/* Check if KVM created the property already */
if (object_property_find(obj, prop->name)) {
Expand Down Expand Up @@ -2014,6 +2021,10 @@ static void riscv_cpu_add_user_properties(Object *obj)
for (prop = riscv_cpu_options; prop && prop->name; prop++) {
qdev_property_add_static(dev, prop);
}

for (prop = riscv_cpu_experimental_exts; prop && prop->name; prop++) {
qdev_property_add_static(dev, prop);
}
}

static Property riscv_cpu_properties[] = {
Expand Down

0 comments on commit 4a56b26

Please sign in to comment.