summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-09-23 09:45:50 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-11-30 12:47:09 +0100
commit2c1bb2be986c56848ce92ba41ba32fc62ab3165f (patch)
treed993b44cd371b29a40f9b521fbe9cdafc225e1d7 /arch/s390
parentfe0edcb7311e80a349ad5f2b15f2d91a5606ed7f (diff)
downloadop-kernel-dev-2c1bb2be986c56848ce92ba41ba32fc62ab3165f.zip
op-kernel-dev-2c1bb2be986c56848ce92ba41ba32fc62ab3165f.tar.gz
KVM: s390: fast path for sca_ext_call_pending
If CPUSTAT_ECALL_PEND isn't set, we can't have an external call pending, so we can directly avoid taking the lock. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/interrupt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 831c9ac..62ec925 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -39,6 +39,9 @@ static int sca_ext_call_pending(struct kvm_vcpu *vcpu, int *src_id)
{
int c, scn;
+ if (!(atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_ECALL_PEND))
+ return 0;
+
read_lock(&vcpu->kvm->arch.sca_lock);
if (vcpu->kvm->arch.use_esca) {
struct esca_block *sca = vcpu->kvm->arch.sca;
@@ -60,8 +63,7 @@ static int sca_ext_call_pending(struct kvm_vcpu *vcpu, int *src_id)
if (src_id)
*src_id = scn;
- return c && atomic_read(&vcpu->arch.sie_block->cpuflags) &
- CPUSTAT_ECALL_PEND;
+ return c;
}
static int sca_inject_ext_call(struct kvm_vcpu *vcpu, int src_id)
OpenPOWER on IntegriCloud