KVM: s390: no special machine check delivery
authorChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 4 Aug 2014 14:54:22 +0000 (16:54 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 25 Aug 2014 12:35:30 +0000 (14:35 +0200)
The load PSW handler does not have to inject pending machine checks.
This can wait until the CPU runs the generic interrupt injection code.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.h
arch/s390/kvm/priv.c

index 71bf7e749cf73e946a47acdf9a83c8becc170e41..34d741edb50acc2a3eb0f3fe0898279b2d1a49b2 100644 (file)
@@ -721,62 +721,6 @@ void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
        }
 }
 
-void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu)
-{
-       struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
-       struct kvm_s390_float_interrupt *fi = vcpu->arch.local_int.float_int;
-       struct kvm_s390_interrupt_info  *n, *inti = NULL;
-       int deliver;
-
-       __reset_intercept_indicators(vcpu);
-       if (atomic_read(&li->active)) {
-               do {
-                       deliver = 0;
-                       spin_lock(&li->lock);
-                       list_for_each_entry_safe(inti, n, &li->list, list) {
-                               if ((inti->type == KVM_S390_MCHK) &&
-                                   __interrupt_is_deliverable(vcpu, inti)) {
-                                       list_del(&inti->list);
-                                       deliver = 1;
-                                       break;
-                               }
-                               __set_intercept_indicator(vcpu, inti);
-                       }
-                       if (list_empty(&li->list))
-                               atomic_set(&li->active, 0);
-                       spin_unlock(&li->lock);
-                       if (deliver) {
-                               __do_deliver_interrupt(vcpu, inti);
-                               kfree(inti);
-                       }
-               } while (deliver);
-       }
-
-       if (atomic_read(&fi->active)) {
-               do {
-                       deliver = 0;
-                       spin_lock(&fi->lock);
-                       list_for_each_entry_safe(inti, n, &fi->list, list) {
-                               if ((inti->type == KVM_S390_MCHK) &&
-                                   __interrupt_is_deliverable(vcpu, inti)) {
-                                       list_del(&inti->list);
-                                       fi->irq_count--;
-                                       deliver = 1;
-                                       break;
-                               }
-                               __set_intercept_indicator(vcpu, inti);
-                       }
-                       if (list_empty(&fi->list))
-                               atomic_set(&fi->active, 0);
-                       spin_unlock(&fi->lock);
-                       if (deliver) {
-                               __do_deliver_interrupt(vcpu, inti);
-                               kfree(inti);
-                       }
-               } while (deliver);
-       }
-}
-
 int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code)
 {
        struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
index 3862fa2cefe08603e503bfcea56b151ca22a249b..894fa4653dfb1cecee3c012ab994d573a5964d34 100644 (file)
@@ -139,7 +139,6 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu);
 void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu);
 enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);
 void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu);
-void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu);
 void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu);
 void kvm_s390_clear_float_irqs(struct kvm *kvm);
 int __must_check kvm_s390_inject_vm(struct kvm *kvm,
index f89c1cd677519b205ff6f130f43453a5d5dc236a..d806f2cfde16d8be5430e92336d69f0afc3955b6 100644 (file)
@@ -352,13 +352,6 @@ static int handle_stfl(struct kvm_vcpu *vcpu)
        return 0;
 }
 
-static void handle_new_psw(struct kvm_vcpu *vcpu)
-{
-       /* Check whether the new psw is enabled for machine checks. */
-       if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_MCHECK)
-               kvm_s390_deliver_pending_machine_checks(vcpu);
-}
-
 #define PSW_MASK_ADDR_MODE (PSW_MASK_EA | PSW_MASK_BA)
 #define PSW_MASK_UNASSIGNED 0xb80800fe7fffffffUL
 #define PSW_ADDR_24 0x0000000000ffffffUL
@@ -405,7 +398,6 @@ int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
        gpsw->addr = new_psw.addr & ~PSW32_ADDR_AMODE;
        if (!is_valid_psw(gpsw))
                return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
-       handle_new_psw(vcpu);
        return 0;
 }
 
@@ -427,7 +419,6 @@ static int handle_lpswe(struct kvm_vcpu *vcpu)
        vcpu->arch.sie_block->gpsw = new_psw;
        if (!is_valid_psw(&vcpu->arch.sie_block->gpsw))
                return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
-       handle_new_psw(vcpu);
        return 0;
 }