[Qemu-devel] [PATCH for 4.1 v1 4/6] target/riscvL Remove the unused any CPU

Alistair Francis posted 6 patches 6 years, 10 months ago
Maintainers: Alistair Francis <Alistair.Francis@wdc.com>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Palmer Dabbelt <palmer@sifive.com>
There is a newer version of this series
[Qemu-devel] [PATCH for 4.1 v1 4/6] target/riscvL Remove the unused any CPU
Posted by Alistair Francis 6 years, 10 months ago
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.c | 10 ----------
 target/riscv/cpu.h |  1 -
 2 files changed, 11 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index b6408e0a83..298413f6f6 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -188,15 +188,6 @@ static void riscv_generate_cpu_init(Object *obj)
     set_misa(env, rvxlen | target_misa);
 }
 
-
-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_resetvec(env, DEFAULT_RSTVEC);
-}
-
 #if defined(TARGET_RISCV32)
 
 static void rv32gcsu_priv1_09_1_cpu_init(Object *obj)
@@ -575,7 +566,6 @@ static const TypeInfo riscv_cpu_type_infos[] = {
         .class_size = sizeof(RISCVCPUClass),
         .class_init = riscv_cpu_class_init,
     },
-    DEFINE_CPU(TYPE_RISCV_CPU_ANY,              riscv_any_cpu_init),
     DEFINE_CPU(TYPE_RISCV_CPU_GEN,              riscv_generate_cpu_init),
 #if defined(TARGET_RISCV32)
     DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_09_1, rv32gcsu_priv1_09_1_cpu_init),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index bc877d8107..7d7caa294e 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -47,7 +47,6 @@
 #define RISCV_CPU_TYPE_NAME(name) (name RISCV_CPU_TYPE_SUFFIX)
 #define CPU_RESOLVING_TYPE TYPE_RISCV_CPU
 
-#define TYPE_RISCV_CPU_ANY              RISCV_CPU_TYPE_NAME("any")
 #define TYPE_RISCV_CPU_GEN              RISCV_CPU_TYPE_NAME("rv*")
 #define TYPE_RISCV_CPU_RV32GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.9.1")
 #define TYPE_RISCV_CPU_RV32GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.10.0")
-- 
2.21.0


Re: [Qemu-devel] [PATCH for 4.1 v1 4/6] target/riscvL Remove the unused any CPU
Posted by Peter Maydell 6 years, 10 months ago
On Tue, 19 Mar 2019 at 18:24, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  target/riscv/cpu.c | 10 ----------
>  target/riscv/cpu.h |  1 -
>  2 files changed, 11 deletions(-)

Won't this break linux-user? cpu_get_model() in linux-user/riscv/target_elf.h
specifies the "any" CPU as the default to use if the user doesn't
pass one on the command line. (In general you want the default for
linux-user to be an "as many features as possible enabled" CPU.)

thanks
-- PMM

Re: [Qemu-devel] [PATCH for 4.1 v1 4/6] target/riscvL Remove the unused any CPU
Posted by Alistair Francis 6 years, 10 months ago
On Tue, Mar 19, 2019 at 12:10 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Tue, 19 Mar 2019 at 18:24, Alistair Francis <Alistair.Francis@wdc.com> wrote:
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  target/riscv/cpu.c | 10 ----------
> >  target/riscv/cpu.h |  1 -
> >  2 files changed, 11 deletions(-)
>
> Won't this break linux-user? cpu_get_model() in linux-user/riscv/target_elf.h
> specifies the "any" CPU as the default to use if the user doesn't
> pass one on the command line. (In general you want the default for
> linux-user to be an "as many features as possible enabled" CPU.)

I don't have any linux-user tests setup at the moment so I'm not sure.
I'll add one and update this accordingly.

Alistair

>
> thanks
> -- PMM