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 1CECBC25B7E for ; Wed, 29 May 2024 15:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jBEe7uJw8QZ71njoB1rt4bGCsaN3zYz8Bja5FCK9eg4=; b=mKiYW23E/cwh5K Mb7WwnnpZ8Zq2UaZwI3YxnrvRDp+pJAwQT1VespwH4XbYJj2EapTPch/S5iC+MS5a6FykBuJ+B9KZ FxqMO5qDO7p6b4vPKWK1t42iJKsXVFXI0uZRqJnIW2GjKq65ZC9g9pV9NfVMNCU5Fs6Xl1mA+68i8 257lxWq/YwDB9fKBEWg1IXgaVv3xPatNhE18Of7/APGET2OM8QC/kOxwls9cVqeAQIaUqyVgG3Ugw dwmEQU3DthyQfXfIDJ9+FTGCcb0r4iMNdsO52z4NXVeN6noNd3aspIGO8UBH45Y20R/cj/nSdUyTs 5O0xVdcd+/At2gtlwdTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCLZk-00000004laz-1zNs; Wed, 29 May 2024 15:50:52 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCLZi-00000004lZl-0ROh for linux-arm-kernel@lists.infradead.org; Wed, 29 May 2024 15:50:51 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4DD51608CC; Wed, 29 May 2024 15:50:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEF38C113CC; Wed, 29 May 2024 15:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716997849; bh=M6v4So8qJJ9yRxrCHyNBpJWbsn6zaiePqJdDikIffcg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qWw6eJ+YExFmA+CUVsPa5hU36SjXwo7pr3BiEUL9LJ+67Mqr4Hrd8Lb5wuOzXl0Fm nI3vNanpRAlmhPs6BppfD9kAAZhjDwpCigABTY5SaKmAqOylHLpQzBfCguH/o4b8S8 YPV9miKGauAOMN9X1G4xOo46q/Yzw93gtZT+WAmAezRXD1RlgfpLkSSoyDFSnU61ty 6aPxG74jhZyUFRj1HhBkmlehlAaxUnrTlDpxqIF4h0eKjAxsv6z1r7TvK+b5uIX2fS dedMJ7ZJ0jZ4xFgolUqJUwJkCxgxaJwwNZMeATlivPYwbanZDUFYha2eT0G73m5Tr0 nRv3RlWSK8qhg== 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 1sCLZe-00GfsI-V4; Wed, 29 May 2024 16:50:47 +0100 Date: Wed, 29 May 2024 16:50:46 +0100 Message-ID: <861q5kmxbd.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 09/29] KVM: arm64: use `at s1e1a` for POE In-Reply-To: <20240503130147.1154804-10-joey.gouly@arm.com> References: <20240503130147.1154804-1-joey.gouly@arm.com> <20240503130147.1154804-10-joey.gouly@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.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") 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-20240529_085050_247825_22507416 X-CRM114-Status: GOOD ( 22.91 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 03 May 2024 14:01:27 +0100, Joey Gouly wrote: > > FEAT_ATS1E1A introduces a new instruction: `at s1e1a`. > This is an address translation, without permission checks. > > POE allows read permissions to be removed from S1 by the guest. This means > that an `at` instruction could fail, and not get the IPA. > > Switch to using `at s1e1a` so that KVM can get the IPA regardless of S1 > permissions. > > Signed-off-by: Joey Gouly > Cc: Marc Zyngier > Cc: Oliver Upton > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/kvm/hyp/include/hyp/fault.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/hyp/include/hyp/fault.h b/arch/arm64/kvm/hyp/include/hyp/fault.h > index 487c06099d6f..17df94570f03 100644 > --- a/arch/arm64/kvm/hyp/include/hyp/fault.h > +++ b/arch/arm64/kvm/hyp/include/hyp/fault.h > @@ -14,6 +14,7 @@ > > static inline bool __translate_far_to_hpfar(u64 far, u64 *hpfar) > { > + int ret; > u64 par, tmp; > > /* > @@ -27,7 +28,9 @@ static inline bool __translate_far_to_hpfar(u64 far, u64 *hpfar) > * saved the guest context yet, and we may return early... > */ > par = read_sysreg_par(); > - if (!__kvm_at(OP_AT_S1E1R, far)) > + ret = system_supports_poe() ? __kvm_at(OP_AT_S1E1A, far) : > + __kvm_at(OP_AT_S1E1R, far); > + if (!ret) > tmp = read_sysreg_par(); > else > tmp = SYS_PAR_EL1_F; /* back to the guest */ Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel