[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 52/54] target/riscv: Use env_archcpu for better performance
|
From: |
Alistair Francis |
|
Subject: |
[PULL 52/54] target/riscv: Use env_archcpu for better performance |
|
Date: |
Thu, 12 Oct 2023 14:10:49 +1000 |
From: "Richard W.M. Jones" <rjones@redhat.com>
RISCV_CPU(cs) uses a checked cast. When QOM cast debugging is enabled
this adds about 5% total overhead when emulating RV64 on x86-64 host.
Using a RISC-V guest with 16 vCPUs, 16 GB of guest RAM, virtio-blk
disk. The guest has a copy of the qemu source tree. The test
involves compiling the qemu source tree with 'make clean; time make -j16'.
Before making this change the compile step took 449 & 447 seconds over
two consecutive runs.
After making this change: 428 & 421 seconds.
The saving is over 5%.
Thanks: Paolo Bonzini
Thanks: Philippe Mathieu-Daudé
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20231009124859.3373696-2-rjones@redhat.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/cpu_helper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 3a02079290..8c28241c18 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -65,8 +65,7 @@ int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch)
void cpu_get_tb_cpu_state(CPURISCVState *env, vaddr *pc,
uint64_t *cs_base, uint32_t *pflags)
{
- CPUState *cs = env_cpu(env);
- RISCVCPU *cpu = RISCV_CPU(cs);
+ RISCVCPU *cpu = env_archcpu(env);
RISCVExtStatus fs, vs;
uint32_t flags = 0;
--
2.41.0
- [PULL 42/54] target/riscv: add riscv_cpu_get_name(), (continued)
- [PULL 42/54] target/riscv: add riscv_cpu_get_name(), Alistair Francis, 2023/10/12
- [PULL 43/54] target/riscv/tcg-cpu.c: add extension properties for all cpus, Alistair Francis, 2023/10/12
- [PULL 46/54] hw/misc/sifive_test.c: replace exit calls with proper shutdown, Alistair Francis, 2023/10/12
- [PULL 45/54] softmmu: pass the main loop status to gdb "Wxx" packet, Alistair Francis, 2023/10/12
- [PULL 47/54] hw/char: riscv_htif: replace exit calls with proper shutdown, Alistair Francis, 2023/10/12
- [PULL 44/54] softmmu: add means to pass an exit code when requesting a shutdown, Alistair Francis, 2023/10/12
- [PULL 48/54] gdbstub: replace exit calls with proper shutdown for softmmu, Alistair Francis, 2023/10/12
- [PULL 49/54] target/riscv/kvm: improve 'init_multiext_cfg' error msg, Alistair Francis, 2023/10/12
- [PULL 50/54] target/riscv/kvm: support KVM_GET_REG_LIST, Alistair Francis, 2023/10/12
- [PULL 51/54] target/riscv/tcg: remove RVG warning, Alistair Francis, 2023/10/12
- [PULL 52/54] target/riscv: Use env_archcpu for better performance,
Alistair Francis <=
- [PULL 53/54] target/riscv: deprecate capital 'Z' CPU properties, Alistair Francis, 2023/10/12
- [PULL 54/54] target/riscv: Fix vfwmaccbf16.vf, Alistair Francis, 2023/10/12
- Re: [PULL 00/54] riscv-to-apply queue, Stefan Hajnoczi, 2023/10/13