QEMU-Arm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "MTTCG Devel" <mttcg@listserver.greensocs.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"KONRAD Frédéric" <fred.konrad@greensocs.com>,
	"Alvise Rigo" <a.rigo@virtualopensystems.com>,
	"Emilio G. Cota" <cota@braap.org>,
	"Pranith Kumar" <bobby.prani@gmail.com>,
	"Nikunj A Dadhania" <nikunj@linux.vnet.ibm.com>,
	"Mark Burton" <mark.burton@greensocs.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"Fedorov Sergey" <serge.fdrv@gmail.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Bamvor Zhang Jian" <bamvor.zhangjian@linaro.org>,
	"open list:ARM" <qemu-arm@nongnu.org>
Subject: Re: [PATCH v9 20/25] target-arm/powerctl: defer cpu reset work to CPU context
Date: Fri, 03 Feb 2017 15:02:54 +0000	[thread overview]
Message-ID: <87poizfhb5.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA82=VUZF5DHBe+bEu0GBeM-Yg50TRkSHmDsgdAJ_YdgBw@mail.gmail.com>


Peter Maydell <peter.maydell@linaro.org> writes:

> On 1 February 2017 at 15:05, Alex Bennée <alex.bennee@linaro.org> wrote:
>> When switching a new vCPU on we want to complete a bunch of the setup
>> work before we start scheduling the vCPU thread. To do this cleanly we
>> defer vCPU setup to async work which will run the vCPUs execution
>> context as the thread is woken up. The scheduling of the work will kick
>> the vCPU awake.
>>
>> This avoids potential races in MTTCG system emulation.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Reviewed-by: Richard Henderson <rth@twiddle.net>
>
> Can we now have races between arm_set_cpu_on() and
> arm_set_cpu_off() ? It's not clear to me what prevents that.
>
> With this change our PSCI CPU_ON is no longer effectively
> atomic, which means we need to think about the races
> between PSCI CPU_ON and CPU_OFF, and the fact that the
> core might be in what the PSCI spec section 6.6
> calls an ON_PENDING state (ie CPU_ON has been called
> for it but it hasn't actually booted yet).

Would it be enough to also queue the set_cpu_off work?

The queue itself is safe to add to so you'll end up with a series of
on/off deferred work that will eventually unwind itself when the CPU
thread runs.

>
> thanks
> -- PMM


--
Alex Bennée

  reply	other threads:[~2017-02-03 15:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170201150553.9381-1-alex.bennee@linaro.org>
2017-02-01 15:05 ` [PATCH v9 08/25] tcg: drop global lock during TCG code execution Alex Bennée
2017-02-03 10:09   ` Peter Maydell
2017-02-01 15:05 ` [PATCH v9 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap Alex Bennée
2017-02-01 21:29   ` Richard Henderson
2017-02-03 10:15   ` Peter Maydell
2017-02-01 15:05 ` [PATCH v9 20/25] target-arm/powerctl: defer cpu reset work to CPU context Alex Bennée
2017-02-03 11:15   ` Peter Maydell
2017-02-03 15:02     ` Alex Bennée [this message]
2017-02-01 15:05 ` [PATCH v9 21/25] target-arm: don't generate WFE/YIELD calls for MTTCG Alex Bennée
2017-02-03 11:17   ` Peter Maydell
2017-02-03 11:30     ` Alex Bennée
2017-02-01 15:05 ` [PATCH v9 22/25] target-arm/cpu.h: make ARM_CP defined consistent Alex Bennée
2017-02-03 11:19   ` Peter Maydell
2017-02-01 15:05 ` [PATCH v9 23/25] target-arm: introduce ARM_CP_EXIT_PC Alex Bennée
2017-02-03 11:22   ` Peter Maydell
2017-02-03 11:33     ` Alex Bennée
2017-02-01 15:05 ` [PATCH v9 24/25] target-arm: ensure all cross vCPUs TLB flushes complete Alex Bennée
2017-02-03 11:33   ` Peter Maydell
2017-02-01 15:05 ` [PATCH v9 25/25] tcg: enable MTTCG by default for ARM on x86 hosts Alex Bennée
2017-02-03 11:25   ` Peter Maydell
2017-02-03 12:07     ` Alex Bennée

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=87poizfhb5.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=a.rigo@virtualopensystems.com \
    --cc=bamvor.zhangjian@linaro.org \
    --cc=bobby.prani@gmail.com \
    --cc=cota@braap.org \
    --cc=fred.konrad@greensocs.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mark.burton@greensocs.com \
    --cc=mttcg@listserver.greensocs.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=serge.fdrv@gmail.com \
    /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