[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230608172112.GA1606@willie-the-truck>
Date: Thu, 8 Jun 2023 18:21:13 +0100
From: Will Deacon <will@...nel.org>
To: Oliver Upton <oliver.upton@...ux.dev>
Cc: Marc Zyngier <maz@...nel.org>,
Colton Lewis <coltonlewis@...gle.com>, kvm@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
James Morse <james.morse@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Zenghui Yu <yuzenghui@...wei.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kvmarm@...ts.linux.dev
Subject: Re: [PATCH 3/3] KVM: arm64: Skip break phase when we have FEAT_BBM
level 2
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 <coltonlewis@...gle.com> 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
Powered by blists - more mailing lists