diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-01-22 17:09:59 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-01-22 17:09:59 +0800 |
commit | 7b8892bba12eba95f3e1615dfeb8ad77e3b0371a (patch) | |
tree | 70b4cc1f7003724e722f9fcbd0956e7920c2e854 /arch/arm/kvm/psci.c | |
parent | fef6c6c09f13ef1f58fd841a08da53c6a8651bdf (diff) | |
parent | efab1adba28d9ebbfa86808375fc085c4e84e746 (diff) |
Merge branch 'linux-linaro-lsk-v4.1' into linux-linaro-lsk-v4.1-androidlsk-v4.1-16.01-android
Diffstat (limited to 'arch/arm/kvm/psci.c')
-rw-r--r-- | arch/arm/kvm/psci.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c index 531e922486b2..ad6f6424f1d1 100644 --- a/arch/arm/kvm/psci.c +++ b/arch/arm/kvm/psci.c @@ -24,6 +24,8 @@ #include <asm/kvm_psci.h> #include <asm/kvm_host.h> +#include <uapi/linux/psci.h> + /* * This is an implementation of the Power State Coordination Interface * as described in ARM document number ARM DEN 0022A. @@ -124,7 +126,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) { - int i; + int i, matching_cpus = 0; unsigned long mpidr; unsigned long target_affinity; unsigned long target_affinity_mask; @@ -149,12 +151,16 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) */ kvm_for_each_vcpu(i, tmp, kvm) { mpidr = kvm_vcpu_get_mpidr_aff(tmp); - if (((mpidr & target_affinity_mask) == target_affinity) && - !tmp->arch.pause) { - return PSCI_0_2_AFFINITY_LEVEL_ON; + if ((mpidr & target_affinity_mask) == target_affinity) { + matching_cpus++; + if (!tmp->arch.pause) + return PSCI_0_2_AFFINITY_LEVEL_ON; } } + if (!matching_cpus) + return PSCI_RET_INVALID_PARAMS; + return PSCI_0_2_AFFINITY_LEVEL_OFF; } |