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 194471094462 for ; Sat, 21 Mar 2026 09:39:25 +0000 (UTC) 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-Owner; bh=axv3BgBRbqvyaJt7PEeuj4WrzEzWKVKYZXG8EooCNSg=; b=teqJKx1z4vw2pJUyav+QAjLd3l wTEaOPNfGafKZAgJa+lDN6baK247kTMSNglk4YeJqSUGyXAYrBq9DdquxEW1Ho/RelFc4uY1Xe6ln nFd4xshI+nc41r0H/MjYJFkiuzCx1yWu6D1oEq4VXTaH7KGeiGhe8T+8HHv9McOX3ZQuNHkioOH6r CG0tvfzpfGm1rDmv8jQGVaCsKJAVupO269AF18WJQNrZxHHuj/qgiuUrNcvhU1BNFggNrJgqwL2S/ En7AyN7i3Cwb7mQXwfg2iJn66rQyVEO7JFN7PtA8RjmaYaZrrqBCClMQrryDhALdOGwvela+vQAMU 8wnqCnIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w3snh-0000000EJXt-0lPs; Sat, 21 Mar 2026 09:39:21 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w3sne-0000000EJXT-0akw for linux-arm-kernel@lists.infradead.org; Sat, 21 Mar 2026 09:39:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id AE7C14407B; Sat, 21 Mar 2026 09:39:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83A26C19421; Sat, 21 Mar 2026 09:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774085956; bh=YleNNae8eogG4HxU4906z9SPmXMwZWM8S1qJzHGepA8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LQeaQ+0jp33hxuGxNMh6vzDgUd2h4ZPsdKCn5JaL/YAprQkReWi0J0MHPMqssSxe9 pscKJQ85gLhvKZSBqBi41l4RI36t2SoSEmluF120xAyv5coxyR07/4UrYIg/L26Uxj qJOlCDF0LZDE729AQd6xJeqeJO6MMFMFowDmvUK1TMKZCv+l5FoAONYxgQHI2/i+5P p5hoz6EUXRRwZXCZ2bgfSy1zH5pJ8JzWUoiUY38ulrBlJO38RAFNY3UEhIpfdpd22O w/8UXAF3/ABbUk/iCdgSRV2CC1WdZtuamh8jfYWl3wzBVRhwg5lY/ojftoidhVqWQk sVwkafbFuGpiw== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-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 1w3sna-00000004HLO-0QZd; Sat, 21 Mar 2026 09:39:14 +0000 Date: Sat, 21 Mar 2026 09:39:13 +0000 Message-ID: <87fr5tcyim.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Quentin Perret , Fuad Tabba , Vincent Donnefort , Mostafa Saleh , Alexandru Elisei Subject: Re: [PATCH v3 25/36] KVM: arm64: Reclaim faulting page from pKVM in spurious fault handler In-Reply-To: <864ima5v6c.wl-maz@kernel.org> References: <20260305144351.17071-1-will@kernel.org> <20260305144351.17071-26-will@kernel.org> <864ima5v6c.wl-maz@kernel.org> 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) 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, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, qperret@google.com, tabba@google.com, vdonnefort@google.com, smostafa@google.com, alexandru.elisei@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260321_023918_224712_5B2ED40D X-CRM114-Status: GOOD ( 24.45 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 20 Mar 2026 16:20:59 +0000, Marc Zyngier wrote: > > On Thu, 05 Mar 2026 14:43:38 +0000, > Will Deacon wrote: > > > > Host kernel accesses to pages that are inaccessible at stage-2 result in > > the injection of a translation fault, which is fatal unless an exception > > table fixup is registered for the faulting PC (e.g. for user access > > routines). This is undesirable, since a get_user_pages() call could be > > used to obtain a reference to a donated page and then a subsequent > > access via a kernel mapping would lead to a panic(). > > > > Rework the spurious fault handler so that stage-2 faults injected back > > into the host result in the target page being forcefully reclaimed when > > no exception table fixup handler is registered. > > Is there any reason why you prefer the 'inject fault' followed by > 'gimme that page' dance over a more direct 'unconditionally reclaim > the page on the back of the fault'? > > I can't figure out what would go wrong in the latter approach, as you > always have an opportunity to inject a (fatal) fault if you can't > safely reclaim the page. To be clear, the reason I'm asking this is that with RME (whether that's with the dreaded CCA or something else), injecting a fault into the host would involve EL3, and I don't trust EL3 to do that. There is also the small detail that the fault syndrome is not strictly architectural, meaning that EL3 would have to learn a pKVM-specific behaviour. But EL3 should be able to report a GPC fault to RL-EL2, which then could act the exact same way as pKVM, unmapping, clearing and releasing the page. Thoughts? M. -- Jazz isn't dead. It just smells funny.