From: Andrey Smetanin <asmetanin@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
kvm@vger.kernel.org, "Marcelo Tosatti" <mtosatti@redhat.com>,
"Roman Kagan" <rkagan@virtuozzo.com>,
"Denis V. Lunev" <den@openvz.org>,
"Andreas Färber" <afaerber@suse.de>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2 2/5] target-i386/kvm: Hyper-V SynIC MSR's support
Date: Wed, 11 Nov 2015 12:25:12 +0300 [thread overview]
Message-ID: <56430978.4070506@virtuozzo.com> (raw)
In-Reply-To: <5643079E.8010908@redhat.com>
On 11/11/2015 12:17 PM, Paolo Bonzini wrote:
>
>
> On 11/11/2015 10:09, Andrey Smetanin wrote:
>>>
>>> I would prefer to put this in kvm_arch_init_vcpu, if possible.
>>>
>> Ok. I think the kvm_arch_init_vcpu() is called after migration restores
>> cpu->env->msr_hv_synic_* values, so unconditional initialization of
>> cpu->env->msr_hv_synic_* values can overwrite migrated values. The check
>> "if (!env->msr_hv_synic_version) {" is neccessary for first time
>> initialization to protect against such overwriting. This is why this
>> code migrates 'msr_hv_synic_version' value.
>
> No, kvm_arch_init_vcpu is called at the very beginning, when the VCPU
> thread is created.
>
> main
> -> machine_class->init
> -> pc_init1
> -> pc_cpus_init
> -> pc_new_cpu
> -> cpu_x86_create
> -> object_property_set_bool
> -> x86_cpu_realizefn
> -> qemu_init_vcpu
> -> qemu_kvm_start_vcpu
> -> qemu_kvm_cpu_thread_fn (in new thread)
> -> kvm_init_vcpu
> -> kvm_arch_init_vcpu
>
> This is long before qemu_start_incoming_migration, which is among the
> last things done before calling main_loop
In this case I'll remove migration of msr_hv_synic_version and make
first time initialization inside kvm_arch_init_vcpu() - inside section
where SynIC availability cpuid bit is set.
Thank you for clarification.
>
> Paolo
>
next prev parent reply other threads:[~2015-11-11 9:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 12:52 [Qemu-devel] [PATCH v2 0/5] QEMU: Hyper-V SynIC support Andrey Smetanin
2015-11-10 12:52 ` [Qemu-devel] [PATCH v2 1/5] headers: Linux kernel Hyper-V SynIC defines Andrey Smetanin
2015-11-10 12:52 ` [Qemu-devel] [PATCH v2 2/5] target-i386/kvm: Hyper-V SynIC MSR's support Andrey Smetanin
2015-11-10 13:14 ` Paolo Bonzini
2015-11-11 9:09 ` Andrey Smetanin
2015-11-11 9:17 ` Paolo Bonzini
2015-11-11 9:25 ` Andrey Smetanin [this message]
2015-11-11 10:05 ` Paolo Bonzini
2015-11-11 10:18 ` [Qemu-devel] [PATCH v3 " Andrey Smetanin
2015-11-11 11:17 ` Paolo Bonzini
2015-11-10 12:52 ` [Qemu-devel] [PATCH v2 3/5] kvm: Hyper-V SynIC irq routing support Andrey Smetanin
2015-11-10 12:52 ` [Qemu-devel] [PATCH v2 4/5] target-i386/hyperv: Hyper-V SynIC SINT routing and vcpu exit Andrey Smetanin
2015-11-10 12:52 ` [Qemu-devel] [PATCH v2 5/5] hw/misc: Hyper-V test device 'hyperv-testdev' Andrey Smetanin
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=56430978.4070506@virtuozzo.com \
--to=asmetanin@virtuozzo.com \
--cc=afaerber@suse.de \
--cc=den@openvz.org \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkagan@virtuozzo.com \
--cc=rth@twiddle.net \
/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;
as well as URLs for NNTP newsgroup(s).