Re: [PATCH] qemu-kvm initialize vcpu state after machine initialization

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

 



On Mon, Dec 14, 2009 at 06:36:37PM -0200, Marcelo Tosatti wrote:
> 
> So that the vcpu state is initialized, from vcpu thread context, after 
> machine initialization is settled.
> 
> This allows to revert apic_init's apic_reset call. apic_reset now
> happens through system_reset, similarly to qemu upstream.
> 
This patch essentially revers commit 898c51c3. This commit fixes two
races. First race is like this:

     vcpu0                            vcpu1

   starts running
   loads lapic state into kernel 
   sends event to vcpu1
                                   starts running
                                   loads lapic state into kernel
                                   overwrites event from vcpu0
At the time 898c51c3 was committed the race was easily reproducible
by starting VM with 16 cpus + seabios. Sometimes some vcpus lost INIT/SIPI
events. Now I am not able to reproduce it even with this patch applied,
so something else changed, but it doesn't make the race non existent or
acceptable.

The second race is during machine start after migration. The race is
between event loop and vcpu:

    event loop                         vcpu

  starts running
  gets RTC timer event
  sends interrupt to vcpu
                                    starts running
                                    loads lapic state into kernel
                                    overwrites interrupt from RTC

                                    
In short vcpu state that can be influenced by sources outside vcpu thread
itself should be uploaded into the kernel before signaling qemu_system_ready
condition.

--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux