diff options
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 200a8f9390b6..a44c68990cf4 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -660,6 +660,31 @@ int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code) | |||
660 | return 0; | 660 | return 0; |
661 | } | 661 | } |
662 | 662 | ||
663 | int kvm_s390_inject_prog_irq(struct kvm_vcpu *vcpu, | ||
664 | struct kvm_s390_pgm_info *pgm_info) | ||
665 | { | ||
666 | struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; | ||
667 | struct kvm_s390_interrupt_info *inti; | ||
668 | |||
669 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); | ||
670 | if (!inti) | ||
671 | return -ENOMEM; | ||
672 | |||
673 | VCPU_EVENT(vcpu, 3, "inject: prog irq %d (from kernel)", | ||
674 | pgm_info->code); | ||
675 | trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, KVM_S390_PROGRAM_INT, | ||
676 | pgm_info->code, 0, 1); | ||
677 | |||
678 | inti->type = KVM_S390_PROGRAM_INT; | ||
679 | memcpy(&inti->pgm, pgm_info, sizeof(inti->pgm)); | ||
680 | spin_lock_bh(&li->lock); | ||
681 | list_add(&inti->list, &li->list); | ||
682 | atomic_set(&li->active, 1); | ||
683 | BUG_ON(waitqueue_active(li->wq)); | ||
684 | spin_unlock_bh(&li->lock); | ||
685 | return 0; | ||
686 | } | ||
687 | |||
663 | struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm, | 688 | struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm, |
664 | u64 cr6, u64 schid) | 689 | u64 cr6, u64 schid) |
665 | { | 690 | { |