From patchwork Sun Jan 22 09:04:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Vyukov X-Patchwork-Id: 9530861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22D4760431 for ; Sun, 22 Jan 2017 09:05:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 128EE26E98 for ; Sun, 22 Jan 2017 09:05:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06F352836D; Sun, 22 Jan 2017 09:05:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF413280DE for ; Sun, 22 Jan 2017 09:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbdAVJFB (ORCPT ); Sun, 22 Jan 2017 04:05:01 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37893 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbdAVJE7 (ORCPT ); Sun, 22 Jan 2017 04:04:59 -0500 Received: by mail-wm0-f51.google.com with SMTP id r144so108744461wme.1 for ; Sun, 22 Jan 2017 01:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dnW4kc/7AbbGF/37DPVRg2igy1OEZQf839A9EfkMSOc=; b=HOaEaV7n/fvB6maKVX52XCUtzkdJXVwMXlRjM56l5bS3+UYf5F+Ch2exPdaUqbxuJM Jnet0nZk/m9I+pLYV17815r/TwOTHsWUeXZdCgveDswqerO75LZLa6gXGn//KrWGtOpe n9PGgrYp8JQwa+SpuQ4o6v/ISilSlXiqW0lw7Ne5go/yssuB59dAd1LdGERTgd5z3BnR LBCLFQsA4EJKeHfiA5B+VOKHKfw8fEEVtOg8U8iBWCmvKJonYZMkW+gt6x8lA22WNy6T Y8+HxfLcdvcwI0+qaNGW8kfYlRte0cM4pr0NNjF3Xp6jiVcBbmIIRCVzfKqCZJu37Fwx 96SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dnW4kc/7AbbGF/37DPVRg2igy1OEZQf839A9EfkMSOc=; b=M+UzlYfgMN79Cd4SMZmtURO8KeqrHyH/rRjDirljskUbR0A6mDIq4rctacocC2AMjV d6iGaop18kkcNDqer+2DysQvZPoQf2KuknH6Zj7V9rm1azaxEVysFfepnO1ecXK59x+b 0LMCUD0Ii/LjDJ22I/umJGlh/iVyrLF3vPQn4SyS+t4axyesgdyaeScGsSat9r1FWqrB +wQWXfJYblmrcIeLa/npu8JfPZOmlpEvq82pQUSCJ6xemW4JXYN4QaLMTXYl5pKFCJHr TeXoBHqYBtNOnbgicOc8ETofy2FSvyHKjsvOFKQB+P53el9+avLydhdUPh5GlNWt7eNZ XXDQ== X-Gm-Message-State: AIkVDXJsWtzdztqgfjTahQe2uFACdKNvJ9BjSYQOAqHkRa8fF/YLhkUiEP3VqvRwBkI1iz4x X-Received: by 10.223.148.35 with SMTP id 32mr22100630wrq.18.1485075898004; Sun, 22 Jan 2017 01:04:58 -0800 (PST) Received: from dvyukov-z840.muc.corp.google.com ([100.105.28.62]) by smtp.gmail.com with ESMTPSA id y30sm8433623wrc.23.2017.01.22.01.04.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 01:04:57 -0800 (PST) Received: by dvyukov-z840.muc.corp.google.com (Postfix, from userid 129372) id 6BC35E12CA; Sun, 22 Jan 2017 10:04:55 +0100 (CET) From: Dmitry Vyukov To: joro@8bytes.org, pbonzini@redhat.com, rkrcmar@redhat.com Cc: Dmitry Vyukov , kvm@vger.kernel.org, syzkaller@googlegroups.com Subject: [PATCH] kvm: initialize SVM spinlock Date: Sun, 22 Jan 2017 10:04:53 +0100 Message-Id: <20170122090453.88101-1-dvyukov@google.com> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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