From: Eric Farman <farman@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
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, Cornelia Huck <cohuck@redhat.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Ilya Leoshkevich <iii@linux.ibm.com>,
David Hildenbrand <david@kernel.org>
Subject: Re: [PATCH 05/13] target/s390x: Constify S390CPU for cpu_has_*() getters
Date: Thu, 20 Aug 2026 15:22:59 -0400 [thread overview]
Message-ID: <7ab9d9a8-7a97-413a-8e10-7db17dd918ed@linux.ibm.com> (raw)
In-Reply-To: <20260820104730.25462-6-philmd@oss.qualcomm.com>
On 8/20/26 6:47 AM, Philippe Mathieu-Daudé wrote:
> Add the const qualifier to S390CPU when the argument
> is accessed without modification.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
> target/s390x/cpu.h | 2 +-
> target/s390x/s390x-internal.h | 12 ++++++------
> target/s390x/interrupt.c | 22 +++++++++++-----------
> 3 files changed, 18 insertions(+), 18 deletions(-)
Acked-by: Eric Farman <farman@linux.ibm.com>
>
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index f55b79ef8ac..998bbb0d7ff 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -854,7 +854,7 @@ static inline unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
> return 0;
> }
> #endif /* CONFIG_USER_ONLY */
> -static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
> +static inline uint8_t s390_cpu_get_state(const S390CPU *cpu)
> {
> return cpu->env.cpu_state;
> }
> diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h
> index 35d1e34ef4d..54b62808d83 100644
> --- a/target/s390x/s390x-internal.h
> +++ b/target/s390x/s390x-internal.h
> @@ -334,12 +334,12 @@ void cpu_inject_clock_comparator(S390CPU *cpu);
> void cpu_inject_cpu_timer(S390CPU *cpu);
> void cpu_inject_emergency_signal(S390CPU *cpu, uint16_t src_cpu_addr);
> int cpu_inject_external_call(S390CPU *cpu, uint16_t src_cpu_addr);
> -bool s390_cpu_has_io_int(S390CPU *cpu);
> -bool s390_cpu_has_ext_int(S390CPU *cpu);
> -bool s390_cpu_has_mcck_int(S390CPU *cpu);
> -bool s390_cpu_has_int(S390CPU *cpu);
> -bool s390_cpu_has_restart_int(S390CPU *cpu);
> -bool s390_cpu_has_stop_int(S390CPU *cpu);
> +bool s390_cpu_has_io_int(const S390CPU *cpu);
> +bool s390_cpu_has_ext_int(const S390CPU *cpu);
> +bool s390_cpu_has_mcck_int(const S390CPU *cpu);
> +bool s390_cpu_has_int(const S390CPU *cpu);
> +bool s390_cpu_has_restart_int(const S390CPU *cpu);
> +bool s390_cpu_has_stop_int(const S390CPU *cpu);
> void cpu_inject_restart(S390CPU *cpu);
> void cpu_inject_stop(S390CPU *cpu);
> #endif /* CONFIG_USER_ONLY */
> diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c
> index 1dca835c5d8..d7e3fd45e4b 100644
> --- a/target/s390x/interrupt.c
> +++ b/target/s390x/interrupt.c
> @@ -139,10 +139,10 @@ void s390_crw_mchk(void)
> fsc->inject_crw_mchk(fs);
> }
>
> -bool s390_cpu_has_mcck_int(S390CPU *cpu)
> +bool s390_cpu_has_mcck_int(const S390CPU *cpu)
> {
> QEMUS390FLICState *flic = s390_get_qemu_flic(s390_get_flic());
> - CPUS390XState *env = &cpu->env;
> + const CPUS390XState *env = &cpu->env;
>
> if (!(env->psw.mask & PSW_MASK_MCHECK)) {
> return false;
> @@ -157,10 +157,10 @@ bool s390_cpu_has_mcck_int(S390CPU *cpu)
> return false;
> }
>
> -bool s390_cpu_has_ext_int(S390CPU *cpu)
> +bool s390_cpu_has_ext_int(const S390CPU *cpu)
> {
> QEMUS390FLICState *flic = s390_get_qemu_flic(s390_get_flic());
> - CPUS390XState *env = &cpu->env;
> + const CPUS390XState *env = &cpu->env;
>
> if (!(env->psw.mask & PSW_MASK_EXT)) {
> return false;
> @@ -199,10 +199,10 @@ bool s390_cpu_has_ext_int(S390CPU *cpu)
> return false;
> }
>
> -bool s390_cpu_has_io_int(S390CPU *cpu)
> +bool s390_cpu_has_io_int(const S390CPU *cpu)
> {
> QEMUS390FLICState *flic = s390_get_qemu_flic(s390_get_flic());
> - CPUS390XState *env = &cpu->env;
> + const CPUS390XState *env = &cpu->env;
>
> if (!(env->psw.mask & PSW_MASK_IO)) {
> return false;
> @@ -211,21 +211,21 @@ bool s390_cpu_has_io_int(S390CPU *cpu)
> return qemu_s390_flic_has_io(flic, env->cregs[6]);
> }
>
> -bool s390_cpu_has_restart_int(S390CPU *cpu)
> +bool s390_cpu_has_restart_int(const S390CPU *cpu)
> {
> - CPUS390XState *env = &cpu->env;
> + const CPUS390XState *env = &cpu->env;
>
> return env->pending_int & INTERRUPT_RESTART;
> }
>
> -bool s390_cpu_has_stop_int(S390CPU *cpu)
> +bool s390_cpu_has_stop_int(const S390CPU *cpu)
> {
> - CPUS390XState *env = &cpu->env;
> + const CPUS390XState *env = &cpu->env;
>
> return env->pending_int & INTERRUPT_STOP;
> }
>
> -bool s390_cpu_has_int(S390CPU *cpu)
> +bool s390_cpu_has_int(const S390CPU *cpu)
> {
> if (!tcg_enabled()) {
> return false;
next prev parent reply other threads:[~2026-08-20 19:23 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 10:47 [PATCH 00/13] cpus: Constify @cpu in SysemuCPUOps::has_work() handler Philippe Mathieu-Daudé
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 [this message]
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 23:15 ` Richard Henderson
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=7ab9d9a8-7a97-413a-8e10-7db17dd918ed@linux.ibm.com \
--to=farman@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@kernel.org \
--cc=iii@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@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 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.