Commit 681bcea8 authored by David Hildenbrand's avatar David Hildenbrand Committed by Paolo Bonzini

KVM: svm: inititalize hash table structures directly

The hashtable and guarding spinlock are global data structures,
we can inititalize them statically.
Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Message-Id: <20170124212116.4568-1-david@redhat.com>
Reviewed-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 858e25c0
...@@ -971,8 +971,8 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) ...@@ -971,8 +971,8 @@ static void svm_disable_lbrv(struct vcpu_svm *svm)
* a particular vCPU. * a particular vCPU.
*/ */
#define SVM_VM_DATA_HASH_BITS 8 #define SVM_VM_DATA_HASH_BITS 8
DECLARE_HASHTABLE(svm_vm_data_hash, SVM_VM_DATA_HASH_BITS); static DEFINE_HASHTABLE(svm_vm_data_hash, SVM_VM_DATA_HASH_BITS);
static spinlock_t svm_vm_data_hash_lock; static DEFINE_SPINLOCK(svm_vm_data_hash_lock);
/* Note: /* Note:
* This function is called from IOMMU driver to notify * This function is called from IOMMU driver to notify
...@@ -1077,8 +1077,6 @@ static __init int svm_hardware_setup(void) ...@@ -1077,8 +1077,6 @@ static __init int svm_hardware_setup(void)
} else { } else {
pr_info("AVIC enabled\n"); pr_info("AVIC enabled\n");
hash_init(svm_vm_data_hash);
spin_lock_init(&svm_vm_data_hash_lock);
amd_iommu_register_ga_log_notifier(&avic_ga_log_notifier); amd_iommu_register_ga_log_notifier(&avic_ga_log_notifier);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment