Skip to content

cpus: Constify @cpu in SysemuCPUOps::has_work() handler

Philippe Mathieu-Daudé qemu-arm qemu-devel qemu-riscv 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13target/avr: Constify CPUAVRState for some cpu_*() getterstarget/avr/cpu.h+3 -31 reply
2/13target/i386: Constify CPU*State for cpu_*_interrupt() getterstarget/i386/cpu.c target/i386/cpu.h+5 -51 reply
3/13target/loongarch: Constify CPULoongArchState for various cpu_*() getterstarget/loongarch/cpu.c target/loongarch/cpu.h target/loongarch/internals.h+5 -51 reply
4/13target/mips: Constify CPUMIPSState for various cpu_*() getterstarget/mips/cpu.h target/mips/internal.h+6 -61 reply
5/13target/s390x: Constify S390CPU for cpu_has_*() getterstarget/s390x/cpu.h target/s390x/interrupt.c target/s390x/s390x-internal.h+18 -183 replies
6/13target/riscv: Constify @iprio argument in riscv_cpu_pending_to_irq()target/riscv/cpu.c target/riscv/cpu.h+2 -21 reply
7/13target/riscv: Constify CPURISCVState for various cpu_*() getterstarget/riscv/cpu.c target/riscv/cpu.h+10 -91 reply
8/13target/sparc: Constify CPUSPARCState for various cpu_*() getterstarget/sparc/cpu.h+6 -61 reply
9/13cpus: Add const-qualified CPU environment accessorsinclude/exec/cpu-common.h include/hw/core/cpu.h+17 -06 replies
10/13target/riscv: Constify CPURISCVState for various cpu_*() getterstarget/riscv/cpu.c target/riscv/cpu.h+10 -101 reply
11/13target/hexagon: Constify CPUHexagonState in hexagon_thread_is_enabled()target/hexagon/cpu.c target/hexagon/cpu.h+3 -32 replies
12/13target/mips: Constify CPUMIPSState in mips_vpe_active()target/mips/internal.h+2 -21 reply
13/13cpus: Constify @cpu in SysemuCPUOps::has_work() handlerinclude/hw/core/sysemu-cpu-ops.h target/alpha/cpu.c target/arm/cpu.c +20 more+33 -323 replies

Reviews trailers per patch

12 of 13 patches have a Reviewed-by or Acked-by.

PatchIlya LeoshkevichMarc-André LureauBrian CainEric FarmanRichard Henderson
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b R-b A-b
6/13R-b
7/13R-b
8/13R-b
9/13R-b R-b R-b
10/13R-b
11/13R-b R-b
12/13R-b
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 00/13] cpus: Constify @cpu in SysemuCPUOps::has_work() handler

- Patches 1-8 trivially add const qualifier for various cpu_is/has() getters
- Patch 9 adds const-qualified variants of cpu_env() and env_archcpu(). Not sure if this is a good idea so marked as RFC.
- Patches 10-12 complete the cpu_is/has() getters const conversion using the new env_archcpu_const() variant
- Patch 13 finally convert the SysemuCPUOps::has_work hook and all target implementations.

No functional change; purely const-correctness improvment to enforce has_work() callees don't mutate CPUState.

Build-tested.

Based-on: <[email protected]>
"Make halt-to-exec transition explicit and remove cpu_exec_halt"

Philippe Mathieu-Daudé (13):
target/avr: Constify CPUAVRState for some cpu_*() getters target/i386: Constify CPU*State for cpu_*_interrupt() getters target/loongarch: Constify CPULoongArchState for various cpu_*()
getters
target/mips: Constify CPUMIPSState for various cpu_*() getters target/s390x: Constify S390CPU for cpu_has_*() getters target/riscv: Constify @iprio argument in riscv_cpu_pending_to_irq() target/riscv: Constify CPURISCVState for various cpu_*() getters target/sparc: Constify CPUSPARCState for various cpu_*() getters
cpus: Add const-qualified CPU environment accessors target/riscv: Constify CPURISCVState for various cpu_*() getters target/hexagon: Constify CPUHexagonState in
hexagon_thread_is_enabled()
target/mips: Constify CPUMIPSState in mips_vpe_active()
cpus: Constify @cpu in SysemuCPUOps::has_work() handler

 include/exec/cpu-common.h        | 11 +++++++++++
 include/hw/core/cpu.h            |  6 ++++++
 include/hw/core/sysemu-cpu-ops.h |  4 ++--
 target/avr/cpu.h                 |  6 +++---
 target/hexagon/cpu.h             |  2 +-
 target/i386/cpu.h                |  4 ++--
 target/loongarch/cpu.h           |  6 +++---
 target/loongarch/internals.h     |  4 ++--
 target/mips/cpu.h                |  6 +++---
 target/mips/internal.h           | 10 +++++-----
 target/riscv/cpu.h               | 31 ++++++++++++++++---------------
 target/riscv/internals.h         |  2 +-
 target/s390x/cpu.h               |  2 +-
 target/s390x/s390x-internal.h    | 14 +++++++-------
 target/sparc/cpu.h               | 12 ++++++------
 target/alpha/cpu.c               |  2 +-
 target/arm/cpu.c                 |  4 ++--
 target/avr/cpu.c                 |  5 +++--
 target/hexagon/cpu.c             |  8 ++++----
 target/hppa/cpu.c                |  2 +-
 target/i386/cpu.c                |  8 ++++----
 target/loongarch/cpu.c           |  6 +++---
 target/m68k/cpu.c                |  2 +-
 target/microblaze/cpu.c          |  2 +-
 target/mips/cpu.c                |  4 ++--
 target/or1k/cpu.c                |  2 +-
 target/ppc/cpu_init.c            |  2 +-
 target/riscv/cpu.c               | 14 +++++++-------
 target/rx/cpu.c                  |  2 +-
 target/s390x/cpu-system.c        |  2 +-
 target/s390x/interrupt.c         | 22 +++++++++++-----------
 target/sh4/cpu.c                 |  2 +-
 target/sparc/cpu.c               |  4 ++--
 target/tricore/cpu.c             |  4 ++--
 target/xtensa/cpu.c              |  4 ++--
 35 files changed, 120 insertions(+), 101 deletions(-)
Signature · 1 line
2.53.0