[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 10/56] ppc: convert to cpu_halted
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [RFC v3 10/56] ppc: convert to cpu_halted |
Date: |
Mon, 22 Oct 2018 17:12:13 -0400 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Sun, Oct 21, 2018 at 13:56:59 +0100, Richard Henderson wrote:
> On 10/19/18 2:05 AM, Emilio G. Cota wrote:
> > @@ -1088,11 +1088,13 @@ static target_ulong h_cede(PowerPCCPU *cpu,
> > sPAPRMachineState *spapr,
> >
> > env->msr |= (1ULL << MSR_EE);
> > hreg_compute_hflags(env);
> > + cpu_mutex_lock(cs);
> > if (!cpu_has_work(cs)) {
> > - cs->halted = 1;
> > + cpu_halted_set(cs, 1);
> > cs->exception_index = EXCP_HLT;
> > cs->exit_request = 1;
> > }
> > + cpu_mutex_unlock(cs);
> > return H_SUCCESS;
>
> Why does this one get extra locking?
It's taking into account that later in the series we
expand the CPU lock to cpu_has_work. I've added the
following note to this patch's commit log:
> In hw/ppc/spapr_hcall.c, acquire the lock just once to
> update cpu->halted and call cpu_has_work, since later
> in the series we'll acquire the BQL (if not already held)
> from cpu_has_work.
Thanks,
Emilio
- [Qemu-devel] [RFC v3 05/56] cpu: move run_on_cpu to cpus-common, (continued)
- [Qemu-devel] [RFC v3 05/56] cpu: move run_on_cpu to cpus-common, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 03/56] cpu: introduce cpu_mutex_lock/unlock, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 04/56] cpu: make qemu_work_cond per-cpu, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 06/56] cpu: introduce process_queued_cpu_work_locked, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 02/56] cpu: rename cpu->work_mutex to cpu->lock, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 10/56] ppc: convert to cpu_halted, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 13/56] lm32: convert to cpu_halted, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 01/56] cpu: convert queued work to a QSIMPLEQ, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 08/56] cpu: define cpu_halted helpers, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 09/56] arm: convert to cpu_halted, Emilio G. Cota, 2018/10/18
- [Qemu-devel] [RFC v3 16/56] riscv: convert to cpu_halted, Emilio G. Cota, 2018/10/18