All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 0/3] KVM: x86: use pic/ioapic destructor when proper
Date: Thu, 16 Mar 2017 20:32:14 +0100	[thread overview]
Message-ID: <20170316193214.GB16668@potion> (raw)
In-Reply-To: <20170316060412.GK5971@pxdev.xzpeter.org>

2017-03-16 14:04+0800, Peter Xu:
> On Wed, Mar 15, 2017 at 12:15:24PM +0100, David Hildenbrand wrote:
>> Am 15.03.2017 um 09:59 schrieb Peter Xu:
>> > On Wed, Mar 15, 2017 at 09:47:14AM +0100, David Hildenbrand wrote:
>> >> Am 15.03.2017 um 09:01 schrieb Peter Xu:
>> >>> v2:
>> >>> - add one more patch (patch 2 in v2) to check pic/ioapic's
>> >>>   existance before destroying them
>> >>
>> >> Patch 2+3 without 1 should work, too, right?
>> > 
>> > We may need that? When destroy VM, it's:
>> > 
>> >   kvm_destroy_vm()
>> >     foreach (bus) do kvm_io_bus_destroy()
>> >       kfree(bus)                          <--- [1]
>> >     kvm_arch_destroy_vm()
>> >       kvm_pic_destroy()
>> >         kvm_io_bus_unregister_dev()       <--- [2]
>> > 
>> 
>> Wouldn't the natural way be
>> 
>> 1. kvm_arch_destroy_vm()
>> 2. foreach (bus) do kvm_io_bus_destroy()
>> 	kfree(bus)
>> 
>> Then we wouldn't have to deal with suddenly removed buses. But maybe
>> that order is of importance here ...
> 
> I'll leave this question for Paolo/Radim, or anyone knows this better
> than me. :-)

I'd like if kvm_destroy_vm() looked like kvm_create_vm() in reverse and
the current order is closer to that.

I don't think there is dependency between those two and we can easily
reverse them in kvm_create_vm(), so go ahead if you get better code out
of it in kvm_arch_destroy_vm(). :)

  reply	other threads:[~2017-03-16 19:32 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 ` [PATCH v2 3/3] KVM: x86: use pic/ioapic destructor when destroy vm Peter Xu
2017-03-21  9:25   ` 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ář [this message]
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=20170316193214.GB16668@potion \
    --to=rkrcmar@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.