From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-arm@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH 00/13] cpus: Constify @cpu in SysemuCPUOps::has_work() handler
Date: Thu, 20 Aug 2026 12:47:16 +0200 [thread overview]
Message-ID: <20260820104730.25462-1-philmd@oss.qualcomm.com> (raw)
- 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: <20260819145649.23439-1-philmd@oss.qualcomm.com>
"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(-)
--
2.53.0
next reply other threads:[~2026-08-20 10:48 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 10:47 Philippe Mathieu-Daudé [this message]
2026-08-20 10:47 ` [PATCH 01/13] target/avr: Constify CPUAVRState for some cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 12:36 ` marcandre.lureau
2026-08-20 10:47 ` [PATCH 02/13] target/i386: Constify CPU*State for cpu_*_interrupt() getters Philippe Mathieu-Daudé
2026-08-20 12:36 ` marcandre.lureau
2026-08-20 10:47 ` [PATCH 03/13] target/loongarch: Constify CPULoongArchState for various cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 12:36 ` marcandre.lureau
2026-08-20 10:47 ` [PATCH 04/13] target/mips: Constify CPUMIPSState " Philippe Mathieu-Daudé
2026-08-20 12:36 ` marcandre.lureau
2026-08-20 10:47 ` [PATCH 05/13] target/s390x: Constify S390CPU for cpu_has_*() getters Philippe Mathieu-Daudé
2026-08-20 11:06 ` Ilya Leoshkevich
2026-08-20 12:36 ` marcandre.lureau
2026-08-20 19:22 ` Eric Farman
2026-08-20 10:47 ` [PATCH 06/13] target/riscv: Constify @iprio argument in riscv_cpu_pending_to_irq() Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 10:47 ` [PATCH 07/13] target/riscv: Constify CPURISCVState for various cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 10:47 ` [PATCH 08/13] target/sparc: Constify CPUSPARCState " Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 10:47 ` [RFC PATCH 09/13] cpus: Add const-qualified CPU environment accessors Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 15:21 ` Richard Henderson
2026-08-20 16:24 ` Philippe Mathieu-Daudé
2026-08-20 16:50 ` Philippe Mathieu-Daudé
2026-08-20 17:09 ` Marc-André Lureau
2026-08-20 10:47 ` [RFC PATCH 10/13] target/riscv: Constify CPURISCVState for various cpu_*() getters Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 10:47 ` [RFC PATCH 11/13] target/hexagon: Constify CPUHexagonState in hexagon_thread_is_enabled() Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 15:28 ` Brian Cain
2026-08-20 10:47 ` [RFC PATCH 12/13] target/mips: Constify CPUMIPSState in mips_vpe_active() Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 10:47 ` [RFC PATCH 13/13] cpus: Constify @cpu in SysemuCPUOps::has_work() handler Philippe Mathieu-Daudé
2026-08-20 11:05 ` Philippe Mathieu-Daudé
2026-08-20 13:22 ` marcandre.lureau
2026-08-20 13:55 ` 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=20260820104730.25462-1-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.