qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/5] target-i386/kvm: Hyper-V SynIC MSR's sup


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 2/5] target-i386/kvm: Hyper-V SynIC MSR's support
Date: Wed, 11 Nov 2015 10:17:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


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

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]