aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2014-11-21 03:38:12 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-11-28 06:33:00 -0500
commitda00fcbdac1b00bf33b71093047e975cc1f68779 (patch)
tree1aa1aa6d02b5440e4d277dcc96f6528ea6e7e9be /arch/s390/kvm
parent04b41acd060541fa76407d4de1e0acf0edd57c2a (diff)
KVM: s390: trigger the right CPU exit for floating interrupts
When injecting a floating interrupt and no CPU is idle we kick one CPU to do an external exit. In case of I/O we should trigger an I/O exit instead. This does not matter for Linux guests as external and I/O interrupts are enabled/disabled at the same time, but play safe anyway. The same holds true for machine checks. Since there is no special exit, just reuse the generic stop exit. The injection code inside the VCPU loop will recheck anyway and rearm the proper exits (e.g. control registers) if necessary. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/interrupt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 4fc3fed636dc..ead52bfb4c1d 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -851,7 +851,17 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
851 dst_vcpu = kvm_get_vcpu(kvm, sigcpu); 851 dst_vcpu = kvm_get_vcpu(kvm, sigcpu);
852 li = &dst_vcpu->arch.local_int; 852 li = &dst_vcpu->arch.local_int;
853 spin_lock(&li->lock); 853 spin_lock(&li->lock);
854 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags); 854 switch (inti->type) {
855 case KVM_S390_MCHK:
856 atomic_set_mask(CPUSTAT_STOP_INT, li->cpuflags);
857 break;
858 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
859 atomic_set_mask(CPUSTAT_IO_INT, li->cpuflags);
860 break;
861 default:
862 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
863 break;
864 }
855 spin_unlock(&li->lock); 865 spin_unlock(&li->lock);
856 kvm_s390_vcpu_wakeup(kvm_get_vcpu(kvm, sigcpu)); 866 kvm_s390_vcpu_wakeup(kvm_get_vcpu(kvm, sigcpu));
857unlock_fi: 867unlock_fi: