From patchwork Thu May 18 10:09:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 13246433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7A35C7EE23 for ; Thu, 18 May 2023 10:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V71PeGEMLAtdK7wUJcRoCEexwC3gm+/u8R56TObQN1k=; b=eF6XFY0aQKa6r3 RP2pk4POLIOe1e3T58UP8RaG8CpodwiiFHFnzRefGM39cZga/dPVTgCa1qNs3REqqbLqj5tnN2SwT ivlM9PuCkFd508MPe0D/uETg5pfzHL+V4WyLanxzAL7jyuLyDzp5R4RBhT1HQZjlC+RcuxOPEUtRV ErCKCcxTpqVW6Nmso0q4lDpJYtP/vM6FWj63+uvMMvfBUUBuPV/gd7XR9OLC/vdNwodPpVq+gjCvL 6YvcFSQA/o/APn6peWbvI2lCWaiKD4rHKXtej5eGtLJM0F78BGcbifDKmUH7gbajf/cGXZtzn/TKS kOUHqApltu+vxFHj+cmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzb6T-00Cbdo-2E; Thu, 18 May 2023 10:43:25 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzb6Q-00CbbD-2D for linux-arm-kernel@lists.infradead.org; Thu, 18 May 2023 10:43:24 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f41d087b24so13037925e9.1 for ; Thu, 18 May 2023 03:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684406600; x=1686998600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sIOLMvBU8l6RE5ODSm65W2zRH+B2CDJfYYoC+8i5LwQ=; b=m+Jv0HHdp4unaRjWpY/Lf8GJaa50QCjfQEZtRQZWeS/nA6asge9VCeKu6voHDMbags TYTQRhQBnI4qMztOxua3nXHgECh7lVLoxtiVULtazvA/jb6vUzGJDIIH0U6eJWpNWJUr 837h9erdCxCUJe69D4mlSUNed17JuuwYKFlEGNjS6+iAWPpmr+e/PA5vh+kTD1O5rC6h AFfkIdujUokeJP0tSeHl8zOd1OXmCvhch9y+2OmBBnev5IB4OmpmQKvoEJA2JxYXQplc Qyxs+6Yj/sCJ3Vadimhn5hfMjoL+s0nym5qf42vLjlEGoN9x98Rqa3AV3Y3ieCSnZ37m 4obg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684406600; x=1686998600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sIOLMvBU8l6RE5ODSm65W2zRH+B2CDJfYYoC+8i5LwQ=; b=X6wm/VymYqx37VePT1kNGa7ZWG/hbxQoCs4SELZDQ3UV8u+6Ht5n6uobLeekwWEpI1 CkyRfHyW/Nh87XFepIh0dPS52qzQFToR+6V15BNI1rJcIyYYNnkI9vpqgYf8JDKE9Xd9 Ouwv5G88nQKWxaqx044xbZjsqJ5va/bHmT5/Na2k8Gw3y/IxRfDXymBeMP1RZLJi87rV USgSCeE172ggO79byC9ABV47NPkfpEpP3lIOl+jOya9NlKUt5RTqisgI8daw9BlA6dwM qZ6YCK2RV3vnCVtJgVszSuHTV9M5U/WPP4gU1s9iUpht8h/QyD7psWjIdSdQm2iescnA k7Gw== X-Gm-Message-State: AC+VfDymE7kS/6afhRfHUGvbaVOlCVvFFiWEkUTzcMScbrxP3LLmz8CA TQMmQ6FBHw1cofeYwxptCGujTA== X-Google-Smtp-Source: ACHHUZ7OKBt45+2Zkcx84mVW2RHOklZaJvAvHo8vjc+C6OjjzBMyd5t0EoNV1ByX2NDFF6P6Lb44Dg== X-Received: by 2002:a05:600c:290a:b0:3f0:b1c9:25d4 with SMTP id i10-20020a05600c290a00b003f0b1c925d4mr1104993wmd.21.1684406600409; Thu, 18 May 2023 03:43:20 -0700 (PDT) Received: from localhost.localdomain (5750a5b3.skybroadband.com. [87.80.165.179]) by smtp.gmail.com with ESMTPSA id f6-20020a1c6a06000000b003f427cba193sm4880523wmc.41.2023.05.18.03.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 03:43:20 -0700 (PDT) From: Jean-Philippe Brucker To: oliver.upton@linux.dev, maz@kernel.org Cc: james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Jean-Philippe Brucker Subject: [PATCH 3/4] KVM: arm64: vgic: Fix locking comment Date: Thu, 18 May 2023 11:09:17 +0100 Message-Id: <20230518100914.2837292-4-jean-philippe@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230518100914.2837292-1-jean-philippe@linaro.org> References: <20230518100914.2837292-1-jean-philippe@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_034322_731313_96A8258A X-CRM114-Status: GOOD ( 11.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It is now config_lock that must be held, not kvm lock. Replace the comment with a lockdep annotation. Fixes: f00327731131 ("KVM: arm64: Use config_lock to protect vgic state") Signed-off-by: Jean-Philippe Brucker --- arch/arm64/kvm/vgic/vgic-v4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c index 3bb0034780605..c1c28fe680ba3 100644 --- a/arch/arm64/kvm/vgic/vgic-v4.c +++ b/arch/arm64/kvm/vgic/vgic-v4.c @@ -184,13 +184,14 @@ static void vgic_v4_disable_vsgis(struct kvm_vcpu *vcpu) } } -/* Must be called with the kvm lock held */ void vgic_v4_configure_vsgis(struct kvm *kvm) { struct vgic_dist *dist = &kvm->arch.vgic; struct kvm_vcpu *vcpu; unsigned long i; + lockdep_assert_held(&kvm->arch.config_lock); + kvm_arm_halt_guest(kvm); kvm_for_each_vcpu(i, vcpu, kvm) {