Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp348607pxb; Wed, 22 Sep 2021 03:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ1oa2+E69Mylw4HoO3bIDhcsGBjle7aMiaysW+t71z8RcUvW+qfDQVfGURwDUfjBvJDr6 X-Received: by 2002:a05:6e02:1a67:: with SMTP id w7mr24484252ilv.24.1632307346618; Wed, 22 Sep 2021 03:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632307346; cv=none; d=google.com; s=arc-20160816; b=H5RYkbJQ7JHaDxodVw+UOGLKvILjz01XbaPgyhJQVMP2JD5ypzeL/Ub8MaNnpHhjws vi2SQ8clSXDNfEOwE+T9wk2CvR/ymjbUUQVdRUx5YEIhLkBqVRjG4baXjn1XKqTyzIHN gRxPF6mFph5nRZ5GY8Pv7zk5W+m+SAwPxg5WuvuU8LYxpUmYcvyNNG4hVckR0WH25OO/ jGiOnpe4cdcsypim1qK0/N8QuHvbxdp6SOp25yTtZbV9VKn8BagfvOjhiG/xwVcf8nal zGCuO0d+bLC0LRbTs90I8f6b1jNZoWf5xcYlnzd1OtHWFgxZgFGUzP6J/nFCWr4IGeKj ByeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=UE/koVz8V7MxN4P5s3cC6/yI2wyQ1sCjIYtTXBncuJs=; b=auv/ZeVVvOUDLhU4AGDjsnpKjlWqpMYvyCM4UO8Fnz09y4sZyNg7VYJWOQ01cjeI+s VVWsfSMmTNlGXXRTXGa4MrwtW7lfnzFH8/8E2EPqoxfKy5JTFiNRsc2Og1k4CSXYjN7E hsMaAAYTTp+ztV7Akj8Rb82da+3MR2VAsy8oOJcIQYVISWvLGGvLS29dZ7b8Cy4ss6e9 6hSNwFY5YH+ErdoDCdkUlyRWjxlW3t1pSkj5lPXyxuDxb+8aUhD35SQ22H4Vd+bcOCLt UqAtKOTfS1LufY2wsJp6Rwbvza3w0vuqjlmuJdOI5jBWdYJZP1YCmAbR3gZ71RTuY+hZ l9nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si2151784jar.110.2021.09.22.03.42.15; Wed, 22 Sep 2021 03:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235256AbhIVKmD (ORCPT + 99 others); Wed, 22 Sep 2021 06:42:03 -0400 Received: from foss.arm.com ([217.140.110.172]:46708 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235260AbhIVKl0 (ORCPT ); Wed, 22 Sep 2021 06:41:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BAF1311B3; Wed, 22 Sep 2021 03:39:56 -0700 (PDT) Received: from [10.57.95.67] (unknown [10.57.95.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F9063F719; Wed, 22 Sep 2021 03:39:55 -0700 (PDT) Subject: Re: [RFC PATCH v4 01/39] KVM: arm64: Make lock_all_vcpus() available to the rest of KVM To: Alexandru Elisei , maz@kernel.org, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, linux-kernel@vger.kernel.org References: <20210825161815.266051-1-alexandru.elisei@arm.com> <20210825161815.266051-2-alexandru.elisei@arm.com> From: Suzuki K Poulose Message-ID: Date: Wed, 22 Sep 2021 11:39:54 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210825161815.266051-2-alexandru.elisei@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/08/2021 17:17, Alexandru Elisei wrote: > The VGIC code uses the lock_all_vcpus() function to make sure no VCPUs are > run while it fiddles with the global VGIC state. Move the declaration of > lock_all_vcpus() and the corresponding unlock function into asm/kvm_host.h > where it can be reused by other parts of KVM/arm64 and rename the functions > to kvm_{lock,unlock}_all_vcpus() to make them more generic. > > Because the scope of the code potentially using the functions has > increased, add a lockdep check that the kvm->lock is held by the caller. > Holding the lock is necessary because otherwise userspace would be able to > create new VCPUs and run them while the existing VCPUs are locked. > > No functional change intended. > > Signed-off-by: Alexandru Elisei LGTM, Reviewed-by: Suzuki K Poulose