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 9ED96C7EE25 for ; Thu, 8 Jun 2023 17:21:43 +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=yv89+9tVLJg4CCM6W92xkOZ8ZZ55AZ8CVOAmzMyV5eQ=; b=IJjCpIeAC6K8GA 8dCyzgG7PkTr2N4Jas9U9pZ7SK667h1OLV3ENDeGvz0vY9x79k8vIZO4qcINChhVqudH53obsPIj6 6p5a5JcKM0ag8u/+tDC6iji9LZ3XXfuUG49pd+3TrbcI+3e3gPw1swAdKme9+bwVKcKd9GpUcnCBf NDDYlgoQpT9pEL3Licy44t4U9PHoHPyCd55omDiBXczWTRA9CrMOCdxu3/u0UZmO4PKn+6gQL0qGl YG5UUU7yjI38ICdUyeOW7rZOG4WSS1eM92nD8PKfdTOhYw2rY5QF1nsmr1yFzwdkwOULEEST9yIU9 eBDY+lLwmr0MNWhzqNwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7JK6-00A1eq-1P; Thu, 08 Jun 2023 17:21:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7JK4-00A1eJ-18 for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2023 17:21:21 +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 4381C64818; Thu, 8 Jun 2023 17:21:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBBADC433EF; Thu, 8 Jun 2023 17:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686244878; bh=+1JMZudb5uniaYe3Y3wFcz2tkfuMGhPDOo6QPhGbJeI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hvsQRNBUpffh2bzrvN4vsPMPOZ/NuzUw6AHwjYs+TmO/+5bq/B1NLn/y9DvjM3vhD qSYXcAB1x479VEs7sJKgWqnpn1IxrjyvRCEHsQpzVJ2wAtqfyTdzWnp2kqDYhndLTF 7lNh5AlZn4b7Gp1kiAVotShPo4PJIvxx5SJexnBt7DGohA6CcKd2HCSbS0Y09VYk6M y5iOpEOFO7lRNIFm9ZNMfqWzNmIBEOylkDaVyxyf5C+GS0RZkmTx2ywWbtBx80IMXu aFRCzIeUuHSohx/8P4St1qor5bg+AYU8lVoMceWtUHz66aZlJ1OC/N/AgBafHJP/j1 +WU4ndAfymBuA== Date: Thu, 8 Jun 2023 18:21:13 +0100 From: Will Deacon To: Oliver Upton Cc: Marc Zyngier , Colton Lewis , kvm@vger.kernel.org, Catalin Marinas , James Morse , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 3/3] KVM: arm64: Skip break phase when we have FEAT_BBM level 2 Message-ID: <20230608172112.GA1606@willie-the-truck> References: <20230602170147.1541355-1-coltonlewis@google.com> <20230602170147.1541355-4-coltonlewis@google.com> <87sfb7octw.wl-maz@kernel.org> 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-20230608_102120_452560_4A5B63C3 X-CRM114-Status: GOOD ( 18.82 ) 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 Mon, Jun 05, 2023 at 02:36:00PM -0700, Oliver Upton wrote: > On Sun, Jun 04, 2023 at 09:23:39AM +0100, Marc Zyngier wrote: > > On Fri, 02 Jun 2023 18:01:47 +0100, Colton Lewis wrote: > > > +static bool stage2_try_make_pte(const struct kvm_pgtable_visit_ctx *ctx, struct kvm_s2_mmu *mmu, kvm_pte_t new) > > > { > > > struct kvm_pgtable_mm_ops *mm_ops = ctx->mm_ops; > > > > > > - WARN_ON(!stage2_pte_is_locked(*ctx->ptep)); > > > + if (!stage2_has_bbm_level2()) > > > + WARN_ON(!stage2_pte_is_locked(*ctx->ptep)); > > > + > > > + if (!stage2_try_set_pte(ctx, new)) > > > + return false; > > > + > > > + if (kvm_pte_table(ctx->old, ctx->level)) > > > + kvm_call_hyp(__kvm_tlb_flush_vmid, mmu); > > > + else if (kvm_pte_valid(ctx->old) && !stage2_pte_perms_equal(ctx->old, new)) > > > + kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, mmu, ctx->addr, ctx->level); > > > > Why a non-shareable invalidation? Nothing in this code captures the > > rationale for it. What if the permission change was a *restriction* of > > the permission? It should absolutely be global, and not local. > > IIRC, Colton was testing largely with permission relaxation, and had > forward progress issues b.c. the stale TLB entry was never invalidated > in response to a permission fault. Would the series at: https://lore.kernel.org/r/5d8e1f752051173d2d1b5c3e14b54eb3506ed3ef.1684892404.git-series.apopple@nvidia.com help with that? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel