diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-03-25 12:09:08 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-04-22 07:24:53 -0400 |
commit | 67335e63c9ef59e97b45a08b4a6a93767762031d (patch) | |
tree | afe1abd9afec4fff5d825cc7353f6f7c2f84e2ef /arch/s390 | |
parent | f71d0dc5084b4de761b5be1aef1a855136cecd15 (diff) |
KVM: s390: Drop pending interrupts on guest exit
On hard exits (abort, sigkill) we have have some kvm_s390_interrupt_info
structures hanging around. Delete those on exit to avoid memory leaks.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
CC: stable@vger.kernel.org
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 4 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 2 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index d020c5f8eabb..077e4738ebdc 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -1045,7 +1045,7 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | |||
1045 | return 0; | 1045 | return 0; |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | static void clear_floating_interrupts(struct kvm *kvm) | 1048 | void kvm_s390_clear_float_irqs(struct kvm *kvm) |
1049 | { | 1049 | { |
1050 | struct kvm_s390_float_interrupt *fi; | 1050 | struct kvm_s390_float_interrupt *fi; |
1051 | struct kvm_s390_interrupt_info *n, *inti = NULL; | 1051 | struct kvm_s390_interrupt_info *n, *inti = NULL; |
@@ -1391,7 +1391,7 @@ static int flic_set_attr(struct kvm_device *dev, struct kvm_device_attr *attr) | |||
1391 | break; | 1391 | break; |
1392 | case KVM_DEV_FLIC_CLEAR_IRQS: | 1392 | case KVM_DEV_FLIC_CLEAR_IRQS: |
1393 | r = 0; | 1393 | r = 0; |
1394 | clear_floating_interrupts(dev->kvm); | 1394 | kvm_s390_clear_float_irqs(dev->kvm); |
1395 | break; | 1395 | break; |
1396 | case KVM_DEV_FLIC_APF_ENABLE: | 1396 | case KVM_DEV_FLIC_APF_ENABLE: |
1397 | dev->kvm->arch.gmap->pfault_enabled = 1; | 1397 | dev->kvm->arch.gmap->pfault_enabled = 1; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index e6bbfe1a9474..b32c42cbc706 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -471,6 +471,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) | |||
471 | { | 471 | { |
472 | VCPU_EVENT(vcpu, 3, "%s", "free cpu"); | 472 | VCPU_EVENT(vcpu, 3, "%s", "free cpu"); |
473 | trace_kvm_s390_destroy_vcpu(vcpu->vcpu_id); | 473 | trace_kvm_s390_destroy_vcpu(vcpu->vcpu_id); |
474 | kvm_s390_clear_local_irqs(vcpu); | ||
474 | kvm_clear_async_pf_completion_queue(vcpu); | 475 | kvm_clear_async_pf_completion_queue(vcpu); |
475 | if (!kvm_is_ucontrol(vcpu->kvm)) { | 476 | if (!kvm_is_ucontrol(vcpu->kvm)) { |
476 | clear_bit(63 - vcpu->vcpu_id, | 477 | clear_bit(63 - vcpu->vcpu_id, |
@@ -520,6 +521,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) | |||
520 | if (!kvm_is_ucontrol(kvm)) | 521 | if (!kvm_is_ucontrol(kvm)) |
521 | gmap_free(kvm->arch.gmap); | 522 | gmap_free(kvm->arch.gmap); |
522 | kvm_s390_destroy_adapters(kvm); | 523 | kvm_s390_destroy_adapters(kvm); |
524 | kvm_s390_clear_float_irqs(kvm); | ||
523 | } | 525 | } |
524 | 526 | ||
525 | /* Section: vcpu related */ | 527 | /* Section: vcpu related */ |
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index be8ae0d68ab6..c93ed5fabfbc 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -130,6 +130,7 @@ void kvm_s390_tasklet(unsigned long parm); | |||
130 | void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); | 130 | void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); |
131 | void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu); | 131 | void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu); |
132 | void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu); | 132 | void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu); |
133 | void kvm_s390_clear_float_irqs(struct kvm *kvm); | ||
133 | int __must_check kvm_s390_inject_vm(struct kvm *kvm, | 134 | int __must_check kvm_s390_inject_vm(struct kvm *kvm, |
134 | struct kvm_s390_interrupt *s390int); | 135 | struct kvm_s390_interrupt *s390int); |
135 | int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | 136 | int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, |