diff options
author | Christoffer Dall <christoffer.dall@linaro.org> | 2013-11-20 01:43:19 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-03-26 00:43:15 (GMT) |
commit | 6cfad45636d0b16553a81b54c9501b0d9d48949f (patch) | |
tree | 038f0ba8b29767b2d3b5c096585c0a10e36334ea /include/uapi | |
parent | 4bf2d677b323673336b62dd9d4303679c4f65e75 (diff) | |
download | linux-fsl-qoriq-6cfad45636d0b16553a81b54c9501b0d9d48949f.tar.xz |
arm: KVM: Don't return PSCI_INVAL if waitqueue is inactive
The current KVM implementation of PSCI returns INVALID_PARAMETERS if the
waitqueue for the corresponding CPU is not active. This does not seem
correct, since KVM should not care what the specific thread is doing,
for example, user space may not have called KVM_RUN on this VCPU yet or
the thread may be busy looping to user space because it received a
signal; this is really up to the user space implementation. Instead we
should check specifically that the CPU is marked as being turned off,
regardless of the VCPU thread state, and if it is, we shall
simply clear the pause flag on the CPU and wake up the thread if it
happens to be blocked for us.
Further, the implementation seems to be racy when executing multiple
VCPU threads. There really isn't a reasonable user space programming
scheme to ensure all secondary CPUs have reached kvm_vcpu_first_run_init
before turning on the boot CPU.
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.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
(cherry picked from commit 478a8237f656d86d25b3e4e4bf3c48f590156294)
Conflicts:
arch/arm/kvm/psci.c
Signed-off-by: Diana Craciun <Diana.Craciun@freescale.com>
Change-Id: Ifdb4ff10bd3f02de20ee2302024a7dbedd1ddbf0
Reviewed-on: http://git.am.freescale.net:8181/31349
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Mihai Caraman <mihai.caraman@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions