All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: svm: inititalize hash table structures directly
@ 2017-01-24 21:21 David Hildenbrand
  2017-02-14 15:56 ` Radim Krčmář
  0 siblings, 1 reply; 2+ messages in thread
From: David Hildenbrand @ 2017-01-24 21:21 UTC (permalink / raw)
  To: kvm; +Cc: Joerg Roedel, Paolo Bonzini, rkrcmar, Dmitry Vyukov, david

The hashtable and guarding spinlock are global data structures,
we can inititalize them statically.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: svm: inititalize hash table structures directly
  2017-01-24 21:21 [PATCH] KVM: svm: inititalize hash table structures directly David Hildenbrand
@ 2017-02-14 15:56 ` Radim Krčmář
  0 siblings, 0 replies; 2+ messages in thread
From: Radim Krčmář @ 2017-02-14 15:56 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: kvm, Joerg Roedel, Paolo Bonzini, Dmitry Vyukov

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 <david@redhat.com>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

>  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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-14 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 21:21 [PATCH] KVM: svm: inititalize hash table structures directly David Hildenbrand
2017-02-14 15:56 ` Radim Krčmář

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.