|
@@ -2478,13 +2478,12 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
|
|
|
struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
|
|
|
unsigned int id)
|
|
|
{
|
|
|
- int r;
|
|
|
- struct kvm_vcpu *vcpu = kvm_x86_ops->vcpu_create(kvm, id);
|
|
|
+ return kvm_x86_ops->vcpu_create(kvm, id);
|
|
|
+}
|
|
|
|
|
|
- if (IS_ERR(vcpu)) {
|
|
|
- r = -ENOMEM;
|
|
|
- goto fail;
|
|
|
- }
|
|
|
+int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
|
|
|
+{
|
|
|
+ int r;
|
|
|
|
|
|
/* We do fxsave: this must be aligned. */
|
|
|
BUG_ON((unsigned long)&vcpu->host_fx_image & 0xF);
|
|
@@ -2497,11 +2496,10 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
|
|
|
if (r < 0)
|
|
|
goto free_vcpu;
|
|
|
|
|
|
- return vcpu;
|
|
|
+ return 0;
|
|
|
free_vcpu:
|
|
|
kvm_x86_ops->vcpu_free(vcpu);
|
|
|
-fail:
|
|
|
- return ERR_PTR(r);
|
|
|
+ return r;
|
|
|
}
|
|
|
|
|
|
void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
|