]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option
authorChristoffer Dall <christoffer.dall@linaro.org>
Thu, 16 Oct 2014 14:14:43 +0000 (16:14 +0200)
committerJiri Slaby <jslaby@suse.cz>
Thu, 30 Apr 2015 09:15:12 +0000 (11:15 +0200)
commit 3ad8b3de526a76fbe9466b366059e4958957b88f upstream.

The implementation of KVM_ARM_VCPU_INIT is currently not doing what
userspace expects, namely making sure that a vcpu which may have been
turned off using PSCI is returned to its initial state, which would be
powered on if userspace does not set the KVM_ARM_VCPU_POWER_OFF flag.

Implement the expected functionality and clarify the ABI.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Documentation/virtual/kvm/api.txt
arch/arm/kvm/arm.c

index 858aecf21db2c9d449d984af406a838ed5143ed4..0d578c0f5749a40a286337cd2c23baa0ed29cd2e 100644 (file)
@@ -2299,7 +2299,8 @@ should be created before this ioctl is invoked.
 
 Possible features:
        - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
-         Depends on KVM_CAP_ARM_PSCI.
+         Depends on KVM_CAP_ARM_PSCI.  If not set, the CPU will be powered on
+         and execute guest code when KVM_RUN is called.
        - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
          Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only).
 
index 7dc8e010c2003badc53e6b1b27713592e0a73701..137cee9f3fd21eecc90c00409d8a7e2f49f97df7 100644 (file)
@@ -678,6 +678,8 @@ static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu,
         */
        if (test_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features))
                vcpu->arch.pause = true;
+       else
+               vcpu->arch.pause = false;
 
        return 0;
 }