aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorJason J. Herne <jjherne@us.ibm.com>2012-10-02 10:25:36 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-10-10 18:03:37 -0400
commit82a1273713df37375a75d6a700deef70c0d21360 (patch)
treeb3c526aa40ccd3da81f19ed428e269c2c3743fa9 /arch/s390
parentd151f63f20133aef9dbda209faddebcddbfccf31 (diff)
s390/kvm: Interrupt injection bugfix
EXTERNAL_CALL and EMERGENCY type interrupts need to preserve their interrupt code parameter when being injected from user space. Signed-off-by: Jason J. Herne <jjherne@us.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/interrupt.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index ff1e2f8ef94a..c30615e605ac 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -629,10 +629,27 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
629 break; 629 break;
630 case KVM_S390_SIGP_STOP: 630 case KVM_S390_SIGP_STOP:
631 case KVM_S390_RESTART: 631 case KVM_S390_RESTART:
632 VCPU_EVENT(vcpu, 3, "inject: type %x", s390int->type);
633 inti->type = s390int->type;
634 break;
632 case KVM_S390_INT_EXTERNAL_CALL: 635 case KVM_S390_INT_EXTERNAL_CALL:
636 if (s390int->parm & 0xffff0000) {
637 kfree(inti);
638 return -EINVAL;
639 }
640 VCPU_EVENT(vcpu, 3, "inject: external call source-cpu:%u",
641 s390int->parm);
642 inti->type = s390int->type;
643 inti->extcall.code = s390int->parm;
644 break;
633 case KVM_S390_INT_EMERGENCY: 645 case KVM_S390_INT_EMERGENCY:
634 VCPU_EVENT(vcpu, 3, "inject: type %x", s390int->type); 646 if (s390int->parm & 0xffff0000) {
647 kfree(inti);
648 return -EINVAL;
649 }
650 VCPU_EVENT(vcpu, 3, "inject: emergency %u\n", s390int->parm);
635 inti->type = s390int->type; 651 inti->type = s390int->type;
652 inti->emerg.code = s390int->parm;
636 break; 653 break;
637 case KVM_S390_INT_VIRTIO: 654 case KVM_S390_INT_VIRTIO:
638 case KVM_S390_INT_SERVICE: 655 case KVM_S390_INT_SERVICE: