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 A26F4C6FD1D for ; Mon, 27 Mar 2023 17:00:36 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xzU/EZCrelqC6PH/SIt++o24ajR6HgCcqc5dl9RzSOI=; b=CBajf61PinVJX9 NwJjrmpizBIThRw8cdh70o1oCJwuOrQVZnJfdGdsH2Tclj5bA2Wkvtdu0NISG+qaXocz1ynFWsBhW /8ZeQbi8D56zSfIhgLAg2/XDLfzuWRIQ9EQrdIbPcUCsaE0vlU/ExFGbGQ37qc5VjtOPzovc8depd 6XDgVb7d8xyuyRQ6YDR8QfSQMRF7HyiiJmgrAFRPmjxMR/kTT8F0h6w6im61wfYcwKkpccK+RvR7W XfHxKd4ytqsFnDTSqU4mccjlet5WzKyyx+YpO+V9pR4JFIPrAwZ+oJwBuyXD9qjWQtu8jGfxtn4yb 8F8xaDbAIbzO9BuXu2Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgqBy-00BnoB-0O; Mon, 27 Mar 2023 16:59:34 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgqBv-00Bnn5-1j for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 16:59:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F03BEB817AE; Mon, 27 Mar 2023 16:59:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFB2DC433EF; Mon, 27 Mar 2023 16:59:26 +0000 (UTC) Date: Mon, 27 Mar 2023 17:59:23 +0100 From: Catalin Marinas To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, nd@arm.com, broonie@kernel.org, james.morse@arm.com, mark.rutland@arm.com, maz@kernel.org, oliver.upton@linux.dev, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com Subject: Re: [PATCH v1 15/18] arm64: disable EL2 traps for PIE Message-ID: References: <20230309145246.22787-1-joey.gouly@arm.com> <20230309145246.22787-16-joey.gouly@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230309145246.22787-16-joey.gouly@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_095931_730046_AEBAC938 X-CRM114-Status: GOOD ( 16.73 ) 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 Thu, Mar 09, 2023 at 02:52:43PM +0000, Joey Gouly wrote: > Disable trapping of TCR2_EL1 and PIRx_EL1 registers, so they can be > accessed from by EL1. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/el2_setup.h | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h > index 037724b19c5c..6e6675fae194 100644 > --- a/arch/arm64/include/asm/el2_setup.h > +++ b/arch/arm64/include/asm/el2_setup.h > @@ -22,6 +22,21 @@ > isb > .endm > > +.macro __init_el2_hcrx > + mrs x1, id_aa64mmfr1_el1 > + ubfx x0, x1, #ID_AA64MMFR1_EL1_HCX_SHIFT, 4 > + cbz x0, .Lskip_hcrx_\@ > + > + mrs_s x1, SYS_ID_AA64MMFR2_EL1 > + ubfx x0, x1, #ID_AA64MMFR3_EL1_TCRX_SHIFT, 4 > + cbz x0, .Lskip_hcrx_\@ > + > + mrs_s x0, SYS_HCRX_EL2 > + orr x0, x0, #HCRX_EL2_TCR2En > + msr_s SYS_HCRX_EL2, x0 > +.Lskip_hcrx_\@: > +.endm Can we not just set HCRX_EL2_TCR2En without probing for TCRX? BTW, Kristina's doing some initialisation of HCRX_EL2 as well here, not sure whether they conflict: https://lore.kernel.org/all/20230216160012.272345-2-kristina.martsenko@arm.com/ -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel