Skip to content

Commit

Permalink
target/riscv: Set privledge spec 1.11.0 as default
Browse files Browse the repository at this point in the history
Set the priv spec version 1.11.0 as the default and allow selecting it
via the command line.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
  • Loading branch information
alistair23 authored and palmer-dabbelt committed Jun 25, 2019
1 parent 747a43e commit e314750
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions target/riscv/cpu.c
Expand Up @@ -111,7 +111,7 @@ static void riscv_any_cpu_init(Object *obj)
{
CPURISCVState *env = &RISCV_CPU(obj)->env;
set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0);
set_resetvec(env, DEFAULT_RSTVEC);
}

Expand Down Expand Up @@ -316,7 +316,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
RISCVCPU *cpu = RISCV_CPU(dev);
CPURISCVState *env = &cpu->env;
RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
int priv_version = PRIV_VERSION_1_10_0;
int priv_version = PRIV_VERSION_1_11_0;
int user_version = USER_VERSION_2_02_0;
target_ulong target_misa = 0;
Error *local_err = NULL;
Expand All @@ -328,7 +328,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
}

if (cpu->cfg.priv_spec) {
if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
if (!g_strcmp0(cpu->cfg.priv_spec, "v1.11.0")) {
priv_version = PRIV_VERSION_1_11_0;
} else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
priv_version = PRIV_VERSION_1_10_0;
} else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.9.1")) {
priv_version = PRIV_VERSION_1_09_1;
Expand Down

0 comments on commit e314750

Please sign in to comment.