From patchwork Thu Jun 9 12:12:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 12875485 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 2BB01C43334 for ; Thu, 9 Jun 2022 12:23:28 +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=dC+u8vulyftdXMtso/6LEXdKGa0GTs/p2Ac2SGR79U0=; b=h690oHWRQuvvH7 B//6Zx6FrEBPi368l33DQqD1YV8RiPmg1yu2F76ZmuvitTfTU9/7xMNbxKoCnBmDTgVqPaT2Nf6ac xraEeUsMCSjuxXUU7l03ZIjkQd7kawYLEwE8nvLVxehQrpqvOFhaGe3o8EJSCArJVIY137PGp/gin jb/7sMscwWvQZdQ+4l0khA6IFhZcvhSnglfkhPu1eRigVAiKmoF08jRrqsSeI44FAerECLBzZndba afAxbXqdY2bHCrbWvLQ1kGK16/hLJs2kUwygSTgnj8FRmPGMLEK9iS+rjrJkqskiQOJjtp4FCknHM JNsJvHL6+RqmxWpw/J6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzHB2-001hG9-QD; Thu, 09 Jun 2022 12:22:17 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzH1l-001cs6-M7 for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 12:12:43 +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 ams.source.kernel.org (Postfix) with ESMTPS id 3C932B82D50; Thu, 9 Jun 2022 12:12:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FBF6C341C5; Thu, 9 Jun 2022 12:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654776758; bh=LxU7fuaFrS1upsAZVNVrFcaeQoyaqGRLJQVCKcd3y+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5n1sSbwe0oLqa3cOclRUTXArFmRJtXkXrJmqo/VgrWVoAMWqYjuyUgtLp/n5xvLj LrC58s2W2bHB2/ppdYJAcK3JNUUrbvZEsQ02hWlguWN1DJs38289D5YYT7F6hT1rgd oOKSkRfF1QyafkJIS+kha+HDXAEJr7peKooKzkgAqgHrdR/34KO6lzf94bHJeRpTZB N1Shkhh3LxvspdO3qHrTPeWeyH7/k8Qo46Sth/sXo3Ps3fS6WfGyb36HAohVTaangO TP6P3M9DPVUWFBAeCTQJCi//j/S6N8Nw66z0sErntOXFsYKdLFkctcbuTRXW04OQe7 8S5TDjqcf5bzQ== From: Will Deacon To: kvmarm@lists.cs.columbia.edu Cc: Will Deacon , Marc Zyngier , Alexandru Elisei , kernel-team@android.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/6] KVM: arm64: Remove redundant hyp_assert_lock_held() assertions Date: Thu, 9 Jun 2022 13:12:22 +0100 Message-Id: <20220609121223.2551-6-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220609121223.2551-1-will@kernel.org> References: <20220609121223.2551-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_051241_914508_F6370567 X-CRM114-Status: GOOD ( 10.53 ) 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 host_stage2_try() asserts that the KVM host lock is held, so there's no need to duplicate the assertion in its wrappers. Signed-off-by: Will Deacon --- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c index 78edf077fa3b..1e78acf9662e 100644 --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c @@ -314,15 +314,11 @@ static int host_stage2_adjust_range(u64 addr, struct kvm_mem_range *range) int host_stage2_idmap_locked(phys_addr_t addr, u64 size, enum kvm_pgtable_prot prot) { - hyp_assert_lock_held(&host_kvm.lock); - return host_stage2_try(__host_stage2_idmap, addr, addr + size, prot); } int host_stage2_set_owner_locked(phys_addr_t addr, u64 size, u8 owner_id) { - hyp_assert_lock_held(&host_kvm.lock); - return host_stage2_try(kvm_pgtable_stage2_set_owner, &host_kvm.pgt, addr, size, &host_s2_pool, owner_id); }