Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kvm: x86: factor out kvm.arch.hyperv (de)init

Move kvm.arch.hyperv initialization and cleanup to separate functions.

For now only a mutex is inited in the former, and the latter is empty;
more stuff will go in there in a followup patch.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

authored by

Roman Kagan and committed by
Radim Krčmář
cbc0236a 661e50bc

+14 -1
+9
arch/x86/kvm/hyperv.c
··· 1301 1301 kvm_hv_hypercall_set_result(vcpu, ret); 1302 1302 return 1; 1303 1303 } 1304 + 1305 + void kvm_hv_init_vm(struct kvm *kvm) 1306 + { 1307 + mutex_init(&kvm->arch.hyperv.hv_lock); 1308 + } 1309 + 1310 + void kvm_hv_destroy_vm(struct kvm *kvm) 1311 + { 1312 + }
+3
arch/x86/kvm/hyperv.h
··· 88 88 void kvm_hv_setup_tsc_page(struct kvm *kvm, 89 89 struct pvclock_vcpu_time_info *hv_clock); 90 90 91 + void kvm_hv_init_vm(struct kvm *kvm); 92 + void kvm_hv_destroy_vm(struct kvm *kvm); 93 + 91 94 #endif
+2 -1
arch/x86/kvm/x86.c
··· 8447 8447 8448 8448 raw_spin_lock_init(&kvm->arch.tsc_write_lock); 8449 8449 mutex_init(&kvm->arch.apic_map_lock); 8450 - mutex_init(&kvm->arch.hyperv.hv_lock); 8451 8450 spin_lock_init(&kvm->arch.pvclock_gtod_sync_lock); 8452 8451 8453 8452 kvm->arch.kvmclock_offset = -ktime_get_boot_ns(); ··· 8455 8456 INIT_DELAYED_WORK(&kvm->arch.kvmclock_update_work, kvmclock_update_fn); 8456 8457 INIT_DELAYED_WORK(&kvm->arch.kvmclock_sync_work, kvmclock_sync_fn); 8457 8458 8459 + kvm_hv_init_vm(kvm); 8458 8460 kvm_page_track_init(kvm); 8459 8461 kvm_mmu_init_vm(kvm); 8460 8462 ··· 8586 8586 kvfree(rcu_dereference_check(kvm->arch.apic_map, 1)); 8587 8587 kvm_mmu_uninit_vm(kvm); 8588 8588 kvm_page_track_cleanup(kvm); 8589 + kvm_hv_destroy_vm(kvm); 8589 8590 } 8590 8591 8591 8592 void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,