diff options
author | Avi Kivity <avi@qumranet.com> | 2007-10-21 05:00:39 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:55 -0500 |
commit | e00c8cf29b9798eb9918469b0cce1766e0ae40d7 (patch) | |
tree | 2824cf4bfffc96faeda6981a790295c2e4f49690 /drivers/kvm/svm.c | |
parent | 34c16eecf78ed4cf01f39ac7211f5b57942ec899 (diff) |
KVM: Move vmx_vcpu_reset() out of vmx_vcpu_setup()
Split guest reset code out of vmx_vcpu_setup(). Besides being cleaner, this
moves the realmode tss setup (which can sleep) outside vmx_vcpu_setup()
(which is executed with preemption enabled).
[izik: remove unused variable]
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 035c8e6898f1..953c111544e1 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -557,7 +557,7 @@ static void init_vmcb(struct vmcb *vmcb) | |||
557 | /* rdx = ?? */ | 557 | /* rdx = ?? */ |
558 | } | 558 | } |
559 | 559 | ||
560 | static void svm_vcpu_reset(struct kvm_vcpu *vcpu) | 560 | static int svm_vcpu_reset(struct kvm_vcpu *vcpu) |
561 | { | 561 | { |
562 | struct vcpu_svm *svm = to_svm(vcpu); | 562 | struct vcpu_svm *svm = to_svm(vcpu); |
563 | 563 | ||
@@ -568,6 +568,8 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu) | |||
568 | svm->vmcb->save.cs.base = svm->vcpu.sipi_vector << 12; | 568 | svm->vmcb->save.cs.base = svm->vcpu.sipi_vector << 12; |
569 | svm->vmcb->save.cs.selector = svm->vcpu.sipi_vector << 8; | 569 | svm->vmcb->save.cs.selector = svm->vcpu.sipi_vector << 8; |
570 | } | 570 | } |
571 | |||
572 | return 0; | ||
571 | } | 573 | } |
572 | 574 | ||
573 | static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | 575 | static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) |