From: Marc Zyngier <maz@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb+git@google.com>,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
Ard Biesheuvel <ardb@kernel.org>,
Oliver Upton <oupton@kernel.org>,
Fuad Tabba <fuad.tabba@linux.dev>,
Joey Gouly <joey.gouly@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>
Subject: Re: [PATCH] KVM: arm64: Don't livelock when AT can't resolve a fault IPA
Date: Mon, 02 Nov 2026 14:09:25 +0000 [thread overview]
Message-ID: <86fqxj2ulm.wl-maz@kernel.org> (raw)
In-Reply-To: <auiXMN5td-2QlDkd@willie-the-truck>
On Mon, 02 Nov 2026 13:59:12 +0000,
Will Deacon <will@kernel.org> wrote:
>
> On Mon, Nov 02, 2026 at 10:47:49AM +0100, Ard Biesheuvel wrote:
> > From: Ard Biesheuvel <ardb@kernel.org>
[...]
> > diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h
> > index e0c55644224c..4ba61b71d511 100644
> > --- a/arch/arm64/kvm/hyp/include/hyp/switch.h
> > +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h
> > @@ -843,8 +843,21 @@ static inline bool kvm_hyp_handle_cp15_32(struct kvm_vcpu *vcpu, u64 *exit_code)
> > static inline bool kvm_hyp_handle_memory_fault(struct kvm_vcpu *vcpu,
> > u64 *exit_code)
> > {
> > - if (!__populate_fault_info(vcpu))
> > + if (!__populate_fault_info(vcpu)) {
>
> Presumably we need a barrier (DSB?) here, to ensure that the TLBI happens
> after the AT instruction?
>
> > + /*
> > + * The AT couldn't resolve the IPA, typically because its
> > + * stage-1 walk took a stage-2 fault, such as an Access flag
> > + * fault on an aged page-table page. If the guest still has a
> > + * cached translation for the VA, it won't take that fault
> > + * itself, and would replay the same permission fault forever.
> > + * Drop this VMID's TLB entries on this CPU, so that the replay
> > + * walks the page tables and faults with a valid HPFAR_EL2.
> > + */
> > + __tlbi(vmalls12e1);
>
> Can we get away with an ALLE1 here, or do we really need to blow away the
> whole lot?
ALLE1 blows EL1 translations for all VMIDs, while VMALLS12E1 is
localised to this VMID. Feels like the latter is the least invasive
option.
Alternatively, VMALLE1 or even VAE1 should be enough to get rid of the
S1 TLB.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2026-11-02 14:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:47 [PATCH] KVM: arm64: Don't livelock when AT can't resolve a fault IPA Ard Biesheuvel
2026-11-02 12:19 ` Fuad Tabba
2026-11-02 13:59 ` Will Deacon
2026-11-02 14:09 ` Marc Zyngier [this message]
2026-11-02 14:17 ` Will Deacon
2026-11-02 15:57 ` Fuad Tabba
2026-11-02 16:12 ` Ard Biesheuvel
2026-11-02 16:52 ` Marc Zyngier
2026-11-02 18:23 ` Ard Biesheuvel
2026-11-02 18:41 ` Marc Zyngier
2026-11-02 19:49 ` Will Deacon
2026-11-02 19:27 ` Will Deacon
2026-11-02 14:16 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86fqxj2ulm.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.