All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG/RFC] INIT IPI lost when VM starts
@ 2017-03-20 14:21 ` Herongguang (Stephen)
  0 siblings, 0 replies; 12+ messages in thread
From: Herongguang (Stephen) @ 2017-03-20 14:21 UTC (permalink / raw)
  To: Paolo Bonzini, rkrcmar, afaerber, jan.kiszka, qemu-devel, kvm,
	wangxinxin.wang,
	weidong.huang@huawei.com >> Huangweidong (C)

Hi,
We encountered a problem that when a domain starts, seabios failed to online a vCPU.

After investigation, we found that the reason is in kvm-kmod, KVM_APIC_INIT bit in
vcpu->arch.apic->pending_events was overwritten by qemu, and thus an INIT IPI sent
to AP was lost. Qemu does this since libvirtd sends a ‘query-cpus’ qmp command to qemu
on VM start.

In qemu, qmp_query_cpus-> cpu_synchronize_state-> kvm_cpu_synchronize_state->
do_kvm_cpu_synchronize_state, qemu gets registers/vcpu_events from kvm-kmod and
sets cpu->kvm_vcpu_dirty to true, and vcpu thread in qemu will call
kvm_arch_put_registers if cpu->kvm_vcpu_dirty is true, thus pending_events is
overwritten by qemu.

I think there is no need for qemu to set cpu->kvm_vcpu_dirty to true after ‘query-cpus’,
and  kvm-kmod should not clear KVM_APIC_INIT unconditionally. And I am not sure whether
it is OK for qemu to set cpu->kvm_vcpu_dirty in do_kvm_cpu_synchronize_state in each caller.

What’s your opinion?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-11-23 15:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 14:21 [BUG/RFC] INIT IPI lost when VM starts Herongguang (Stephen)
2017-03-20 14:21 ` [Qemu-devel] " Herongguang (Stephen)
2017-03-21  3:34 ` Herongguang (Stephen)
2017-03-21  3:34   ` [Qemu-devel] " Herongguang (Stephen)
2017-04-05 16:16 ` Paolo Bonzini
2017-04-05 16:16   ` [Qemu-devel] " Paolo Bonzini
2017-04-06  1:47   ` Herongguang (Stephen)
2017-04-06  1:47     ` [Qemu-devel] " Herongguang (Stephen)
2017-11-20  6:57     ` Gonglei (Arei)
2017-11-20  6:57       ` [Qemu-devel] " Gonglei (Arei)
2017-11-23 15:41       ` rkrcmar
2017-11-23 15:41         ` [Qemu-devel] " rkrcmar

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.