On Thu, 2007-07-26 at 19:31 +0300, Avi Kivity wrote: > Avi Kivity wrote: > >> > >> Sure. It can happen with two VMs are running simultaneously. Lets call > >> them VM-a and VM-b. Assume the scenario: VM-a is on CPU-x, gets > >> migrated to CPU-y, and VM-b gets scheduled in on CPU-x. There is a race > >> on CPU-x with the VMCS handling logic between the VM-b process context, > >> and the IPI to execute the __vcpu_clear for VM-a. > >> > > > > A race indeed, good catch. > > > > I think the race is only on the per_cpu(current_vmcs) variable, no? > > The actual vmcs ptr (as loaded by vmptrld) is handled by the processor. > > btw, I think the race is benign. if __vcpu_clear() wins, vcpu_load() > gets to set current_vmcs and all is well. If vcpu_load() wins, > __vcpu_clear() stomps on current_vmcs, but the only effect of that the > next time vcpu_load() is called, it issues an unnecessary vmptrld.
Hmm.. Yes I think you are right. When I first started thinking about this is when I thought we needed to VMCLEAR the current before the VMPTRLD, in which case this would be a real bug. But in light of you setting me straight on that issue, I think this race drops away too. We should probably comment the code just in case current_vmcs gets more complex in the future so it doesn't get lost ;) ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel