diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-20 08:30:24 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:09 -0500 |
commit | 26e5215fdc6cf7b5a8b1269134095abbb7338b3c (patch) | |
tree | d5a326a910996549827a11beb3af1c60f1f1cf3c /drivers/kvm/kvm_main.c | |
parent | 0de10343b3ca7aa34dd606145748f73ed19f627e (diff) |
KVM: Split vcpu creation to avoid vcpu_load() before preemption setup
Split kvm_arch_vcpu_create() into kvm_arch_vcpu_create() and
kvm_arch_vcpu_setup(), enabling preemption notification between the two.
This mean that we can now do vcpu_load() within kvm_arch_vcpu_setup().
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 9dd6ad3c6c7b..7939b5c9a4b4 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -769,6 +769,10 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int n) | |||
769 | 769 | ||
770 | preempt_notifier_init(&vcpu->preempt_notifier, &kvm_preempt_ops); | 770 | preempt_notifier_init(&vcpu->preempt_notifier, &kvm_preempt_ops); |
771 | 771 | ||
772 | r = kvm_arch_vcpu_setup(vcpu); | ||
773 | if (r) | ||
774 | goto vcpu_destroy; | ||
775 | |||
772 | mutex_lock(&kvm->lock); | 776 | mutex_lock(&kvm->lock); |
773 | if (kvm->vcpus[n]) { | 777 | if (kvm->vcpus[n]) { |
774 | r = -EEXIST; | 778 | r = -EEXIST; |