From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Emilio G. Cota" <cota@braap.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Aleksandar Markovic <amarkovic@wavecomp.com>,
Aurelien Jarno <aurelien@aurel32.net>,
James Hogan <jhogan@kernel.org>
Subject: Re: [Qemu-devel] [RFC v4 22/71] mips: convert to cpu_halted
Date: Wed, 31 Oct 2018 14:22:40 +0000 [thread overview]
Message-ID: <874ld28abz.fsf@linaro.org> (raw)
In-Reply-To: <20181025144644.15464-22-cota@braap.org>
Emilio G. Cota <cota@braap.org> writes:
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Aleksandar Markovic <amarkovic@wavecomp.com>
> Cc: James Hogan <jhogan@kernel.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> hw/mips/cps.c | 2 +-
> hw/misc/mips_itu.c | 4 ++--
> target/mips/kvm.c | 2 +-
> target/mips/op_helper.c | 8 ++++----
> target/mips/translate.c | 4 ++--
> 5 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/hw/mips/cps.c b/hw/mips/cps.c
> index 4285d1964e..a8b27eee78 100644
> --- a/hw/mips/cps.c
> +++ b/hw/mips/cps.c
> @@ -49,7 +49,7 @@ static void main_cpu_reset(void *opaque)
> cpu_reset(cs);
>
> /* All VPs are halted on reset. Leave powering up to CPC. */
> - cs->halted = 1;
> + cpu_halted_set(cs, 1);
> }
>
> static bool cpu_mips_itu_supported(CPUMIPSState *env)
> diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c
> index 43bbec46cf..7c383939a7 100644
> --- a/hw/misc/mips_itu.c
> +++ b/hw/misc/mips_itu.c
> @@ -162,7 +162,7 @@ static void wake_blocked_threads(ITCStorageCell *c)
> {
> CPUState *cs;
> CPU_FOREACH(cs) {
> - if (cs->halted && (c->blocked_threads & (1ULL << cs->cpu_index))) {
> + if (cpu_halted(cs) && (c->blocked_threads & (1ULL << cs->cpu_index))) {
> cpu_interrupt(cs, CPU_INTERRUPT_WAKE);
> }
> }
> @@ -172,7 +172,7 @@ static void wake_blocked_threads(ITCStorageCell *c)
> static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
> {
> c->blocked_threads |= 1ULL << current_cpu->cpu_index;
> - current_cpu->halted = 1;
> + cpu_halted_set(current_cpu, 1);
> current_cpu->exception_index = EXCP_HLT;
> cpu_loop_exit_restore(current_cpu, current_cpu->mem_io_pc);
> }
> diff --git a/target/mips/kvm.c b/target/mips/kvm.c
> index 8e72850962..0b177a7577 100644
> --- a/target/mips/kvm.c
> +++ b/target/mips/kvm.c
> @@ -156,7 +156,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run)
>
> int kvm_arch_process_async_events(CPUState *cs)
> {
> - return cs->halted;
> + return cpu_halted(cs);
> }
>
> int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
> diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
> index c148b310cd..8904dfa2b4 100644
> --- a/target/mips/op_helper.c
> +++ b/target/mips/op_helper.c
> @@ -649,7 +649,7 @@ static bool mips_vpe_is_wfi(MIPSCPU *c)
>
> /* If the VPE is halted but otherwise active, it means it's waiting for
> an interrupt. */
> - return cpu->halted && mips_vpe_active(env);
> + return cpu_halted(cpu) && mips_vpe_active(env);
> }
>
> static bool mips_vp_is_wfi(MIPSCPU *c)
> @@ -657,7 +657,7 @@ static bool mips_vp_is_wfi(MIPSCPU *c)
> CPUState *cpu = CPU(c);
> CPUMIPSState *env = &c->env;
>
> - return cpu->halted && mips_vp_active(env);
> + return cpu_halted(cpu) && mips_vp_active(env);
> }
>
> static inline void mips_vpe_wake(MIPSCPU *c)
> @@ -674,7 +674,7 @@ static inline void mips_vpe_sleep(MIPSCPU *cpu)
>
> /* The VPE was shut off, really go to bed.
> Reset any old _WAKE requests. */
> - cs->halted = 1;
> + cpu_halted_set(cs, 1);
> cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE);
> }
>
> @@ -2519,7 +2519,7 @@ void helper_wait(CPUMIPSState *env)
> {
> CPUState *cs = CPU(mips_env_get_cpu(env));
>
> - cs->halted = 1;
> + cpu_halted_set(cs, 1);
> cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE);
> /* Last instruction in the block, PC was updated before
> - no need to recover PC and icount */
> diff --git a/target/mips/translate.c b/target/mips/translate.c
> index ab16cdb911..544e4dc19c 100644
> --- a/target/mips/translate.c
> +++ b/target/mips/translate.c
> @@ -25753,7 +25753,7 @@ void cpu_state_reset(CPUMIPSState *env)
> env->tcs[i].CP0_TCHalt = 1;
> }
> env->active_tc.CP0_TCHalt = 1;
> - cs->halted = 1;
> + cpu_halted_set(cs, 1);
>
> if (cs->cpu_index == 0) {
> /* VPE0 starts up enabled. */
> @@ -25761,7 +25761,7 @@ void cpu_state_reset(CPUMIPSState *env)
> env->CP0_VPEConf0 |= (1 << CP0VPEC0_MVP) | (1 << CP0VPEC0_VPA);
>
> /* TC0 starts up unhalted. */
> - cs->halted = 0;
> + cpu_halted_set(cs, 0);
> env->active_tc.CP0_TCHalt = 0;
> env->tcs[0].CP0_TCHalt = 0;
> /* With thread 0 active. */
--
Alex Bennée
next prev parent reply other threads:[~2018-10-31 14:22 UTC|newest]
Thread overview: 179+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 14:45 [Qemu-devel] [RFC v4 01/71] cpu: convert queued work to a QSIMPLEQ Emilio G. Cota
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 02/71] cpu: rename cpu->work_mutex to cpu->lock Emilio G. Cota
2018-10-29 15:22 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 03/71] cpu: introduce cpu_mutex_lock/unlock Emilio G. Cota
2018-10-26 14:40 ` Richard Henderson
2018-10-29 15:54 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 04/71] cpu: make qemu_work_cond per-cpu Emilio G. Cota
2018-10-26 14:45 ` Richard Henderson
2018-10-30 12:27 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 05/71] cpu: move run_on_cpu to cpus-common Emilio G. Cota
2018-10-29 16:34 ` Alex Bennée
2018-10-29 21:39 ` Emilio G. Cota
2018-10-30 8:28 ` Paolo Bonzini
2018-10-30 12:23 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 06/71] cpu: introduce process_queued_cpu_work_locked Emilio G. Cota
2018-10-29 16:35 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 07/71] tcg-runtime: define helper_cpu_halted_set Emilio G. Cota
2018-10-26 14:57 ` Richard Henderson
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 08/71] ppc: convert to helper_cpu_halted_set Emilio G. Cota
2018-10-26 14:57 ` Richard Henderson
2018-10-31 11:35 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 09/71] cris: " Emilio G. Cota
2018-10-26 14:58 ` Richard Henderson
2018-10-31 11:42 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 10/71] hppa: " Emilio G. Cota
2018-10-26 14:58 ` Richard Henderson
2018-10-31 11:43 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 11/71] m68k: " Emilio G. Cota
2018-10-26 14:59 ` Richard Henderson
2018-10-31 11:43 ` Alex Bennée
2018-10-31 12:27 ` Laurent Vivier
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 12/71] alpha: " Emilio G. Cota
2018-10-26 15:00 ` Richard Henderson
2018-10-31 11:45 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 13/71] microblaze: " Emilio G. Cota
2018-10-26 15:00 ` Richard Henderson
2018-10-31 11:47 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 14/71] cpu: define cpu_halted helpers Emilio G. Cota
2018-10-31 12:04 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 15/71] tcg-runtime: convert to cpu_halted_set Emilio G. Cota
2018-10-26 15:01 ` Richard Henderson
2018-10-31 11:56 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 16/71] arm: convert to cpu_halted Emilio G. Cota
2018-10-25 14:45 ` Emilio G. Cota
2018-10-31 12:15 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 17/71] ppc: " Emilio G. Cota
2018-10-26 15:02 ` Richard Henderson
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 18/71] sh4: " Emilio G. Cota
2018-10-31 13:54 ` Alex Bennée
2018-10-31 16:26 ` Emilio G. Cota
2018-10-31 16:38 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 19/71] i386: " Emilio G. Cota
2018-10-31 14:20 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 20/71] lm32: " Emilio G. Cota
2018-10-31 14:20 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 21/71] m68k: " Emilio G. Cota
2018-10-31 12:29 ` Laurent Vivier
2018-10-31 16:14 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 22/71] mips: " Emilio G. Cota
2018-10-31 14:22 ` Alex Bennée [this message]
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 23/71] riscv: " Emilio G. Cota
2018-10-26 15:03 ` Richard Henderson
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 24/71] s390x: " Emilio G. Cota
2018-10-31 16:13 ` Alex Bennée
2018-10-31 16:38 ` Emilio G. Cota
2018-10-31 16:56 ` Alex Bennée
2018-11-09 13:47 ` Cornelia Huck
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 25/71] sparc: " Emilio G. Cota
2018-10-31 16:13 ` Alex Bennée
2018-10-25 14:45 ` [Qemu-devel] [RFC v4 26/71] xtensa: " Emilio G. Cota
2018-10-31 16:13 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 27/71] gdbstub: " Emilio G. Cota
2018-10-31 16:14 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 28/71] openrisc: " Emilio G. Cota
2018-10-31 16:14 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 29/71] cpu-exec: " Emilio G. Cota
2018-10-26 15:04 ` Richard Henderson
2018-10-31 16:16 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 30/71] cpu: define cpu_interrupt_request helpers Emilio G. Cota
2018-10-26 15:07 ` Richard Henderson
2018-10-31 16:21 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 31/71] ppc: use cpu_reset_interrupt Emilio G. Cota
2018-10-31 16:21 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 32/71] exec: " Emilio G. Cota
2018-10-26 15:07 ` Richard Henderson
2018-10-31 16:33 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 33/71] i386: " Emilio G. Cota
2018-10-31 16:34 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 34/71] s390x: " Emilio G. Cota
2018-10-31 16:34 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 35/71] openrisc: " Emilio G. Cota
2018-10-31 16:35 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 36/71] arm: convert to cpu_interrupt_request Emilio G. Cota
2018-10-25 14:46 ` Emilio G. Cota
2018-10-26 13:39 ` Alex Bennée
2018-10-26 16:31 ` Emilio G. Cota
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 37/71] i386: " Emilio G. Cota
2018-10-26 15:08 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 38/71] i386/kvm: " Emilio G. Cota
2018-10-26 15:10 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 39/71] i386/hax-all: " Emilio G. Cota
2018-10-26 15:11 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 40/71] i386/whpx-all: " Emilio G. Cota
2018-10-26 15:12 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 41/71] i386/hvf: convert to cpu_request_interrupt Emilio G. Cota
2018-10-26 15:12 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 42/71] ppc: convert to cpu_interrupt_request Emilio G. Cota
2018-10-26 15:45 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 43/71] sh4: " Emilio G. Cota
2018-10-31 16:36 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 44/71] cris: " Emilio G. Cota
2018-10-31 16:36 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 45/71] hppa: " Emilio G. Cota
2018-10-31 16:36 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 46/71] lm32: " Emilio G. Cota
2018-10-31 16:36 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 47/71] m68k: " Emilio G. Cota
2018-10-31 12:32 ` Laurent Vivier
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 48/71] mips: " Emilio G. Cota
2018-10-26 15:45 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 49/71] nios: " Emilio G. Cota
2018-10-31 16:37 ` Alex Bennée
2018-10-31 16:38 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 50/71] s390x: " Emilio G. Cota
2018-10-31 16:39 ` Alex Bennée
2018-11-09 13:49 ` Cornelia Huck
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 51/71] alpha: " Emilio G. Cota
2018-10-31 16:39 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 52/71] moxie: " Emilio G. Cota
2018-10-31 16:39 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 53/71] sparc: " Emilio G. Cota
2018-10-31 16:40 ` Alex Bennée
2018-10-31 16:42 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 54/71] openrisc: " Emilio G. Cota
2018-10-31 16:43 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 55/71] unicore32: " Emilio G. Cota
2018-10-31 16:44 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 56/71] microblaze: " Emilio G. Cota
2018-10-31 16:44 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 57/71] accel/tcg: " Emilio G. Cota
2018-10-26 15:48 ` Richard Henderson
2018-10-31 16:46 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 58/71] cpu: call .cpu_has_work with the CPU lock held Emilio G. Cota
2018-10-26 15:48 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 59/71] cpu: introduce cpu_has_work_with_iothread_lock Emilio G. Cota
2018-10-26 15:51 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 60/71] ppc: convert to cpu_has_work_with_iothread_lock Emilio G. Cota
2018-10-26 15:53 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 61/71] mips: " Emilio G. Cota
2018-10-26 15:54 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 62/71] s390x: " Emilio G. Cota
2018-10-26 15:54 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 63/71] riscv: " Emilio G. Cota
2018-10-26 15:54 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 64/71] sparc: " Emilio G. Cota
2018-10-26 15:54 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 65/71] xtensa: " Emilio G. Cota
2018-10-26 15:54 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 66/71] cpu: protect most CPU state with cpu->lock Emilio G. Cota
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 67/71] cpus-common: release BQL earlier in run_on_cpu Emilio G. Cota
2018-10-26 15:59 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 68/71] cpu: add async_run_on_cpu_no_bql Emilio G. Cota
2018-10-26 16:00 ` Richard Henderson
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 69/71] cputlb: queue async flush jobs without the BQL Emilio G. Cota
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 70/71] cpus-common: move exclusive_idle higher in the file Emilio G. Cota
2018-10-26 16:06 ` Richard Henderson
2018-10-29 15:21 ` Alex Bennée
2018-10-25 14:46 ` [Qemu-devel] [RFC v4 71/71] cpus-common: wait on the CPU lock for exclusive work completion Emilio G. Cota
2018-10-29 15:31 ` Alex Bennée
2018-10-25 15:11 ` [Qemu-arm] [RFC v4 00/71] per-CPU locks Emilio G. Cota
2018-10-25 15:11 ` [Qemu-devel] " Emilio G. Cota
2018-10-27 9:14 ` [Qemu-arm] " Alex Bennée
2018-10-27 9:14 ` [Qemu-devel] " Alex Bennée
2018-10-29 15:47 ` Emilio G. Cota
2018-10-29 15:47 ` [Qemu-devel] " Emilio G. Cota
2018-10-29 16:00 ` Alex Bennée
2018-10-29 16:00 ` [Qemu-devel] " Alex Bennée
2018-10-29 15:39 ` [Qemu-devel] [RFC v4 01/71] cpu: convert queued work to a QSIMPLEQ Alex Bennée
2018-10-29 15:55 ` Emilio G. Cota
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=874ld28abz.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=amarkovic@wavecomp.com \
--cc=aurelien@aurel32.net \
--cc=cota@braap.org \
--cc=jhogan@kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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.