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 0749FC3DA4A for ; Fri, 16 Aug 2024 15:43:46 +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=0jrsSyad4bi8H3lpUYriVJm9XxumsRDBv0smimR0KCY=; b=vE1a/6wgWlN2FeStHMB03ePXOp aNWr/1QZXw2XpBlUu7hVgYyqY6Zh5saGncuCkSpAVVKIaTeDHfuumwBxtJF6/90fCDgVHJuZtTlor QMdoOu0rZfU28GocYxkiw5Dl2JYonDxKTfnr7mzPt/Pqz+Td7bE0P0FqKt/UkTNx3srTownis5knN ZWMux8zQLZa4VINmQN6i7u7ArmQEjmhuo16dsJWL2Ny5xKNs6O5iU+EhJAkpIv3gDa0QsFc9ocGXv w91mc+U+oyGq2R+rfqUKU3HDYg0Td7ZGx7aAUItJKga6uvxt0n4EwlUxoUK2lfwIcO98d0nKf7Ki+ uz9Z8vww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sez70-0000000DRSK-3x1C; Fri, 16 Aug 2024 15:43:34 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seywF-0000000DOoC-1qce for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2024 15:32:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BD4BF62229; Fri, 16 Aug 2024 15:32:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67E49C4AF0B; Fri, 16 Aug 2024 15:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723822346; bh=2/SyteaEDgLjslhjK5Qrg9vsTkx+4CL4Pn+Rur8QC18=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tPVlavzii20FYM/2odXn3dc4J0pC/bFkESC3D+bRAYJ60xDKKbQDYU7wLO92oko/9 I0igy24KZcT6i753jJI9WxsYUU6D68lkfP9VPCfYKB9F5uUoX7c1EdnvFBs6qCWc+4 D+ly54JIrs5pIPKeHAVaFMTESgVSdKBPQBvD45Le70/UO5fD86Y5/6p19KuZnkt8px XF07CnZ9evf7RwPPBLQ4UKPDxTwFwVLHTmmhV5OByZ8TaO3m2MEuHcoHcj7oCGaAHK OqmY+UmluMV9KFtA93H1zXF/fAIGQQwntdR7E/Kym2bSphGLZxNh0c6eYNBAdDv/5U Nq6MGN86ZajLw== 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.95) (envelope-from ) id 1seywB-004K1i-3k; Fri, 16 Aug 2024 16:32:23 +0100 Date: Fri, 16 Aug 2024 16:32:22 +0100 Message-ID: <86cym8zdo9.wl-maz@kernel.org> From: Marc Zyngier To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.com, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, hpa@zytor.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, npiggin@gmail.com, oliver.upton@linux.dev, shuah@kernel.org, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v4 07/29] KVM: arm64: Save/restore POE registers In-Reply-To: <20240816151301.GA138302@e124191.cambridge.arm.com> References: <20240503130147.1154804-1-joey.gouly@arm.com> <20240503130147.1154804-8-joey.gouly@arm.com> <86ed6ozfe8.wl-maz@kernel.org> <20240816151301.GA138302@e124191.cambridge.arm.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/29.4 (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: joey.gouly@arm.com, linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.com, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, hpa@zytor.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, npiggin@gmail.com, oliver.upton@linux.dev, shuah@kernel.org, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev 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-20240816_083227_642876_A5B4F8BF X-CRM114-Status: GOOD ( 19.01 ) 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, 16 Aug 2024 16:13:01 +0100, Joey Gouly wrote: > > On Fri, Aug 16, 2024 at 03:55:11PM +0100, Marc Zyngier wrote: > > On Fri, 03 May 2024 14:01:25 +0100, > > Joey Gouly wrote: > > > > > > + if (!kvm_has_feat(kvm, ID_AA64MMFR3_EL1, S1POE, IMP)) > > > + kvm->arch.fgu[HFGxTR_GROUP] |= (HFGxTR_EL2_nPOR_EL1 | > > > + HFGxTR_EL2_nPOR_EL0); > > > + > > > > As Broonie pointed out in a separate thread, this cannot work, short > > of making ID_AA64MMFR3_EL1 writable. > > > > This can be done in a separate patch, but it needs doing as it > > otherwise breaks migration. > > > > Thanks, > > > > M. > > > > Looks like it's wrong for PIE currently too, but your patch here fixes that: > https://lore.kernel.org/kvmarm/20240813144738.2048302-11-maz@kernel.org/ > > If I basically apply that patch, but only for POE, the conflict can be resolved > later, or a rebase will fix it up, depending on what goes through first. If I trust my feature dependency decoder, you need to make both TCRX and POE writable: (FEAT_S1POE --> v8Ap8) (FEAT_S1POE --> FEAT_TCR2) (FEAT_S1POE --> FEAT_ATS1A) (FEAT_S1POE --> FEAT_HPDS) (FEAT_S1POE <-> (AArch64 ID_AA64MMFR3_EL1.S1POE >= 1)) (FEAT_TCR2 --> v8Ap0) (v8Ap9 --> FEAT_TCR2) ((FEAT_TCR2 && FEAT_AA64EL2) --> FEAT_HCX) (FEAT_TCR2 <-> (AArch64 ID_AA64MMFR3_EL1.TCRX >= 1)) Feel free to lift part of that patch as you see fit. M. -- Without deviation from the norm, progress is not possible.