From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-s390x@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-ppc@nongnu.org,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
qemu-arm@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH v2 00/15] cpus: Constify @cpu in SysemuCPUOps::has_work() handler
Date: Thu, 20 Aug 2026 22:13:40 +0200 [thread overview]
Message-ID: <20260820201356.29775-1-philmd@oss.qualcomm.com> (raw)
Missing review: 2,12,14,15
Since v1:
- use _Generic (rth)
- no more RFC
- Patches 2-11 trivially add const qualifier for various
cpu_is/has() getters
- Patch 12-14 add const-qualified variants of cpu_env(),
env_cpu(), and env_archcpu() using _Generic() macros;
consolidate the redundant env_cpu_const() alias and update
linux-user to use the generic accessor
- Patch 15 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.
Following checkpatch.pl errors ignored:
13/15 Checking commit efef90983aa7 (cpus: Add const-qualified CPU environment accessors)
ERROR: spaces required around that ':' (ctx:VxE)
#46: FILE: include/exec/cpu-common.h:89:
+ CPUArchState: \
^
ERROR: spaces required around that ':' (ctx:VxE)
#62: FILE: include/exec/cpu-common.h:101:
+ CPUArchState: \
^
ERROR: spaces required around that ':' (ctx:VxE)
#90: FILE: include/hw/core/cpu.h:605:
+ CPUState: \
^
total: 3 errors, 0 warnings, 64 lines checked
Philippe Mathieu-Daudé (15):
target/tricore: Document architectural interrupts as not implemented
system/cpus: Constify various CPUState arguments
target/avr: Constify CPUAVRState for some cpu_*() getters
target/hexagon: Constify CPUHexagonState in
hexagon_thread_is_enabled()
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
linux-user: Uncast void pointer argument as Object in
target_cpu_free()
cpus: Add const-qualified CPU environment accessors
linux-user: Replace env_cpu_const() by generic env_cpu() equivalent
cpus: Constify @cpu in SysemuCPUOps::has_work() handler
include/exec/cpu-common.h | 29 ++++++++++-------------------
include/hw/core/cpu.h | 21 ++++++++++++++-------
include/hw/core/sysemu-cpu-ops.h | 4 ++--
include/system/cpus.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 | 2 +-
target/mips/cpu.h | 6 +++---
target/mips/internal.h | 10 +++++-----
target/riscv/cpu.h | 29 +++++++++++++++--------------
target/s390x/cpu.h | 2 +-
target/s390x/s390x-internal.h | 12 ++++++------
target/sparc/cpu.h | 12 ++++++------
linux-user/elfload.c | 2 +-
linux-user/i386/cpu_loop.c | 5 +++--
linux-user/i386/elfload.c | 2 +-
linux-user/x86_64/elfload.c | 2 +-
system/cpus.c | 6 +++---
target/alpha/cpu.c | 2 +-
target/arm/cpu.c | 4 ++--
target/avr/cpu.c | 3 ++-
target/hexagon/cpu.c | 8 ++++----
target/hppa/cpu.c | 2 +-
target/i386/cpu.c | 7 +++----
target/loongarch/cpu.c | 4 ++--
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 | 17 ++++++++---------
target/rx/cpu.c | 2 +-
target/s390x/cpu-system.c | 4 ++--
target/s390x/interrupt.c | 22 +++++++++++-----------
target/sh4/cpu.c | 2 +-
target/sparc/cpu.c | 2 +-
target/tricore/cpu.c | 3 ++-
target/xtensa/cpu.c | 4 ++--
40 files changed, 132 insertions(+), 132 deletions(-)
--
2.53.0
next reply other threads:[~2026-08-20 20:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 20:13 Philippe Mathieu-Daudé [this message]
2026-08-20 20:13 ` [PATCH v2 01/15] target/tricore: Document architectural interrupts as not implemented Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 02/15] system/cpus: Constify various CPUState arguments Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 03/15] target/avr: Constify CPUAVRState for some cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 04/15] target/hexagon: Constify CPUHexagonState in hexagon_thread_is_enabled() Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 05/15] target/i386: Constify CPU*State for cpu_*_interrupt() getters Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 06/15] target/loongarch: Constify CPULoongArchState for various cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 07/15] target/mips: Constify CPUMIPSState " Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 08/15] target/s390x: Constify S390CPU for cpu_has_*() getters Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 09/15] target/riscv: Constify @iprio argument in riscv_cpu_pending_to_irq() Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 10/15] target/riscv: Constify CPURISCVState for various cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 11/15] target/sparc: Constify CPUSPARCState " Philippe Mathieu-Daudé
2026-08-20 20:13 ` [PATCH v2 12/15] linux-user: Uncast void pointer argument as Object in target_cpu_free() Philippe Mathieu-Daudé
2026-08-20 23:21 ` Richard Henderson
2026-08-20 20:13 ` [PATCH v2 13/15] cpus: Add const-qualified CPU environment accessors Philippe Mathieu-Daudé
2026-08-20 23:17 ` Richard Henderson
2026-08-20 20:13 ` [PATCH v2 14/15] linux-user: Replace env_cpu_const() by generic env_cpu() equivalent Philippe Mathieu-Daudé
2026-08-20 23:17 ` Richard Henderson
2026-08-20 20:13 ` [PATCH v2 15/15] cpus: Constify @cpu in SysemuCPUOps::has_work() handler Philippe Mathieu-Daudé
2026-08-21 10:28 ` [PATCH v2 00/15] " Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260820201356.29775-1-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox