From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C013E16132A for ; Fri, 20 Mar 2026 16:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774023662; cv=none; b=gji74EXENjnrlJrQhJB3l+tgeQumQKX8/o9aFoovgfX4zdqzaQqOmZDyLt9cxBytpV9xT96tv8OIM3zKKVpmZwl/c9uK2UHX6gh4hOnEp6msi43FxHUPL6fVcp2qLPmo/wnRbpSRoH9dHIqTjAYP75InTXXkf69nspAdxVN3KwI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774023662; c=relaxed/simple; bh=+ciHTwA8hlwQ9krVflfBU1d5rdERqV3tp1llx+tmXMU=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=R6L6G8bxdEnC2EbJ4mMHBAVX9hZuYStlSHN6fL2xvQyas/5KUjGfSWb0LgA97HHqUsB1Ev2t4ZNyS/4OD0/hfexoPcuRBxhc0v/MkdFV6gekfoGrhIifDCfw0DGYeSWb8Mnz+ZmdEMtJgozOpeZEK+SKzJYjm2vH0Uc4BhU1H20= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tdqC8LUN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tdqC8LUN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D2FEC4CEF7; Fri, 20 Mar 2026 16:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774023662; bh=+ciHTwA8hlwQ9krVflfBU1d5rdERqV3tp1llx+tmXMU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tdqC8LUNyhF65dZO5kd7xU2IJlq5wuXZ1/VYmnrNDo+yrOaFDaEWr9j9A9ProQE+J iMiliTM3Qldme1+AR6VsjSLloUn/Isv0PyDNDvIFci3Gr3i6yeAV3mgvuFOZB47Zku 92SQwK82Z33Mfkyh8gKLra3KUxeI700vYmNBlmKa18LXk9/xfqJCGKcoAlYqdmjZ8I 0eoHlLX6uc5EyGY2mu9zPAZyDpQGDIZERlenevYVpdLbia4dYhFsrCVH76nJHNy4ZT JwVmdwS+dYQVDNgq4JJXh4dkNfQxP93NbiSg4liako32SRi/eiF+ch06KyMAA/X/7P jGBMWax/iNC9g== 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 1w3caq-0000000455R-04zT; Fri, 20 Mar 2026 16:21:00 +0000 Date: Fri, 20 Mar 2026 16:20:59 +0000 Message-ID: <864ima5v6c.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: <20260305144351.17071-26-will@kernel.org> References: <20260305144351.17071-1-will@kernel.org> <20260305144351.17071-26-will@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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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. Thanks, M. -- Without deviation from the norm, progress is not possible.