KVM: VMX: fix memory order between loading vmcs and clearing vmcs
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Wed, 28 Nov 2012 12:54:14 +0000 (20:54 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 29 Nov 2012 23:14:46 +0000 (21:14 -0200)
vmcs->cpu indicates whether it exists on the target cpu, -1 means the vmcs
does not exist on any vcpu

If vcpu load vmcs with vmcs.cpu = -1, it can be directly added to cpu's percpu
list. The list can be corrupted if the cpu prefetch the vmcs's list before
reading vmcs->cpu. Meanwhile, we should remove vmcs from the list before
making vmcs->vcpu == -1 be visible

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

No differences found