diff options
author | Jens Freimann <jfrei@linux.vnet.ibm.com> | 2014-02-11 05:07:05 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-04-22 07:24:34 -0400 |
commit | bcd846837c43ccccc932036d5a634bee48f1ff4f (patch) | |
tree | b20154ac5d4e9e2a7252b817bd723ddeb33364cb /arch/s390/kvm | |
parent | 4f718eab262868aeab83774ec4ce25e6a9906657 (diff) |
KVM: s390: allow injecting every kind of interrupt
Add a new data structure and function that allows to inject
all kinds of interrupt as defined in the PoP
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 25 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 3 |
2 files changed, 28 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 | { |
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 460ccd828bbb..25a8b8478918 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -165,6 +165,9 @@ bool kvm_s390_cmma_enabled(struct kvm *kvm); | |||
165 | 165 | ||
166 | /* implemented in diag.c */ | 166 | /* implemented in diag.c */ |
167 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); | 167 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); |
168 | /* implemented in interrupt.c */ | ||
169 | int kvm_s390_inject_prog_irq(struct kvm_vcpu *vcpu, | ||
170 | struct kvm_s390_pgm_info *pgm_info); | ||
168 | 171 | ||
169 | /* implemented in interrupt.c */ | 172 | /* implemented in interrupt.c */ |
170 | int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); | 173 | int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); |