Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125259
b: refs/heads/master
c: d329c03
h: refs/heads/master
i:
  125257: 5ac0a8b
  125255: 6a9b404
v: v3
  • Loading branch information
Christian Borntraeger authored and Avi Kivity committed Dec 31, 2008
1 parent 9ccac09 commit ec0076c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b7ad61ffb9ca110add6f7fb36cc8a4dd89696a4
refs/heads/master: d329c035e754156ffabcb64ff75d05bb8e2ddbf5
35 changes: 21 additions & 14 deletions trunk/arch/s390/kvm/kvm-s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ struct kvm *kvm_arch_create_vm(void)
debug_register_view(kvm->arch.dbf, &debug_sprintf_view);
VM_EVENT(kvm, 3, "%s", "vm created");

try_module_get(THIS_MODULE);

return kvm;
out_nodbf:
free_page((unsigned long)(kvm->arch.sca));
Expand All @@ -196,13 +194,32 @@ struct kvm *kvm_arch_create_vm(void)
return ERR_PTR(rc);
}

void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
{
VCPU_EVENT(vcpu, 3, "%s", "free cpu");
free_page((unsigned long)(vcpu->arch.sie_block));
kfree(vcpu);
}

static void kvm_free_vcpus(struct kvm *kvm)
{
unsigned int i;

for (i = 0; i < KVM_MAX_VCPUS; ++i) {
if (kvm->vcpus[i]) {
kvm_arch_vcpu_destroy(kvm->vcpus[i]);
kvm->vcpus[i] = NULL;
}
}
}

void kvm_arch_destroy_vm(struct kvm *kvm)
{
debug_unregister(kvm->arch.dbf);
kvm_free_vcpus(kvm);
kvm_free_physmem(kvm);
free_page((unsigned long)(kvm->arch.sca));
debug_unregister(kvm->arch.dbf);
kfree(kvm);
module_put(THIS_MODULE);
}

/* Section: vcpu related */
Expand Down Expand Up @@ -308,23 +325,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu,
vcpu->arch.sie_block);

try_module_get(THIS_MODULE);

return vcpu;
out_free_cpu:
kfree(vcpu);
out_nomem:
return ERR_PTR(rc);
}

void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
{
VCPU_EVENT(vcpu, 3, "%s", "destroy cpu");
free_page((unsigned long)(vcpu->arch.sie_block));
kfree(vcpu);
module_put(THIS_MODULE);
}

int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
{
/* kvm common code refers to this, but never calls it */
Expand Down

0 comments on commit ec0076c

Please sign in to comment.