OSDN Git Service

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[tomoyo/tomoyo-test1.git] / arch / s390 / kvm / interrupt.c
index 6fa6a4b..c1b47d6 100644 (file)
@@ -1392,6 +1392,7 @@ int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
 {
        struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
        int rc = 0;
+       bool delivered = false;
        unsigned long irq_type;
        unsigned long irqs;
 
@@ -1465,6 +1466,19 @@ int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
                        WARN_ONCE(1, "Unknown pending irq type %ld", irq_type);
                        clear_bit(irq_type, &li->pending_irqs);
                }
+               delivered |= !rc;
+       }
+
+       /*
+        * We delivered at least one interrupt and modified the PC. Force a
+        * singlestep event now.
+        */
+       if (delivered && guestdbg_sstep_enabled(vcpu)) {
+               struct kvm_debug_exit_arch *debug_exit = &vcpu->run->debug.arch;
+
+               debug_exit->addr = vcpu->arch.sie_block->gpsw.addr;
+               debug_exit->type = KVM_SINGLESTEP;
+               vcpu->guest_debug |= KVM_GUESTDBG_EXIT_PENDING;
        }
 
        set_intercept_indicators(vcpu);