mbox series

[0/4] target/riscv: Some CPURISCVState related cleanup and simplification

Message ID 20230309071329.45932-1-liweiwei@iscas.ac.cn (mailing list archive)
Headers show
Series target/riscv: Some CPURISCVState related cleanup and simplification | expand

Message

Weiwei Li March 9, 2023, 7:13 a.m. UTC
The patchset tries to:

- Use riscv_cpu_cfg(env) instead of env_archcpu().cfg.
- Use env_archcpu() to get RISCVCPU pointer from env directly
- Use CPURISCVState as argument directly in riscv_cpu_update_mip and riscv_timer_write_timecmp to simplify type conversion
- Remove RISCVCPU argument of riscv_csrrw_check, and get cfg infomation from CPURISCVState directly

The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-cleanup-upstream

Weiwei Li (4):
  target/riscv: Avoid env_archcpu() when reading RISCVCPUConfig
  target/riscv: Simplify getting RISCVCPU pointer from env
  target/riscv: Simplify type conversion for CPURISCVState
  target/riscv: Simplify arguments for riscv_csrrw_check

 target/riscv/cpu.c         |  6 +--
 target/riscv/cpu.h         |  3 +-
 target/riscv/cpu_helper.c  | 17 ++++----
 target/riscv/csr.c         | 87 ++++++++++++--------------------------
 target/riscv/gdbstub.c     |  4 +-
 target/riscv/pmu.c         | 14 +++---
 target/riscv/time_helper.c | 15 +++----
 target/riscv/time_helper.h |  2 +-
 8 files changed, 57 insertions(+), 91 deletions(-)

Comments

Alistair Francis March 15, 2023, 4:57 a.m. UTC | #1
On Thu, Mar 9, 2023 at 5:15 PM Weiwei Li <liweiwei@iscas.ac.cn> wrote:
>
> The patchset tries to:
>
> - Use riscv_cpu_cfg(env) instead of env_archcpu().cfg.
> - Use env_archcpu() to get RISCVCPU pointer from env directly
> - Use CPURISCVState as argument directly in riscv_cpu_update_mip and riscv_timer_write_timecmp to simplify type conversion
> - Remove RISCVCPU argument of riscv_csrrw_check, and get cfg infomation from CPURISCVState directly
>
> The port is available here:
> https://github.com/plctlab/plct-qemu/tree/plct-cleanup-upstream
>
> Weiwei Li (4):
>   target/riscv: Avoid env_archcpu() when reading RISCVCPUConfig
>   target/riscv: Simplify getting RISCVCPU pointer from env
>   target/riscv: Simplify type conversion for CPURISCVState
>   target/riscv: Simplify arguments for riscv_csrrw_check

Thanks!

Applied to riscv-to-apply.next

Alistair

>
>  target/riscv/cpu.c         |  6 +--
>  target/riscv/cpu.h         |  3 +-
>  target/riscv/cpu_helper.c  | 17 ++++----
>  target/riscv/csr.c         | 87 ++++++++++++--------------------------
>  target/riscv/gdbstub.c     |  4 +-
>  target/riscv/pmu.c         | 14 +++---
>  target/riscv/time_helper.c | 15 +++----
>  target/riscv/time_helper.h |  2 +-
>  8 files changed, 57 insertions(+), 91 deletions(-)
>
> --
> 2.25.1
>
>