From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32A3E606A32D for ; Mon, 2 Nov 2026 14:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=eYyIAnX0; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=CZoEVf6F8YCU84CWatPj9epyRoPyWPQUR01ARmr0ePM=; b=eYyIAnX032Ux4HJtBnK09UTCHD e1S2WSO73zQgG8JG3s1lvfOOGoFPCA9ayb+AY41OgwcCE4fnEDM1e4mUlXzzRDzShwOHlnyM+9o2f x84PLmPKDLy9jxCSz6/n+n4PR486JlSfvfkw60opvLNNBWQZG18jvTNcvgZK/DBrqkwo56BUO1sTn LzkSjpVdkB5VwmDYM1GAsElE6oqic4AOV5/NPwAk0rxZjKZ7abtoWaN5FNzbqcVaSROpS8OHfSdw2 /ZRRx97T7eMS7Vh5fuNq7OEBTFOOYWxS3AgDVh/GGiduPMcvBBD1o3vHpS1dJiccgUqE1lzOfUDEl d+XxqdaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xNsj4-0000000Gj7C-0ckk; Mon, 02 Nov 2026 14:09:30 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xNsj2-0000000Gj75-1pDd for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2026 14:09:28 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 354C1421F2; Mon, 2 Nov 2026 14:09:28 +0000 (UTC) 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-Archived-By: 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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.