From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: svm: inititalize hash table structures directly Date: Tue, 14 Feb 2017 16:56:56 +0100 Message-ID: <20170214155655.GA8156@potion> References: <20170124212116.4568-1-david@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, Joerg Roedel , Paolo Bonzini , Dmitry Vyukov To: David Hildenbrand Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48374 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbdBNP5A (ORCPT ); Tue, 14 Feb 2017 10:57:00 -0500 Content-Disposition: inline In-Reply-To: <20170124212116.4568-1-david@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-01-24 22:21+0100, David Hildenbrand: > The hashtable and guarding spinlock are global data structures, > we can inititalize them statically. > > Signed-off-by: David Hildenbrand > --- Reviewed-by: Radim Krčmář > arch/x86/kvm/svm.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 08a4d3a..222b3be 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -971,8 +971,8 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) > * a particular vCPU. > */ > #define SVM_VM_DATA_HASH_BITS 8 > -DECLARE_HASHTABLE(svm_vm_data_hash, SVM_VM_DATA_HASH_BITS); > -static spinlock_t svm_vm_data_hash_lock; > +static DEFINE_HASHTABLE(svm_vm_data_hash, SVM_VM_DATA_HASH_BITS); > +static DEFINE_SPINLOCK(svm_vm_data_hash_lock); > > /* Note: > * This function is called from IOMMU driver to notify > @@ -1077,8 +1077,6 @@ static __init int svm_hardware_setup(void) > } else { > 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); > } > } > -- > 2.9.3 >