public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: kvm@vger.kernel.org
Cc: "David Hildenbrand" <david@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	peterx@redhat.com, "Radim Krčmář" <rkrcmar@redhat.com>
Subject: [PATCH v2 3/3] KVM: x86: use pic/ioapic destructor when destroy vm
Date: Wed, 15 Mar 2017 16:01:19 +0800	[thread overview]
Message-ID: <1489564879-6097-4-git-send-email-peterx@redhat.com> (raw)
In-Reply-To: <1489564879-6097-1-git-send-email-peterx@redhat.com>

We have specific destructors for pic/ioapic, we'd better use them when
destroying the VM as well.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 arch/x86/kvm/x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1faf620..d30ff49 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8153,8 +8153,8 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
 	if (kvm_x86_ops->vm_destroy)
 		kvm_x86_ops->vm_destroy(kvm);
 	kvm_iommu_unmap_guest(kvm);
-	kfree(kvm->arch.vpic);
-	kfree(kvm->arch.vioapic);
+	kvm_pic_destroy(kvm);
+	kvm_ioapic_destroy(kvm);
 	kvm_free_vcpus(kvm);
 	kvfree(rcu_dereference_check(kvm->arch.apic_map, 1));
 	kvm_mmu_uninit_vm(kvm);
-- 
2.7.4

  parent reply	other threads:[~2017-03-15  8:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15  8:01 [PATCH v2 0/3] KVM: x86: use pic/ioapic destructor when proper Peter Xu
2017-03-15  8:01 ` [PATCH v2 1/3] KVM: x86: clear bus pointer when destroyed Peter Xu
2017-03-21  9:24   ` David Hildenbrand
2017-03-15  8:01 ` [PATCH v2 2/3] KVM: x86: check existance before destroy Peter Xu
2017-03-21  9:24   ` David Hildenbrand
2017-03-15  8:01 ` Peter Xu [this message]
2017-03-21  9:25   ` [PATCH v2 3/3] KVM: x86: use pic/ioapic destructor when destroy vm David Hildenbrand
2017-03-15  8:47 ` [PATCH v2 0/3] KVM: x86: use pic/ioapic destructor when proper David Hildenbrand
2017-03-15  8:59   ` Peter Xu
2017-03-15  9:04     ` David Hildenbrand
2017-03-15 11:15     ` David Hildenbrand
2017-03-16  6:04       ` Peter Xu
2017-03-16 19:32         ` Radim Krčmář
2017-03-17  6:05           ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489564879-6097-4-git-send-email-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox