RISC-V: Remove deprecated ISA, CPUs and machines
v4 cover RISC-V: Remove deprecated ISA, CPUs and machines
v4:
- Remove all of the < PRIV_VERSION_1_10_0 checks
- Move the documentation to the "Recently removed features" section
- Document the OpenSBI deprecation
v3:
- Don't use SiFive CPUs for Spike machine
v2:
- Remove the CPUs and ISA seperatley
Alistair Francis (4):
hw/riscv: spike: Remove deprecated ISA specific machines target/riscv: Remove the deprecated CPUs target/riscv: Drop support for ISA spec version 1.09.1
docs: deprecated: Update the -bios documentation
docs/system/deprecated.rst | 98 ++++---- include/hw/riscv/spike.h | 6 +- target/riscv/cpu.h | 8 - hw/riscv/spike.c | 217 ------------------ target/riscv/cpu.c | 30 --- target/riscv/cpu_helper.c | 82 +++---- target/riscv/csr.c | 138 ++--------- .../riscv/insn_trans/trans_privileged.inc.c | 18 +- target/riscv/monitor.c | 5 - target/riscv/op_helper.c | 17 +- tests/qtest/machine-none-test.c | 4 +- 11 files changed, 118 insertions(+), 505 deletions(-)
Signature · 1 line
2.26.2
PATCH v4 1/4 hw/riscv: spike: Remove deprecated ISA specific machines
The ISA specific Spike machines have been deprecated in QEMU since 4.1, let's finally remove them.
--- docs/system/deprecated.rst | 17 +-- include/hw/riscv/spike.h | 6 +- hw/riscv/spike.c | 217 ------------------------------------- 3 files changed, 12 insertions(+), 228 deletions(-)
docs/system/deprecated.rst +10 -7
@@ -379,13 +379,6 @@ This machine has been renamed ``fuloong2e``. These machine types are very old and likely can not be used for live migration from old QEMU versions anymore. A newer machine type should be used instead. -``spike_v1.9.1`` and ``spike_v1.10`` (since 4.1) -'''''''''''''''''''''''''''''''''''''''''''''''' - -The version specific Spike machines have been deprecated in favour of the -generic ``spike`` machine. If you need to specify an older version of the RISC-V -spec you can use the ``-cpu rv64gcsu,priv_spec=v1.9.1`` command line argument. - Device options --------------
@@ -493,6 +486,16 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0 The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and 'hostfwd_remove' HMP commands has been replaced by ``netdev_id``. +System emulator machines +------------------------ + +``spike_v1.9.1`` and ``spike_v1.10`` (removed in 5.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The version specific Spike machines have been removed in favour of the +generic ``spike`` machine. If you need to specify an older version of the RISC-V +spec you can use the ``-cpu rv64gcsu,priv_spec=v1.10.0`` command line argument. + Related binaries ----------------
include/hw/riscv/spike.h +2 -4
@@ -39,11 +39,9 @@ enum { };#if defined(TARGET_RISCV32 ) -#define SPIKE_V1_09_1_CPU TYPE_RISCV_CPU_RV32GCSU_V1_09_1 -#define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_RV32GCSU_V1_10_0 +#define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_BASE32#elif defined(TARGET_RISCV64 ) -#define SPIKE_V1_09_1_CPU TYPE_RISCV_CPU_RV64GCSU_V1_09_1 -#define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_RV64GCSU_V1_10_0 +#define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_BASE64#endif #endif
hw/riscv/spike.c +0 -217
227 lines not on this page · raw message
Signature · 1 line
2.26.2
Re: [PATCH v4 1/4] hw/riscv: spike: Remove deprecated ISA specific machines
Quoted 11 lines · Alistair Francis
The ISA specific Spike machines have been deprecated in QEMU since 4.1, let's finally remove them.
Signed-off-by Alistair Francis <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Bin Meng <[email protected]>--- docs/system/deprecated.rst | 17 +-- include/hw/riscv/spike.h | 6 +- hw/riscv/spike.c | 217 ------------------------------------- 3 files changed, 12 insertions(+), 228 deletions(-)
PATCH v4 2/4 target/riscv: Remove the deprecated CPUs
In reply to Alistair Francis--- docs/system/deprecated.rst | 33 ++++++++++++++++++--------------- target/riscv/cpu.h | 7 ------- target/riscv/cpu.c | 28 ---------------------------- tests/qtest/machine-none-test.c | 4 ++-- 4 files changed, 20 insertions(+), 52 deletions(-)
docs/system/deprecated.rst +18 -15
@@ -314,21 +314,6 @@ should be used instead of the 1.09.1 version. System emulator CPUS -------------------- -RISC-V ISA CPUs (since 4.1) -''''''''''''''''''''''''''' - -The RISC-V cpus with the ISA version in the CPU name have been depcreated. The -four CPUs are: ``rv32gcsu-v1.9.1``, ``rv32gcsu-v1.10.0``, ``rv64gcsu-v1.9.1`` and -``rv64gcsu-v1.10.0``. Instead the version can be specified via the CPU ``priv_spec`` -option when using the ``rv32`` or ``rv64`` CPUs. - -RISC-V ISA CPUs (since 4.1) -''''''''''''''''''''''''''' - -The RISC-V no MMU cpus have been depcreated. The two CPUs: ``rv32imacu-nommu`` and -``rv64imacu-nommu`` should no longer be used. Instead the MMU status can be specified -via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. - ``compat`` property of server class POWER CPUs (since 5.0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -486,6 +471,24 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0 The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and 'hostfwd_remove' HMP commands has been replaced by ``netdev_id``. +System emulator CPUS +-------------------- + +RISC-V ISA CPUs (removed in 5.1) +'''''''''''''''''''''''''''''''' + +The RISC-V cpus with the ISA version in the CPU name have been removed. The +four CPUs are: ``rv32gcsu-v1.9.1``, ``rv32gcsu-v1.10.0``, ``rv64gcsu-v1.9.1`` and +``rv64gcsu-v1.10.0``. Instead the version can be specified via the CPU ``priv_spec`` +option when using the ``rv32`` or ``rv64`` CPUs. + +RISC-V ISA CPUs (removed in 5.1) +'''''''''''''''''''''''''''''''' + +The RISC-V no MMU cpus have been removed. The two CPUs: ``rv32imacu-nommu`` and +``rv64imacu-nommu`` can no longer be used. Instead the MMU status can be specified +via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. + System emulator machines ------------------------
target/riscv/cpu.h +0 -7
@@ -40,13 +40,6 @@#define TYPE_RISCV_CPU_SIFIVE_E51 RISCV_CPU_TYPE_NAME("sifive-e51")#define TYPE_RISCV_CPU_SIFIVE_U34 RISCV_CPU_TYPE_NAME("sifive-u34")#define TYPE_RISCV_CPU_SIFIVE_U54 RISCV_CPU_TYPE_NAME("sifive-u54") -/* Deprecated */ -#define TYPE_RISCV_CPU_RV32IMACU_NOMMU RISCV_CPU_TYPE_NAME("rv32imacu-nommu") -#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") -#define TYPE_RISCV_CPU_RV64IMACU_NOMMU RISCV_CPU_TYPE_NAME("rv64imacu-nommu") -#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1") -#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")#define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))#define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))
target/riscv/cpu.c +0 -28
@@ -135,16 +135,6 @@ static void riscv_base32_cpu_init(Object *obj)set_misa (env,0 ); } -static void rv32gcsu_priv1_09_1_cpu_init (Object *obj) -{ -CPURISCVState *env = &RISCV_CPU (obj)->env; -set_misa (env,RV32 |RVI |RVM |RVA |RVF |RVD |RVC |RVS |RVU ); -set_priv_version (env,PRIV_VERSION_1_09_1 ); -set_resetvec (env,DEFAULT_RSTVEC ); -set_feature (env,RISCV_FEATURE_MMU ); -set_feature (env,RISCV_FEATURE_PMP ); -} -static void rv32gcsu_priv1_10_0_cpu_init (Object *obj) {CPURISCVState *env = &RISCV_CPU (obj)->env;
@@ -182,16 +172,6 @@ static void riscv_base64_cpu_init(Object *obj)set_misa (env,0 ); } -static void rv64gcsu_priv1_09_1_cpu_init (Object *obj) -{ -CPURISCVState *env = &RISCV_CPU (obj)->env; -set_misa (env,RV64 |RVI |RVM |RVA |RVF |RVD |RVC |RVS |RVU ); -set_priv_version (env,PRIV_VERSION_1_09_1 ); -set_resetvec (env,DEFAULT_RSTVEC ); -set_feature (env,RISCV_FEATURE_MMU ); -set_feature (env,RISCV_FEATURE_PMP ); -} -static void rv64gcsu_priv1_10_0_cpu_init (Object *obj) {CPURISCVState *env = &RISCV_CPU (obj)->env;
@@ -621,18 +601,10 @@ static const TypeInfo riscv_cpu_type_infos[] = { DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31, rv32imacu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34, rv32imafcu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34, rv32gcsu_priv1_10_0_cpu_init), -/* Depreacted */ -DEFINE_CPU (TYPE_RISCV_CPU_RV32IMACU_NOMMU , rv32imacu_nommu_cpu_init), -DEFINE_CPU (TYPE_RISCV_CPU_RV32GCSU_V1_09_1 , rv32gcsu_priv1_09_1_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init) #elif defined(TARGET_RISCV64) DEFINE_CPU(TYPE_RISCV_CPU_BASE64, riscv_base64_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51, rv64imacu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54, rv64gcsu_priv1_10_0_cpu_init), -/* Deprecated */ -DEFINE_CPU (TYPE_RISCV_CPU_RV64IMACU_NOMMU , rv64imacu_nommu_cpu_init), -DEFINE_CPU (TYPE_RISCV_CPU_RV64GCSU_V1_09_1 , rv64gcsu_priv1_09_1_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init)#endif };
tests/qtest/machine-none-test.c +2 -2
@@ -54,8 +54,8 @@ static struct arch2cpu cpus_map[] = { { "xtensa", "dc233c" }, { "xtensaeb", "fsf" }, { "hppa", "hppa" }, - { "riscv64", "rv64gcsu-v1.10.0" }, - { "riscv32", "rv32gcsu-v1.9.1" }, + { "riscv64", "sifive-u54" }, + { "riscv32", "sifive-u34" }, { "rx", "rx62n" }, };
Signature · 1 line
2.26.2
Re: [PATCH v4 2/4] target/riscv: Remove the deprecated CPUs
Quoted 17 lines · Alistair Francis
Signed-off-by Alistair Francis <[email protected]>Reviewed-by Bin Meng <[email protected]>--- docs/system/deprecated.rst | 33 ++++++++++++++++++--------------- target/riscv/cpu.h | 7 ------- target/riscv/cpu.c | 28 ---------------------------- tests/qtest/machine-none-test.c | 4 ++-- 4 files changed, 20 insertions(+), 52 deletions(-)docs/system/deprecated.rst +0
-0@@ -314,21 +314,6 @@ should be used instead of the 1.09.1 version. System emulator CPUS --------------------
docs/system/deprecated.rst should be used instead of the 1.09.1 version. · line 325
Quoted 10 lines
docs/system/deprecated.rst +0
-9-RISC-V ISA CPUs (since 4.1) -''''''''''''''''''''''''''' - -The RISC-V cpus with the ISA version in the CPU name have been depcreated. The -four CPUs are: ``rv32gcsu-v1.9.1``, ``rv32gcsu-v1.10.0``, ``rv64gcsu-v1.9.1`` and -``rv64gcsu-v1.10.0``. Instead the version can be specified via the CPU ``priv_spec`` -option when using the ``rv32`` or ``rv64`` CPUs. - -RISC-V ISA CPUs (since 4.1)
Not sure if this is a typo. Should we say: RISC-V no MMU CPUs ? If not, since the subsection titles are the same, should we merge the following description to above?
Quoted 114 lines
docs/system/deprecated.rst +18
-6-''''''''''''''''''''''''''' - -The RISC-V no MMU cpus have been depcreated. The two CPUs: ``rv32imacu-nommu`` and -``rv64imacu-nommu`` should no longer be used. Instead the MMU status can be specified -via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. - ``compat`` property of server class POWER CPUs (since 5.0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''@@ -486,6 +471,24 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0 The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and 'hostfwd_remove' HMP commands has been replaced by ``netdev_id``. +System emulator CPUS +-------------------- + +RISC-V ISA CPUs (removed in 5.1) +'''''''''''''''''''''''''''''''' + +The RISC-V cpus with the ISA version in the CPU name have been removed. The +four CPUs are: ``rv32gcsu-v1.9.1``, ``rv32gcsu-v1.10.0``, ``rv64gcsu-v1.9.1`` and +``rv64gcsu-v1.10.0``. Instead the version can be specified via the CPU ``priv_spec`` +option when using the ``rv32`` or ``rv64`` CPUs. + +RISC-V ISA CPUs (removed in 5.1) +'''''''''''''''''''''''''''''''' + +The RISC-V no MMU cpus have been removed. The two CPUs: ``rv32imacu-nommu`` and +``rv64imacu-nommu`` can no longer be used. Instead the MMU status can be specified +via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. + System emulator machines ------------------------target/riscv/cpu.h +0
-7@@ -40,13 +40,6 @@#define TYPE_RISCV_CPU_SIFIVE_E51 RISCV_CPU_TYPE_NAME("sifive-e51")#define TYPE_RISCV_CPU_SIFIVE_U34 RISCV_CPU_TYPE_NAME("sifive-u34")#define TYPE_RISCV_CPU_SIFIVE_U54 RISCV_CPU_TYPE_NAME("sifive-u54") -/* Deprecated */ -#define TYPE_RISCV_CPU_RV32IMACU_NOMMU RISCV_CPU_TYPE_NAME("rv32imacu-nommu") -#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") -#define TYPE_RISCV_CPU_RV64IMACU_NOMMU RISCV_CPU_TYPE_NAME("rv64imacu-nommu") -#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1") -#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")#define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))#define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))target/riscv/cpu.c +0
-28@@ -135,16 +135,6 @@ static void riscv_base32_cpu_init(Object *obj)set_misa (env,0 ); } -static void rv32gcsu_priv1_09_1_cpu_init (Object *obj) -{ -CPURISCVState *env = &RISCV_CPU (obj)->env; -set_misa (env,RV32 |RVI |RVM |RVA |RVF |RVD |RVC |RVS |RVU ); -set_priv_version (env,PRIV_VERSION_1_09_1 ); -set_resetvec (env,DEFAULT_RSTVEC ); -set_feature (env,RISCV_FEATURE_MMU ); -set_feature (env,RISCV_FEATURE_PMP ); -} -static void rv32gcsu_priv1_10_0_cpu_init (Object *obj) {CPURISCVState *env = &RISCV_CPU (obj)->env;@@ -182,16 +172,6 @@ static void riscv_base64_cpu_init(Object *obj)set_misa (env,0 ); } -static void rv64gcsu_priv1_09_1_cpu_init (Object *obj) -{ -CPURISCVState *env = &RISCV_CPU (obj)->env; -set_misa (env,RV64 |RVI |RVM |RVA |RVF |RVD |RVC |RVS |RVU ); -set_priv_version (env,PRIV_VERSION_1_09_1 ); -set_resetvec (env,DEFAULT_RSTVEC ); -set_feature (env,RISCV_FEATURE_MMU ); -set_feature (env,RISCV_FEATURE_PMP ); -} -static void rv64gcsu_priv1_10_0_cpu_init (Object *obj) {CPURISCVState *env = &RISCV_CPU (obj)->env;@@ -621,18 +601,10 @@ static const TypeInfo riscv_cpu_type_infos[] = { DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31, rv32imacu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34, rv32imafcu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34, rv32gcsu_priv1_10_0_cpu_init), -/* Depreacted */ -DEFINE_CPU (TYPE_RISCV_CPU_RV32IMACU_NOMMU , rv32imacu_nommu_cpu_init), -DEFINE_CPU (TYPE_RISCV_CPU_RV32GCSU_V1_09_1 , rv32gcsu_priv1_09_1_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init) #elif defined(TARGET_RISCV64) DEFINE_CPU(TYPE_RISCV_CPU_BASE64, riscv_base64_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51, rv64imacu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54, rv64gcsu_priv1_10_0_cpu_init), -/* Deprecated */ -DEFINE_CPU (TYPE_RISCV_CPU_RV64IMACU_NOMMU , rv64imacu_nommu_cpu_init), -DEFINE_CPU (TYPE_RISCV_CPU_RV64GCSU_V1_09_1 , rv64gcsu_priv1_09_1_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init)#endif };tests/qtest/machine-none-test.c +0
-0
tests/qtest/machine-none-test.c static struct arch2cpu cpus_map[] = { · line 58
Quoted 7 lines
tests/qtest/machine-none-test.c +2
-2@@ -54,8 +54,8 @@ static struct arch2cpu cpus_map[] = { { "xtensa", "dc233c" }, { "xtensaeb", "fsf" }, { "hppa", "hppa" }, - { "riscv64", "rv64gcsu-v1.10.0" }, - { "riscv32", "rv32gcsu-v1.9.1" }, + { "riscv64", "sifive-u54" }, + { "riscv32", "sifive-u34" },
I believe we should use "rv32" and "rv64" here.
tests/qtest/machine-none-test.c static struct arch2cpu cpus_map[] = { · line 60
Quoted 2 lines
tests/qtest/machine-none-test.c +0
-0{ "rx", "rx62n" }, };
Regards,
Bin
Re: [PATCH v4 2/4] target/riscv: Remove the deprecated CPUs
Quoted 21 lines · Bin Meng
Quoted 18 lines · Alistair Francis
Signed-off-by Alistair Francis <[email protected]>Reviewed-by Bin Meng <[email protected]>--- docs/system/deprecated.rst | 33 ++++++++++++++++++--------------- target/riscv/cpu.h | 7 ------- target/riscv/cpu.c | 28 ---------------------------- tests/qtest/machine-none-test.c | 4 ++-- 4 files changed, 20 insertions(+), 52 deletions(-)docs/system/deprecated.rst +0
-0@@ -314,21 +314,6 @@ should be used instead of the 1.09.1 version. System emulator CPUS --------------------
Quoted 13 lines
docs/system/deprecated.rst should be used instead of the 1.09.1 version. · line 325
Quoted 9 lines
docs/system/deprecated.rst +0
-9-RISC-V ISA CPUs (since 4.1) -''''''''''''''''''''''''''' - -The RISC-V cpus with the ISA version in the CPU name have been depcreated. The -four CPUs are: ``rv32gcsu-v1.9.1``, ``rv32gcsu-v1.10.0``, ``rv64gcsu-v1.9.1`` and -``rv64gcsu-v1.10.0``. Instead the version can be specified via the CPU ``priv_spec`` -option when using the ``rv32`` or ``rv64`` CPUs. - -RISC-V ISA CPUs (since 4.1)Not sure if this is a typo. Should we say: RISC-V no MMU CPUs ? If not, since the subsection titles are the same, should we merge the following description to above?
Good point.
To be more clear I have changed this to:
RISC-V ISA Specific CPUs (removed in 5.1)
...
RISC-V no MMU CPUs (removed in 5.1)
Quoted 110 lines
Quoted 110 lines
docs/system/deprecated.rst +18
-6-''''''''''''''''''''''''''' - -The RISC-V no MMU cpus have been depcreated. The two CPUs: ``rv32imacu-nommu`` and -``rv64imacu-nommu`` should no longer be used. Instead the MMU status can be specified -via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. - ``compat`` property of server class POWER CPUs (since 5.0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''@@ -486,6 +471,24 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0 The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and 'hostfwd_remove' HMP commands has been replaced by ``netdev_id``. +System emulator CPUS +-------------------- + +RISC-V ISA CPUs (removed in 5.1) +'''''''''''''''''''''''''''''''' + +The RISC-V cpus with the ISA version in the CPU name have been removed. The +four CPUs are: ``rv32gcsu-v1.9.1``, ``rv32gcsu-v1.10.0``, ``rv64gcsu-v1.9.1`` and +``rv64gcsu-v1.10.0``. Instead the version can be specified via the CPU ``priv_spec`` +option when using the ``rv32`` or ``rv64`` CPUs. + +RISC-V ISA CPUs (removed in 5.1) +'''''''''''''''''''''''''''''''' + +The RISC-V no MMU cpus have been removed. The two CPUs: ``rv32imacu-nommu`` and +``rv64imacu-nommu`` can no longer be used. Instead the MMU status can be specified +via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. + System emulator machines ------------------------target/riscv/cpu.h +0
-7@@ -40,13 +40,6 @@#define TYPE_RISCV_CPU_SIFIVE_E51 RISCV_CPU_TYPE_NAME("sifive-e51")#define TYPE_RISCV_CPU_SIFIVE_U34 RISCV_CPU_TYPE_NAME("sifive-u34")#define TYPE_RISCV_CPU_SIFIVE_U54 RISCV_CPU_TYPE_NAME("sifive-u54") -/* Deprecated */ -#define TYPE_RISCV_CPU_RV32IMACU_NOMMU RISCV_CPU_TYPE_NAME("rv32imacu-nommu") -#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") -#define TYPE_RISCV_CPU_RV64IMACU_NOMMU RISCV_CPU_TYPE_NAME("rv64imacu-nommu") -#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1") -#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")#define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))#define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))target/riscv/cpu.c +0
-28@@ -135,16 +135,6 @@ static void riscv_base32_cpu_init(Object *obj)set_misa (env,0 ); } -static void rv32gcsu_priv1_09_1_cpu_init (Object *obj) -{ -CPURISCVState *env = &RISCV_CPU (obj)->env; -set_misa (env,RV32 |RVI |RVM |RVA |RVF |RVD |RVC |RVS |RVU ); -set_priv_version (env,PRIV_VERSION_1_09_1 ); -set_resetvec (env,DEFAULT_RSTVEC ); -set_feature (env,RISCV_FEATURE_MMU ); -set_feature (env,RISCV_FEATURE_PMP ); -} -static void rv32gcsu_priv1_10_0_cpu_init (Object *obj) {CPURISCVState *env = &RISCV_CPU (obj)->env;@@ -182,16 +172,6 @@ static void riscv_base64_cpu_init(Object *obj)set_misa (env,0 ); } -static void rv64gcsu_priv1_09_1_cpu_init (Object *obj) -{ -CPURISCVState *env = &RISCV_CPU (obj)->env; -set_misa (env,RV64 |RVI |RVM |RVA |RVF |RVD |RVC |RVS |RVU ); -set_priv_version (env,PRIV_VERSION_1_09_1 ); -set_resetvec (env,DEFAULT_RSTVEC ); -set_feature (env,RISCV_FEATURE_MMU ); -set_feature (env,RISCV_FEATURE_PMP ); -} -static void rv64gcsu_priv1_10_0_cpu_init (Object *obj) {CPURISCVState *env = &RISCV_CPU (obj)->env;@@ -621,18 +601,10 @@ static const TypeInfo riscv_cpu_type_infos[] = { DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31, rv32imacu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34, rv32imafcu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34, rv32gcsu_priv1_10_0_cpu_init), -/* Depreacted */ -DEFINE_CPU (TYPE_RISCV_CPU_RV32IMACU_NOMMU , rv32imacu_nommu_cpu_init), -DEFINE_CPU (TYPE_RISCV_CPU_RV32GCSU_V1_09_1 , rv32gcsu_priv1_09_1_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init) #elif defined(TARGET_RISCV64) DEFINE_CPU(TYPE_RISCV_CPU_BASE64, riscv_base64_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51, rv64imacu_nommu_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54, rv64gcsu_priv1_10_0_cpu_init), -/* Deprecated */ -DEFINE_CPU (TYPE_RISCV_CPU_RV64IMACU_NOMMU , rv64imacu_nommu_cpu_init), -DEFINE_CPU (TYPE_RISCV_CPU_RV64GCSU_V1_09_1 , rv64gcsu_priv1_09_1_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init)#endif };
Quoted 14 lines
tests/qtest/machine-none-test.c static struct arch2cpu cpus_map[] = { · line 58
Quoted 12 lines
tests/qtest/machine-none-test.c +2
-2@@ -54,8 +54,8 @@ static struct arch2cpu cpus_map[] = { { "xtensa", "dc233c" }, { "xtensaeb", "fsf" }, { "hppa", "hppa" }, - { "riscv64", "rv64gcsu-v1.10.0" }, - { "riscv32", "rv32gcsu-v1.9.1" }, + { "riscv64", "sifive-u54" }, + { "riscv32", "sifive-u34" },I believe we should use "rv32" and "rv64" here.
Done.
Alistair
Quoted 6 lines
tests/qtest/machine-none-test.c static struct arch2cpu cpus_map[] = { · line 60
Quoted 3 lines
tests/qtest/machine-none-test.c +0
-0{ "rx", "rx62n" }, };Regards,
Bin
PATCH v4 3/4 target/riscv: Drop support for ISA spec version 1.09.1
In reply to Alistair FrancisThe RISC-V ISA spec version 1.09.1 has been deprecated in QEMU since 4.1. It's not commonly used so let's remove support for it.
--- docs/system/deprecated.rst | 20 +-- target/riscv/cpu.h | 1 - target/riscv/cpu.c | 2 - target/riscv/cpu_helper.c | 82 ++++------- target/riscv/csr.c | 138 ++++-------------- .../riscv/insn_trans/trans_privileged.inc.c | 18 +-- target/riscv/monitor.c | 5 - target/riscv/op_helper.c | 17 +-- 8 files changed, 73 insertions(+), 210 deletions(-)
docs/system/deprecated.rst +10 -10
@@ -301,16 +301,6 @@ The ``acl_show``, ``acl_reset``, ``acl_policy``, ``acl_add``, and ``acl_remove`` commands are deprecated with no replacement. Authorization for VNC should be performed using the pluggable QAuthZ objects. -Guest Emulator ISAs -------------------- - -RISC-V ISA privledge specification version 1.09.1 (since 4.1) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -The RISC-V ISA privledge specification version 1.09.1 has been deprecated. -QEMU supports both the newer version 1.10.0 and the ratified version 1.11.0, these -should be used instead of the 1.09.1 version. - System emulator CPUS --------------------
@@ -471,6 +461,16 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0 The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and 'hostfwd_remove' HMP commands has been replaced by ``netdev_id``. +Guest Emulator ISAs +------------------- + +RISC-V ISA privledge specification version 1.09.1 (removed in 5.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The RISC-V ISA privledge specification version 1.09.1 has been removed. +QEMU supports both the newer version 1.10.0 and the ratified version 1.11.0, these +should be used instead of the 1.09.1 version. + System emulator CPUS --------------------
target/riscv/cpu.h +0 -1
@@ -73,7 +73,6 @@ enum { RISCV_FEATURE_MISA }; -#define PRIV_VERSION_1_09_1 0x00010901#define PRIV_VERSION_1_10_0 0x00011000#define PRIV_VERSION_1_11_0 0x00011100
target/riscv/cpu.c +0 -2
@@ -368,8 +368,6 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) 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 ; }else { error_setg(errp, "Unsupported privilege spec version '%s'",
target/riscv/cpu_helper.c +29 -53
109 lines not on this page · raw message
target/riscv/csr.c +25 -113
255 lines not on this page · raw message
target/riscv/insn_trans/trans_privileged.inc.c +4 -14
@@ -85,30 +85,21 @@ static bool trans_wfi(DisasContext *ctx, arg_wfi *a)static bool trans_sfence_vma (DisasContext *ctx,arg_sfence_vma *a) {#ifndef CONFIG_USER_ONLY -if (ctx->priv_ver >=PRIV_VERSION_1_10_0 ) { -gen_helper_tlb_flush (cpu_env); -return true; - } +gen_helper_tlb_flush (cpu_env); +return true;#endif return false; }static bool trans_sfence_vm (DisasContext *ctx,arg_sfence_vm *a) { -#ifndef CONFIG_USER_ONLY -if (ctx->priv_ver <=PRIV_VERSION_1_09_1 ) { -gen_helper_tlb_flush (cpu_env); -return true; - } -#endif return false; }static bool trans_hfence_gvma (DisasContext *ctx,arg_sfence_vma *a) {#ifndef CONFIG_USER_ONLY -if (ctx->priv_ver >=PRIV_VERSION_1_10_0 && -has_ext (ctx,RVH )) { +if (has_ext (ctx,RVH )) {/* Hpervisor extensions exist */ /* * if (env->priv == PRV_M ||
@@ -127,8 +118,7 @@ static bool trans_hfence_gvma(DisasContext *ctx, arg_sfence_vma *a)static bool trans_hfence_bvma (DisasContext *ctx,arg_sfence_vma *a) {#ifndef CONFIG_USER_ONLY -if (ctx->priv_ver >=PRIV_VERSION_1_10_0 && -has_ext (ctx,RVH )) { +if (has_ext (ctx,RVH )) {/* Hpervisor extensions exist */ /* * if (env->priv == PRV_M ||
target/riscv/monitor.c +0 -5
@@ -215,11 +215,6 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)return ; } -if (env->priv_ver <PRIV_VERSION_1_10_0 ) { -monitor_printf (mon,"Privileged mode < 1.10 unsupported\n" ); -return ; - } -if (!(env->satp &SATP_MODE )) {monitor_printf (mon,"No translation or protection\n" );return ;
target/riscv/op_helper.c +5 -12
@@ -84,8 +84,7 @@ target_ulong helper_sret(CPURISCVState *env, target_ulong cpu_pc_deb)riscv_raise_exception (env,RISCV_EXCP_INST_ADDR_MIS ,GETPC ()); } -if (env->priv_ver >=PRIV_VERSION_1_10_0 && -get_field (env->mstatus,MSTATUS_TSR ) && !(env->priv >=PRV_M )) { +if (get_field (env->mstatus,MSTATUS_TSR ) && !(env->priv >=PRV_M )) {riscv_raise_exception (env,RISCV_EXCP_ILLEGAL_INST ,GETPC ()); }
@@ -119,10 +118,8 @@ target_ulong helper_sret(CPURISCVState *env, target_ulong cpu_pc_deb) }else { prev_priv =get_field (mstatus,MSTATUS_SPP ); - mstatus =set_field (mstatus, - env->priv_ver >=PRIV_VERSION_1_10_0 ? -MSTATUS_SIE :MSTATUS_UIE << prev_priv, -get_field (mstatus,MSTATUS_SPIE )); + mstatus =set_field (mstatus,MSTATUS_SIE , +get_field (mstatus,MSTATUS_SPIE )); mstatus =set_field (mstatus,MSTATUS_SPIE ,1 ); mstatus =set_field (mstatus,MSTATUS_SPP ,PRV_U ); env->mstatus = mstatus;
@@ -147,10 +144,8 @@ target_ulong helper_mret(CPURISCVState *env, target_ulong cpu_pc_deb)target_ulong mstatus = env->mstatus;target_ulong prev_priv =get_field (mstatus,MSTATUS_MPP );target_ulong prev_virt =MSTATUS_MPV_ISSET (env); - mstatus =set_field (mstatus, - env->priv_ver >=PRIV_VERSION_1_10_0 ? -MSTATUS_MIE :MSTATUS_UIE << prev_priv, -get_field (mstatus,MSTATUS_MPIE )); + mstatus =set_field (mstatus,MSTATUS_MIE , +get_field (mstatus,MSTATUS_MPIE )); mstatus =set_field (mstatus,MSTATUS_MPIE ,1 ); mstatus =set_field (mstatus,MSTATUS_MPP ,PRV_U );#ifdef TARGET_RISCV32
@@ -177,7 +172,6 @@ void helper_wfi(CPURISCVState *env)CPUState *cs =env_cpu (env);if ((env->priv ==PRV_S && - env->priv_ver >=PRIV_VERSION_1_10_0 &&get_field (env->mstatus,MSTATUS_TW )) ||riscv_cpu_virt_enabled (env)) {riscv_raise_exception (env,RISCV_EXCP_ILLEGAL_INST ,GETPC ());
@@ -193,7 +187,6 @@ void helper_tlb_flush(CPURISCVState *env)CPUState *cs =env_cpu (env);if (!(env->priv >=PRV_S ) || (env->priv ==PRV_S && - env->priv_ver >=PRIV_VERSION_1_10_0 &&get_field (env->mstatus,MSTATUS_TVM ))) {riscv_raise_exception (env,RISCV_EXCP_ILLEGAL_INST ,GETPC ()); }else {
Signature · 1 line
2.26.2
Re: [PATCH v4 3/4] target/riscv: Drop support for ISA spec version 1.09.1
Quoted 5 lines · Alistair Francis
The RISC-V ISA spec version 1.09.1 has been deprecated in QEMU since 4.1. It's not commonly used so let's remove support for it.
Signed-off-by Alistair Francis <[email protected]>
Quoted 11 lines
--- docs/system/deprecated.rst | 20 +-- target/riscv/cpu.h | 1 - target/riscv/cpu.c | 2 - target/riscv/cpu_helper.c | 82 ++++------- target/riscv/csr.c | 138 ++++-------------- .../riscv/insn_trans/trans_privileged.inc.c | 18 +-- target/riscv/monitor.c | 5 - target/riscv/op_helper.c | 17 +-- 8 files changed, 73 insertions(+), 210 deletions(-)
PATCH v4 4/4 docs: deprecated: Update the -bios documentation
In reply to Alistair FrancisUpdate the -bios deprecation documentation to describe the new behaviour.
--- docs/system/deprecated.rst | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
docs/system/deprecated.rst +13 -15
@@ -138,25 +138,23 @@ the backing storage specified with ``-mem-path`` can actually provide the guest RAM configured with ``-m`` and QEMU will fail to start up if RAM allocation is unsuccessful. -RISC-V ``-bios`` (since 4.1) +RISC-V ``-bios`` (since 5.1) '''''''''''''''''''''''''''' QEMU 4.1 introduced support for the -bios option in QEMU for RISC-V for the -RISC-V virt machine and sifive_u machine. - -QEMU 4.1 has no changes to the default behaviour to avoid breakages. This -default will change in a future QEMU release, so please prepare now. All users -of the virt or sifive_u machine must change their command line usage. - -QEMU 4.1 has three options, please migrate to one of these three: - 1. ``-bios none`` - This is the current default behavior if no -bios option - is included. QEMU will not automatically load any firmware. It is up +RISC-V virt machine and sifive_u machine. QEMU 4.1 had no changes to the +default behaviour to avoid breakages. + +QEMU 5.1 changes the default behaviour from ``-bios none`` to ``-bios default``. + +QEMU 5.1 has three options: + 1. ``-bios default`` - This is the current default behavior if no -bios option + is included. This option will load the default OpenSBI firmware automatically. + The firmware is included with the QEMU release and no user interaction is + required. All a user needs to do is specify the kernel they want to boot + with the -kernel option + 2. ``-bios none`` - QEMU will not automatically load any firmware. It is up to the user to load all the images they need. - 2. ``-bios default`` - In a future QEMU release this will become the default - behaviour if no -bios option is specified. This option will load the - default OpenSBI firmware automatically. The firmware is included with - the QEMU release and no user interaction is required. All a user needs - to do is specify the kernel they want to boot with the -kernel option 3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae. ``-tb-size`` option (since 5.0)
Signature · 1 line
2.26.2
Re: [PATCH v4 4/4] docs: deprecated: Update the -bios documentation
Quoted 9 lines · Alistair Francis
Update the -bios deprecation documentation to describe the new behaviour.
Signed-off-by Alistair Francis <[email protected]>--- docs/system/deprecated.rst | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)