linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: KVM: Don't return PSCI_INVAL if waitqueue is inactive
Date: Wed, 20 Nov 2013 11:21:02 -0800	[thread overview]
Message-ID: <20131120192102.GF9314@cbox> (raw)
In-Reply-To: <CAFEAcA-b5CTMQLsYikHcExVDjy8BL3gnx=Z7f4jVGPCkJsD6Ew@mail.gmail.com>

On Wed, Nov 20, 2013 at 07:12:42PM +0000, Peter Maydell wrote:
> On 20 November 2013 18:51, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> > Therefore, set the pause flag on the vcpu at VCPU init time (which can
> > reasonably be expected to be completed for all CPUs by user space before
> > running any VCPUs) and clear both this flag and the feature (in case the
> > feature can somehow get set again in the future) and ping the waitqueue
> > on turning on a VCPU using PSCI.
> 
> Tangential, but your phrasing prompted me to ask: how does
> the "start in PSCI power-off" boot protocol work for system reset?
> Since the kernel doesn't currently provide a "reset this v CPU"
> ioctl userspace has to do reset manually[*]; how do we say "take
> this vCPU which has started up and run once, and put it back
> into PSCI power-off" ?
> 
> [*] this is pretty tedious, since it involves reading every CPU
> register on the vCPU before first run in order to feed the kernel
> back a bunch of info it already knows about the reset state of
> a vCPU.
> 
So, from looking at the code and the API specification calling
KVM_ARM_VCPU_INIT does exactly this and also resets all core and cp15
registers for you - you would here be able to set the power-off flag and
pause those CPUs so PSCI can wake them up again.

Am I missing something here?

This makes me wonder if it's worth adding to
Documentation/virtual/kvm/api.txt that KVM_ARM_VCPU_INIT should be
called on all VCPUs before running any of the VCPUs...

-Christoffer

  reply	other threads:[~2013-11-20 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 18:51 [PATCH] arm: KVM: Don't return PSCI_INVAL if waitqueue is inactive Christoffer Dall
2013-11-20 19:12 ` Peter Maydell
2013-11-20 19:21   ` Christoffer Dall [this message]
2013-11-20 19:27     ` Peter Maydell
2013-11-20 19:37       ` Christoffer Dall
     [not found] ` <20131211205315.GH2871@cbox>
     [not found]   ` <52A98074.9080103@arm.com>
2013-12-12 20:09     ` Christoffer Dall

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=20131120192102.GF9314@cbox \
    --to=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).