Skip to content

Commit

Permalink
KVM: s390: Simplify online vcpus counting for stsi
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Freimann authored and Christian Borntraeger committed Mar 4, 2014
1 parent afa45ff commit ff520a6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arch/s390/kvm/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,10 @@ static int handle_stidp(struct kvm_vcpu *vcpu)

static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem)
{
struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
int cpus = 0;
int n;

spin_lock(&fi->lock);
for (n = 0; n < KVM_MAX_VCPUS; n++)
if (fi->local_int[n])
cpus++;
spin_unlock(&fi->lock);
cpus = atomic_read(&vcpu->kvm->online_vcpus);

/* deal with other level 3 hypervisors */
if (stsi(mem, 3, 2, 2))
Expand Down

0 comments on commit ff520a6

Please sign in to comment.