Received: by 10.213.65.68 with SMTP id h4csp816027imn; Wed, 28 Mar 2018 13:21:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+175Uw3Sg7VzRoZ6i9KlyjKzD7giqxSf0ZvOU55rx2ozOV6y4NNYTW28NTahDmW1e1kut7 X-Received: by 10.101.80.205 with SMTP id s13mr3433952pgp.285.1522268463011; Wed, 28 Mar 2018 13:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522268462; cv=none; d=google.com; s=arc-20160816; b=zqXdZ5H1iTZnH182fT8Zmvy8XmKAh9JJkx9I9zN9Irl6rLzLXA9mggrZviuir/xfQA 0fo+5/llvl/PksPENrTKILUREQAVd1NOwDZyI3qZX2sMlplr42YR0oH22DVPNlEaWoRF csYNUjZvEwPudHdH1Q0bKTcTfp47U+GHKpOjJCNvYkN8FamgtrF1vH8YH49KOjQIRZKH wB/m0jOc+bN8/pRIVUia0cesp57kGPlUbDDbgyjkEAFMa9da4BnLAISOug6223/sAFlX ONhKzN6nR8xV7Dpu6XEmc96y3hYmCYxegRPVYyOidNqw5RVCAX6S7exiQpeKvH1dy/Ru E7lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=9NbSajE0fa9rsAnAhbH0IVtjVKNt/IlSqLzpjzStdbc=; b=tLWLHcobL0dPCwq0j2IxfvgPNUUOHhW4LDi5kZ8qaF+tmYNAqGQYo4BbEH6cKI3M8U 1RTYZGtDqBzXD677tn+QM1FyNPEuPqQzx5Iv6vjg3RQgr5tqTzqhdI7+EgODDvlFakKS ZfouV7C2Ri3vnVWT/zwM0Ks9Sjvsj2C2+WnCtN4cNhl0B/dlbyxYoDwzqW/7Pbn3BFs4 Yr88LYy4VFy1Iu5B8mrclYYp4jLfkTMNH4G/kQlfbY3hS6PHRsoWH3vacwFpcybtF6pa qRD78mBveW4Uha/Aht9WDB3kaHwisPzaUyZfEglYKwboGGdshQanr3411VaixfsexFCN NMZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w66si3278060pfb.198.2018.03.28.13.20.48; Wed, 28 Mar 2018 13:21:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753024AbeC1UTK (ORCPT + 99 others); Wed, 28 Mar 2018 16:19:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48502 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752447AbeC1UTI (ORCPT ); Wed, 28 Mar 2018 16:19:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23B53406802E; Wed, 28 Mar 2018 20:19:08 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 3F87310B2B26; Wed, 28 Mar 2018 20:19:06 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Wed, 28 Mar 2018 22:19:05 +0200 Date: Wed, 28 Mar 2018 22:19:05 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Davidlohr Bueso Subject: Re: [PATCH 1/2] KVM: X86: Fix setup the virt_spin_lock_key before static key get initialized Message-ID: <20180328201905.GF26753@flask> References: <1521951444-5087-1-git-send-email-wanpengli@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1521951444-5087-1-git-send-email-wanpengli@tencent.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 28 Mar 2018 20:19:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 28 Mar 2018 20:19:08 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-24 21:17-0700, Wanpeng Li: > From: Wanpeng Li > > static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init() > WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:161 static_key_disable_cpuslocked+0x61/0x80 > RIP: 0010:static_key_disable_cpuslocked+0x61/0x80 > Call Trace: > static_key_disable+0x16/0x20 > start_kernel+0x192/0x4b3 > secondary_startup_64+0xa5/0xb0 > > Qspinlock will be choosed when dedicated pCPUs are available, however, the > static virt_spin_lock_key is set in kvm_spinlock_init() before jump_label_init() > has been called, which will result in a WARN(). This patch fixes it by delaying > the virt_spin_lock_key setup to .smp_prepare_cpus(). > > Reported-by: Davidlohr Bueso > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Davidlohr Bueso > Signed-off-by: Wanpeng Li > --- Queued, thanks.