KVM: Fix unlikely kvm_create vs decache_vcpus_on_cpu race
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 23 Jul 2007 07:08:21 +0000 (17:08 +1000)
committerAvi Kivity <avi@qumranet.com>
Wed, 25 Jul 2007 11:29:34 +0000 (14:29 +0300)
commit5e58cfe41c7e5902c32bb7f62993d43fb4c48ccf
tree5836d843b325dcea7ba9243f4c9ccb4664ecd255
parentb0fcd903e6f3f47189baddf3fe085bdf78c9644c
KVM: Fix unlikely kvm_create vs decache_vcpus_on_cpu race

We add the kvm to the vm_list before initializing the vcpu mutexes,
which can be mutex_trylock()'ed by decache_vcpus_on_cpu().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm_main.c