Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793628568; b=bmlyx+AcbeZpNeqtTbStRWtbvbWigyYZ0nUYaypkIOI1vrroLdW4wE5zvNW0M3quv+8I x8XwOkWbC9FeT2VfGaj/WFHgCzNyGkwdSJHpKwUWbjflndBgAo4i/nxKSDTHah8vgK1xp ad1auRBQ4FRnXdtGLuVl/HxlTLOltrdEPZ8qYfrqA3M79+8lDOVgFzyLhfiLtjKVUISDd SaA9zgUWLictRhaAzYQubgWGraXhMsF2jfuyJdAg9t59sv6yxrk12tyl4OZpJFwwkXNXJ hBU5HQXjiZzXIAZDshgtgLvho1uXaLxk0BQuK6SLadsi+DgEE38VxkeNejV1w6oIIFA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793628568; h=Received:DKIM-Signature:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To:X-SA-Exim-Mail-From: X-SA-Exim-Scanned; bh=CZoEVf6F8YCU84CWatPj9epyRoPyWPQUR01ARmr0ePM=; b=wqJddrlZFDzjixdMmWukudQvoDfU/62t/7cnKSDpRtmbDmE8P6vd0W14Ook4elFJ1FFc CH4O/EeJ6uR8srEo+kXWUZTPpWpPxOEgU2i60x/aKLqFdkp+NbUAd0BXsfNrcuynY99tS fttGuaMlJaQknf6f1Wl3ZANDuXjmf60XMHODCJJjhI/11c70t1I8a+V3mEZemSC057mUF lJVE09pAY72xffe8J42z9DBzThUZ8jHqU+1wyC7fJ5438QqKLWPaiGn+pWRkVkWVREEeX Q1YMKNSxs45eaKyn0x/6Qzafi4F6qQcIcaZR3MNirDpwUbmCyHfpnSnPhjr8+of2zVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Or6+I7EF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A5B7606A326 for ; Mon, 2 Nov 2026 14:09:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Or6+I7EF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 151A41F00A16; Mon, 2 Nov 2026 14:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793628568; bh=CZoEVf6F8YCU84CWatPj9epyRoPyWPQUR01ARmr0ePM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Or6+I7EFdsKuZBQJXq9kNEm+ElOS/QCA1+vNT24vSXNWQw82ZplS9esCoI1O9PXNO kd5WYCxtllLVTJDuL5gSxeQwg3Js2onA3eTwO0oYF7i9tOxzw+3S3MLbTsfpezUtI+ YVbvQBnacOYM4C9ZkzKhqi+SU3lFHlATPMzBuC7Soq1Tz6BIBUf6xmyQcBIQHY/Xm9 u4fbL33PYo/gpsQwX8/FC4WZ4bEnZI66OwrG2oOH8HvD5Eek3mjOToij/lLQ0invVn d4ZU6gB0NMSwBjzzS70ZDAv3dvL4Q76aFXtgaSdFp93WOZihJlzusgFp2AGcC3cLyh M1H1YU9Mm6aGQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xNsiz-00000009sMz-3ARh; Mon, 02 Nov 2026 14:09:25 +0000 Date: Mon, 02 Nov 2026 14:09:25 +0000 Message-ID: <86fqxj2ulm.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon Cc: Ard Biesheuvel , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Oliver Upton , Fuad Tabba , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH] KVM: arm64: Don't livelock when AT can't resolve a fault IPA In-Reply-To: References: <20261102094748.2638468-2-ardb+git@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: will@kernel.org, ardb+git@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, ardb@kernel.org, oupton@kernel.org, fuad.tabba@linux.dev, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Mon, 02 Nov 2026 13:59:12 +0000, Will Deacon wrote: > > On Mon, Nov 02, 2026 at 10:47:49AM +0100, Ard Biesheuvel wrote: > > From: Ard Biesheuvel [...] > > 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.