diff options
author | Jens Freimann <jfrei@linux.vnet.ibm.com> | 2015-03-19 10:12:12 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-03-31 15:07:30 -0400 |
commit | 79e87a103de1eda0cb4d726cd8581798e2d38f3e (patch) | |
tree | 8c5a256fa9ebc347d06fec4a747546948a8529aa /arch/s390/kvm | |
parent | 47b43c52ee4b0425449d1b2b1eedca7f6b7a578a (diff) |
KVM: s390: refactor vcpu injection function
Let's provide a version of kvm_s390_inject_vcpu() that
does not acquire the local-interrupt lock and skips
waking up the vcpu.
To be used in a later patch for vcpu-local interrupt migration,
where we are already holding the lock.
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 8a0786ccaf68..bc0988093c5b 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -1514,12 +1514,10 @@ void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu) | |||
1514 | spin_unlock(&li->lock); | 1514 | spin_unlock(&li->lock); |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq) | 1517 | static int do_inject_vcpu(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq) |
1518 | { | 1518 | { |
1519 | struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; | ||
1520 | int rc; | 1519 | int rc; |
1521 | 1520 | ||
1522 | spin_lock(&li->lock); | ||
1523 | switch (irq->type) { | 1521 | switch (irq->type) { |
1524 | case KVM_S390_PROGRAM_INT: | 1522 | case KVM_S390_PROGRAM_INT: |
1525 | VCPU_EVENT(vcpu, 3, "inject: program check %d (from user)", | 1523 | VCPU_EVENT(vcpu, 3, "inject: program check %d (from user)", |
@@ -1559,6 +1557,17 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq) | |||
1559 | default: | 1557 | default: |
1560 | rc = -EINVAL; | 1558 | rc = -EINVAL; |
1561 | } | 1559 | } |
1560 | |||
1561 | return rc; | ||
1562 | } | ||
1563 | |||
1564 | int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq) | ||
1565 | { | ||
1566 | struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; | ||
1567 | int rc; | ||
1568 | |||
1569 | spin_lock(&li->lock); | ||
1570 | rc = do_inject_vcpu(vcpu, irq); | ||
1562 | spin_unlock(&li->lock); | 1571 | spin_unlock(&li->lock); |
1563 | if (!rc) | 1572 | if (!rc) |
1564 | kvm_s390_vcpu_wakeup(vcpu); | 1573 | kvm_s390_vcpu_wakeup(vcpu); |