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 8E620C79F9E for ; Tue, 8 Sep 2026 13:37:34 +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=pmW+XMdarb0AzUa13DRPBo4xWL/hlPBKrfPjbLiiADE=; b=H2YytChcoQMSOJihQJHIHy/9Kc ZhkIQxcu/Ioivo+0w9il8e3o7jKvpYzbbGGCuez5oxfF5V9iU8LwiiqxEW7T9dqo7tTQcZyCDwv6P y5wZM/3QzkFO36KU5TQNv6uguABf1owMLMCijNG+LisAPPZr1Xhr1YjymtO+VZVBMWKFQiSSxgA5u otdyvdSdmy4fap+tPI1qYa56SCD3TounxqzHJ89pkz/R0J4yXV5zSC6jPo7cEAvWWEiUsJcHh/no/ vzHdpH0ioOtwPcoDbI9sVlBTjyi8f9XYOOT76YNcabaj+fugXNTuKd+hIJkW6ctkVu4dRsH0fxEEA akW/vKkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x3vKR-000000094Z9-1JMZ; Tue, 08 Sep 2026 12:53:35 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x3vKQ-000000094Yv-03Dp for linux-arm-kernel@lists.infradead.org; Tue, 08 Sep 2026 12:53:34 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 26568601F7; Tue, 8 Sep 2026 12:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E57781F00A3E; Tue, 8 Sep 2026 12:53:32 +0000 (UTC) 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 1x3vJs-00000006D8h-2A4L; Tue, 08 Sep 2026 12:53:00 +0000 Date: Tue, 08 Sep 2026 13:53:00 +0100 Message-ID: <864ifz52hf.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: Oliver Upton , Will Deacon , Catalin Marinas , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Steffen Eiden , Mark Rutland , Vincent Donnefort , Keir Fraser , Kalesh Singh , Quentin Perret , Hiroyuki Katsura , Fuad Tabba , stable@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/4] KVM: arm64: Fix host access to the EL2 stacks In-Reply-To: <20260908110713.1540304-1-fuad.tabba@linux.dev> References: <20260908110713.1540304-1-fuad.tabba@linux.dev> 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: fuad.tabba@linux.dev, oupton@kernel.org, will@kernel.org, catalin.marinas@arm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, seiden@linux.ibm.com, mark.rutland@arm.com, vdonnefort@google.com, keirf@google.com, kaleshsingh@google.com, qperret@google.com, hk590@cam.ac.uk, tabba@google.com, stable@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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-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 Tue, 08 Sep 2026 12:07:09 +0100, Fuad Tabba wrote: > > Hi folks, > > The per-CPU EL2 stacks are initialised as host-owned after pKVM init. > fix_host_ownership() walks only the linear-map alias of each memblock > region, and the stacks, mapped in the private VA range for their guard > pages, have none. > > Patch 1 is the fix, and it needs none of the other three. Patch 4 adds > the check that would have caught it and would catch similar instances > in the future: once the transfer is done, walk the private VA range and > fail init unless every valid leaf is hyp-owned, or is hyp text mapped > without write access. > > Patch 2 is a fix in its own right, but to a different bug. > fix_host_ownership_walker() matches hyp text on its stage-1 permissions, > and that test hasn't matched on a non-hVHE host since 7.0, so hyp text > is donated there rather than left read-only. Nothing crashes, but the > instruction dump on hyp panic reads a page the host can't access, so > the Code: line comes out as question marks. It matches by physical > address instead, which is what patch 4 needs too. Patch 3 splits the > start of the range from the allocation cursor, with no functional > change, so patch 4 knows where the range begins. Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.