Skip to content

Commit 6f61269

Browse files
committed
KVM: remove kvm_arch_post_init_vm
The only statement in a kvm_arch_post_init_vm implementation can be moved into the x86 kvm_arch_init_vm. Do so and remove all traces from architecture-independent code. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 203a530 commit 6f61269

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

arch/x86/kvm/x86.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -12741,6 +12741,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
1274112741
"does not run without ignore_msrs=1, please report it to [email protected].\n");
1274212742
}
1274312743

12744+
once_init(&kvm->arch.nx_once);
1274412745
return 0;
1274512746

1274612747
out_uninit_mmu:
@@ -12750,12 +12751,6 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
1275012751
return ret;
1275112752
}
1275212753

12753-
int kvm_arch_post_init_vm(struct kvm *kvm)
12754-
{
12755-
once_init(&kvm->arch.nx_once);
12756-
return 0;
12757-
}
12758-
1275912754
static void kvm_unload_vcpu_mmu(struct kvm_vcpu *vcpu)
1276012755
{
1276112756
vcpu_load(vcpu);

include/linux/kvm_host.h

-1
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,6 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
16151615
bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu);
16161616
bool kvm_arch_dy_has_pending_interrupt(struct kvm_vcpu *vcpu);
16171617
bool kvm_arch_vcpu_preempted_in_kernel(struct kvm_vcpu *vcpu);
1618-
int kvm_arch_post_init_vm(struct kvm *kvm);
16191618
void kvm_arch_pre_destroy_vm(struct kvm *kvm);
16201619
void kvm_arch_create_vm_debugfs(struct kvm *kvm);
16211620

virt/kvm/kvm_main.c

-15
Original file line numberDiff line numberDiff line change
@@ -1070,15 +1070,6 @@ static int kvm_create_vm_debugfs(struct kvm *kvm, const char *fdname)
10701070
return ret;
10711071
}
10721072

1073-
/*
1074-
* Called after the VM is otherwise initialized, but just before adding it to
1075-
* the vm_list.
1076-
*/
1077-
int __weak kvm_arch_post_init_vm(struct kvm *kvm)
1078-
{
1079-
return 0;
1080-
}
1081-
10821073
/*
10831074
* Called just after removing the VM from the vm_list, but before doing any
10841075
* other destruction.
@@ -1199,10 +1190,6 @@ static struct kvm *kvm_create_vm(unsigned long type, const char *fdname)
11991190
if (r)
12001191
goto out_err_no_debugfs;
12011192

1202-
r = kvm_arch_post_init_vm(kvm);
1203-
if (r)
1204-
goto out_err;
1205-
12061193
mutex_lock(&kvm_lock);
12071194
list_add(&kvm->vm_list, &vm_list);
12081195
mutex_unlock(&kvm_lock);
@@ -1212,8 +1199,6 @@ static struct kvm *kvm_create_vm(unsigned long type, const char *fdname)
12121199

12131200
return kvm;
12141201

1215-
out_err:
1216-
kvm_destroy_vm_debugfs(kvm);
12171202
out_err_no_debugfs:
12181203
kvm_coalesced_mmio_free(kvm);
12191204
out_no_coalesced_mmio:

0 commit comments

Comments
 (0)