From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>, KVM <kvm@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
Thomas Huth <thuth@linux.vnet.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Subject: [PULL 3/8] KVM: s390: Simplify online vcpus counting for stsi
Date: Tue, 4 Mar 2014 12:27:13 +0100 [thread overview]
Message-ID: <1393932438-58848-4-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1393932438-58848-1-git-send-email-borntraeger@de.ibm.com>
From: Jens Freimann <jfrei@linux.vnet.ibm.com>
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>
---
arch/s390/kvm/priv.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 75beea6..ae9e8ee 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)
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))
--
1.8.4.2
next prev parent reply other threads:[~2014-03-04 11:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 11:27 [PULL 0/8] KVM: s390,virtio-ccw: Features, cleanups and fixes Christian Borntraeger
2014-03-04 11:27 ` [PULL 1/8] KVM: s390: Provide access to program parameter Christian Borntraeger
2014-03-04 11:27 ` [PULL 2/8] KVM: s390: expose gbea register to userspace Christian Borntraeger
2014-03-04 11:27 ` Christian Borntraeger [this message]
2014-03-04 11:27 ` [PULL 4/8] KVM: s390: Fixed CC of SIGP SET_PREFIX handler Christian Borntraeger
2014-03-04 11:27 ` [PULL 5/8] KVM: s390: get rid of local_int array Christian Borntraeger
2014-03-04 11:27 ` [PULL 6/8] virtio_ccw: fix vcdev pointer handling issues Christian Borntraeger
2014-03-04 11:27 ` [PULL 7/8] s390/airq: add support for irq ranges Christian Borntraeger
2014-03-04 11:27 ` [PULL 8/8] virtio-ccw: virtio-ccw adapter interrupt support Christian Borntraeger
2014-03-04 11:34 ` [PULL 0/8] KVM: s390,virtio-ccw: Features, cleanups and fixes Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393932438-58848-4-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=gleb@kernel.org \
--cc=graalfs@linux.vnet.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=schwidefsky@de.ibm.com \
--cc=thuth@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.