From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47976C433EF for ; Wed, 22 Sep 2021 10:57:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0DF93611C0 for ; Wed, 22 Sep 2021 10:57:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0DF93611C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jPOBQcfHwUbwJb0QhBUkHyRIxzPyTSIsjuqyHfj7jb0=; b=Un4VJEb+AFfDelTS3yRbgGEiEF skrOF6/ZIfI7OBvFuBjzZx0a0QpyA9H3x/wLxgQt6uK4omWLr3NHDvNmNllBp124I0I63X/uYUeG3 Gats0ha7uO5A/Gk/HW70X7zgrBygXAqkvIjXa2D6I2LFMCJyTQaSN3ZH6wadI97Zk+WvLCUPdq9OY lCNd2zgA1qUdov/RzQuq48MlHDeyaRB0Fw7d1Xp/jwFHE+dSThP3gQlJzoWRd56Q+HtinRZ1mwDkn 578o+zSlSMl9YV0HIAF3zQ6+wWZzoZzeNeKGnijQS8kilFNUtFOx1/+o9b435DG4WBfLKYrHxDUyB 1/mYvmug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSztZ-0088tg-HY; Wed, 22 Sep 2021 10:54:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSzfT-0082iJ-Ni for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 10:40:01 +0000 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_033959_904560_13967747 X-CRM114-Status: GOOD ( 15.19 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel