aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/psci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kvm/psci.c')
-rw-r--r--arch/arm/kvm/psci.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c
index 4b94b513168d..ad6f6424f1d1 100644
--- a/arch/arm/kvm/psci.c
+++ b/arch/arm/kvm/psci.c
@@ -126,7 +126,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu)
126 126
127static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) 127static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu)
128{ 128{
129 int i; 129 int i, matching_cpus = 0;
130 unsigned long mpidr; 130 unsigned long mpidr;
131 unsigned long target_affinity; 131 unsigned long target_affinity;
132 unsigned long target_affinity_mask; 132 unsigned long target_affinity_mask;
@@ -151,12 +151,16 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu)
151 */ 151 */
152 kvm_for_each_vcpu(i, tmp, kvm) { 152 kvm_for_each_vcpu(i, tmp, kvm) {
153 mpidr = kvm_vcpu_get_mpidr_aff(tmp); 153 mpidr = kvm_vcpu_get_mpidr_aff(tmp);
154 if (((mpidr & target_affinity_mask) == target_affinity) && 154 if ((mpidr & target_affinity_mask) == target_affinity) {
155 !tmp->arch.pause) { 155 matching_cpus++;
156 return PSCI_0_2_AFFINITY_LEVEL_ON; 156 if (!tmp->arch.pause)
157 return PSCI_0_2_AFFINITY_LEVEL_ON;
157 } 158 }
158 } 159 }
159 160
161 if (!matching_cpus)
162 return PSCI_RET_INVALID_PARAMS;
163
160 return PSCI_0_2_AFFINITY_LEVEL_OFF; 164 return PSCI_0_2_AFFINITY_LEVEL_OFF;
161} 165}
162 166