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 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 E91E4C433EF for ; Tue, 14 Dec 2021 14:54:09 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DfYRR7kZ3lHNN+PJr7quCnUfTY5iOkRuFSJETv0BJdY=; b=sF3D72x/fbHw4L YhcN60ZnoAv7INvDCCmZMohWqTpNIctOdrLqhovPgD/52dHvBx01lCcRsoooYwthLOZgxMpNcMQJL kkbJ4eff31uavLtxPg8xOr3z5HyI1Jwr2lCUpHLJRtO3fzAPqC9fSTUeQmAMInIVLd+cLu6pO5d5B UiqbzVUSvhIyfQuUXFnTc+2aeNX09sjRvzxFleujA/BVWmS4v890e/gUR6Z7j2dawRYb7yDaqE4Md T7bBTBCHT1w5/MCMZhz6Gt+LOkdeHqVrIo4vkWRZdyw35VSFy4nCttpPsKsXGqQ88diy0dAdSzE+R Vqe/YNaTLi8OszUXh+/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx9AP-00EWAl-It; Tue, 14 Dec 2021 14:52:33 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx9AL-00EWAF-Jr for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 14:52:30 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E4AE61547; Tue, 14 Dec 2021 14:52:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D3B0C34605; Tue, 14 Dec 2021 14:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639493548; bh=yFfkRGn3Zbbf+escEJ2y5n1s3r/WuEZMooEpjeq9CYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SsnSf7GM5HtnKJuYn9dOkq5YoMNVd8W+nxOoJ/qz9iFIAa941uF9l5n/Ryc2aUCtr klQEkwyZ3TOQmN4iI8EvgK82iJnpzh3WppkGXUGSsurBhGIc7iPgU+Wq0KDRAEplK3 i7fbDFveAiL1lWaKB8Z/zi84imY6ze9oEQ5nUv5DZNfnkOFHvRN1FcN4Yzb/7NQlq3 1RGSM5K2VggUKKBmWvSXsScaPbRDxj6klDGMsYZ6HlUVKRxhWkyHtUcffWcH3pFLAg pXpiwhG1zinyGz4xgwG6yaTo2wbUU2yEALRQDjhvEnlQNEaWSW3pAYYSpj42tq6zQC PkwY9Dkj3HMvw== Date: Tue, 14 Dec 2021 14:52:23 +0000 From: Will Deacon To: Andrew Walbran Cc: Quentin Perret , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3 10/15] KVM: arm64: Introduce wrappers for host and hyp spin lock accessors Message-ID: <20211214145222.GC14837@willie-the-truck> References: <20211201170411.1561936-1-qperret@google.com> <20211201170411.1561936-11-qperret@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211214_065229_712819_8E61EB92 X-CRM114-Status: GOOD ( 14.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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 14, 2021 at 02:48:30PM +0000, Andrew Walbran wrote: > On Wed, 1 Dec 2021 at 17:04, 'Quentin Perret' via kernel-team > wrote: > > > > From: Will Deacon > > > > In preparation for adding additional locked sections for manipulating > > page-tables at EL2, introduce some simple wrappers around the host and > > hypervisor locks so that it's a bit easier to read and bit more difficult > > to take the wrong lock (or even take them in the wrong order). > Looks good, but how does this help prevent taking locks in the wrong order? I just found that I would easily forget what exactly was protected by "pkvm_pgd_lock" and so relating that back to "take host before hyp" was error-prone. Having helpers with "host" and "hyp" in the name helps me with that, at least. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel