diff options
author | Jens Freimann <jfrei@linux.vnet.ibm.com> | 2014-02-24 04:11:41 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-03-04 04:41:02 -0500 |
commit | ff520a6327e83ef55515d1be3d0a1b10c084f59c (patch) | |
tree | d47cb7f5dc7cad419a99b98f70a5ac7b5a0aac8d /arch/s390/kvm/priv.c | |
parent | afa45ff521130cee79a50b565693388be8c8c9c2 (diff) |
KVM: s390: Simplify online vcpus counting for stsi
We don't need to loop over all cpus to get the number of
vcpus. Let's use the available counter online_vcpus instead.
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/priv.c')
-rw-r--r-- | arch/s390/kvm/priv.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 75beea632a10..ae9e8ee21557 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -396,15 +396,10 @@ static int handle_stidp(struct kvm_vcpu *vcpu) | |||
396 | 396 | ||
397 | static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem) | 397 | static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem) |
398 | { | 398 | { |
399 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; | ||
400 | int cpus = 0; | 399 | int cpus = 0; |
401 | int n; | 400 | int n; |
402 | 401 | ||
403 | spin_lock(&fi->lock); | 402 | cpus = atomic_read(&vcpu->kvm->online_vcpus); |
404 | for (n = 0; n < KVM_MAX_VCPUS; n++) | ||
405 | if (fi->local_int[n]) | ||
406 | cpus++; | ||
407 | spin_unlock(&fi->lock); | ||
408 | 403 | ||
409 | /* deal with other level 3 hypervisors */ | 404 | /* deal with other level 3 hypervisors */ |
410 | if (stsi(mem, 3, 2, 2)) | 405 | if (stsi(mem, 3, 2, 2)) |