[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFgQCTs8fQbAc8+aEJ58yYnCUQQO+g1UgT8cY1ZDiq5XJ8h48w@mail.gmail.com>
Date: Thu, 15 Dec 2011 17:06:09 +0800
From: Liu ping fan <kernelfans@...il.com>
To: Gleb Natapov <gleb@...hat.com>
Cc: Marcelo Tosatti <mtosatti@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, avi@...hat.com, aliguori@...ibm.com,
jan.kiszka@....de
Subject: Re: [PATCH v3] kvm: make vcpu life cycle separated from kvm instance
2011/12/15 Gleb Natapov <gleb@...hat.com>:
> On Thu, Dec 15, 2011 at 11:21:37AM +0800, Liu ping fan wrote:
>> On Tue, Dec 13, 2011 at 7:36 PM, Marcelo Tosatti <mtosatti@...hat.com> wrote:
>> > On Mon, Dec 12, 2011 at 10:41:23AM +0800, Liu Ping Fan wrote:
>> >> From: Liu Ping Fan <pingfank@...ux.vnet.ibm.com>
>> >>
>> >> Currently, vcpu can be destructed only when kvm instance destroyed.
>> >> Change this to vcpu's destruction taken when its refcnt is zero,
>> >> and then vcpu MUST and CAN be destroyed before kvm's destroy.
>> >>
>> >> Signed-off-by: Liu Ping Fan <pingfank@...ux.vnet.ibm.com>
>> >> ---
>> >> arch/x86/kvm/i8254.c | 10 ++++--
>> >> arch/x86/kvm/i8259.c | 12 +++++--
>> >> arch/x86/kvm/mmu.c | 7 ++--
>> >> arch/x86/kvm/x86.c | 54 +++++++++++++++++++----------------
>> >> include/linux/kvm_host.h | 71 ++++++++++++++++++++++++++++++++++++++++++----
>> >> virt/kvm/irq_comm.c | 7 +++-
>> >> virt/kvm/kvm_main.c | 62 +++++++++++++++++++++++++++++++++------
>> >> 7 files changed, 170 insertions(+), 53 deletions(-)
>> >
>> > This needs a full audit of paths that access vcpus. See for one example
>> > bsp_vcpu pointer.
>> >
>> Yes, I had missed it and just paid attention to the access path to
>> vcpu in kvm_lapic and the path used in async_pf. I will correct it
>> later.
>> BTW, I want to make it sure that because kvm_lapic will be destroyed
>> before vcpu, so it is safe to bypass the access path there, and the
>> situation is the same in async_pf for we have called
>> kvm_clear_async_pf_completion_queue before zapping vcpu. Am I right?
>>
>> As to the scene like bsp_vcpu, I think that introducing refcount like
>> in V2 can handle it easier. Please help to review these changes in V4
>> which I will send a little later.
>>
> Since bsp_vcpu pointer will never be released or re-assigned introducing
> reference count to keep the pointer valid is not necessary. The counter
> will never reach 0 and bsp vcpu will never be freed. Just disallow
OK. And I have a question -- who will play the role to guard bsp_vcpu?
kernel or qemu? Must I add something in kernel to protect the
bsp_vcpu
> removal of bsp_vcpu. Or better get rid of bsp_vcpu at all since its only
> use is invalid anyway.
>
I will dig into it and see how to handle it.
Thanks and regards,
ping fan
> --
> Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists