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 08D10D41C06 for ; Thu, 11 Dec 2025 14:31:04 +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=ZdgVugAk4LjEbZD9p82Y5BLqM+MF+Zlb43vL9F3vX6c=; b=OSOzDzWqQDWYvJGk/3M3d7COXg PUds73tCB7Px19xn0sEOnwqSf9Ko2myD+DqmBVKCHuzDleWfAek1u5sllcw19Qasii4j2kcFc6nDF PfFfPP7wTyCmoGpuPruKBQiT3MmW/FGP/Qyv0zCkOe9gpTHKFsFHhsok1JOtnuPTR6aJg9ks0xuHx mYH3HU9FIqfF3f1wVEeNKvYSagUh2UySDcBjEgpQNT5dKsu6F7+oUCLRS49yUudgzUtv1iYeyOWt4 oSUErFT3a7Go//wogDnlpiVn+FB1gibva+2J9r6ytzLnpFXQJs/0WWQOv+6NwfczPZot0VopFGQfF VNENrdVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vThh5-0000000Gj7i-0Rxb; Thu, 11 Dec 2025 14:30:59 +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 1vThh2-0000000Gj7A-2ATI for linux-arm-kernel@lists.infradead.org; Thu, 11 Dec 2025 14:30:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 1B27B4345A; Thu, 11 Dec 2025 14:30:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7A93C4CEF7; Thu, 11 Dec 2025 14:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765463456; bh=4XrbaxjUbL2DYRiS5YvFYiLwpypPxRsxDxeb2gTntoI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fRTx8ByO++BzI32CtLFa2G61ueIh7JMPfUuzT3VyIt38+H98w+1ELDkcMNhvkDxFo 0S1zAsL89YlhFsVO7yUZyyiKj1RMi3ynJ8I4PeUUljBAGml04An5lmlfefynOzo3+q 3jdHo2rdGAwJa7eX59R55YpR0PQ7ClCv86YDlURjizCS65kWn8hqGZwz36aoKlTEK/ /NY4HyeNxD/ULq3vvFIebe2td0q+FXZilXdwgBfRowiF8Xq8MV4wEnTHH/Pzuozch4 Kflj+DkllpTfERJbfb8QPxkhiup/p7A/GJYXmWO2HnFZkVfHwKsoTBM+/OBftR+QDT MTyU+ZttIrsIA== 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 1vThgz-0000000C1Rg-2FKf; Thu, 11 Dec 2025 14:30:53 +0000 Date: Thu, 11 Dec 2025 14:30:53 +0000 Message-ID: <86v7idnl9e.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Alexandru Elisei , Sascha Bischoff , Quentin Perret , Sebastian Ene Subject: Re: [PATCH v2 1/6] KVM: arm64: Fix EL2 S1 XN handling for hVHE setups In-Reply-To: References: <20251210173024.561160-1-maz@kernel.org> <20251210173024.561160-2-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: tabba@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, oupton@kernel.org, yuzenghui@huawei.com, alexandru.elisei@arm.com, Sascha.Bischoff@arm.com, qperret@google.com, sebastianene@google.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-20251211_063056_595633_1F15AE94 X-CRM114-Status: GOOD ( 23.25 ) 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 Thu, 11 Dec 2025 13:37:50 +0000, Fuad Tabba wrote: > > Hi Marc, > > > On Wed, 10 Dec 2025 at 17:30, Marc Zyngier wrote: > > > > The current XN implementation is tied to the EL2 translation regime, > > and fall flat on its face with the EL2&0 one that is used for hVHE, > > as the permission bit for privileged execution is a different one. > > > > Fixes: 6537565fd9b7f ("KVM: arm64: Adjust EL2 stage-1 leaf AP bits when ARM64_KVM_HVHE is set") > > Signed-off-by: Marc Zyngier > > --- > > arch/arm64/include/asm/kvm_pgtable.h | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > > index fc02de43c68dd..be68b89692065 100644 > > --- a/arch/arm64/include/asm/kvm_pgtable.h > > +++ b/arch/arm64/include/asm/kvm_pgtable.h > > @@ -87,7 +87,15 @@ typedef u64 kvm_pte_t; > > > > #define KVM_PTE_LEAF_ATTR_HI_SW GENMASK(58, 55) > > > > -#define KVM_PTE_LEAF_ATTR_HI_S1_XN BIT(54) > > +#define __KVM_PTE_LEAF_ATTR_HI_S1_XN BIT(54) > > +#define __KVM_PTE_LEAF_ATTR_HI_S1_UXN BIT(54) > > +#define __KVM_PTE_LEAF_ATTR_HI_S1_PXN BIT(53) > > + > > +#define KVM_PTE_LEAF_ATTR_HI_S1_XN \ > > + ({ cpus_have_final_cap(ARM64_KVM_HVHE) ? \ > > + (__KVM_PTE_LEAF_ATTR_HI_S1_UXN | \ > > + __KVM_PTE_LEAF_ATTR_HI_S1_PXN) : \ > > + __KVM_PTE_LEAF_ATTR_HI_S1_XN; }) > > > > #define KVM_PTE_LEAF_ATTR_HI_S2_XN GENMASK(54, 53) > > I was just wondering, is this patch really necessary, considering > patch 6/6 redos the whole thing and fixes the bug? I want this one to be in a state where it can be backported, without having to deal with the NV-induced FEAT_XNX support. This is why it is a standalone patch. > That said: > Reviewed-by: Fuad Tabba Thanks! M. -- Without deviation from the norm, progress is not possible.