From: David Hildenbrand Subject: Re: [PATCH] kvm: initialize SVM spinlock Date: Mon, 23 Jan 2017 15:25:09 +0100 Message-ID: References: <20170122090453.88101-1-dvyukov@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, syzkaller@googlegroups.com To: Dmitry Vyukov , joro@8bytes.org, pbonzini@redhat.com, rkrcmar@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdAWOZM (ORCPT ); Mon, 23 Jan 2017 09:25:12 -0500 In-Reply-To: <20170122090453.88101-1-dvyukov@google.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 22.01.2017 um 10:04 schrieb Dmitry Vyukov: > Currently svm_vm_data_hash_lock is left uninitialized. > This causes lockdep warnings. Properly initialize it. > > Signed-off-by: Dmitry Vyukov > Cc: Joerg Roedel > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: kvm@vger.kernel.org > Cc: syzkaller@googlegroups.com > --- > arch/x86/kvm/svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 08a4d3ab3455..b928a9c34987 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -972,7 +972,7 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) > */ > #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_SPINLOCK(svm_vm_data_hash_lock); > > /* Note: > * This function is called from IOMMU driver to notify > We have spin_lock_init(&svm_vm_data_hash_lock); in svm_hardware_setup(). If this isn't called, wouldn't the right fix be to find out why? -- David