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 X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA5BAC04FF3 for ; Mon, 24 May 2021 17:22:49 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6FFEA613EC for ; Mon, 24 May 2021 17:22:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FFEA613EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 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=OW3grQBlRXDYVktWqz1Ux2UsoZP7RV1WtTK4LcAhIZ0=; b=qWylyiUlkLlJ/d 3jyao6dGdHT9Rb6/TXRYyRhU0zee7zT70bMOCHXzI9oPS0SdDWVQGAfE4BTrwAwyLGnGQyTdj2TUt i9Vm/8VZhXcNAb6jmfSzoQUV19lgm+zXOvIlGj1+m515sU/TQ+gww83TXqH04DmlkMJDMtivCSJFt qbKemolFVch3Wx9RsV3OFEfTLBQ4y1OjoNKvqYFRyEQLAx3x2ujS4DijGSWz+U0WJVcRUPtF7Kk/Z mAbSbWJjiImIU3G+pzHNjS/T8oINRSvQIYL3RT7LQDJZcCcKz5UT6aXL0tqaFQa68aEdChMVWcawv r2f1V0o95QuyzNBHchbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llEGE-001Fo5-H0; Mon, 24 May 2021 17:21:03 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ll6xg-000o02-VC for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 09:33:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47E2231B; Mon, 24 May 2021 02:33:18 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 839DE3F73B; Mon, 24 May 2021 02:33:17 -0700 (PDT) Date: Mon, 24 May 2021 10:33:04 +0100 From: Andre Przywara To: Jaxson Han Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, wei.chen@arm.com Subject: Re: [boot-wrapper PATCH v2 5/8] aarch64: Prepare for lower EL booting Message-ID: <20210524103304.4c9ac90b@slackpad.fritz.box> In-Reply-To: <20210521104807.138269-6-jaxson.han@arm.com> References: <20210521104807.138269-1-jaxson.han@arm.com> <20210521104807.138269-6-jaxson.han@arm.com> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_023325_083718_1C2F7461 X-CRM114-Status: GOOD ( 17.47 ) 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, 21 May 2021 18:48:04 +0800 Jaxson Han wrote: Hi, > Save SPSR_KERNEL into spsr_to_elx during el3_init. > The jump_kernel will load spsr_to_elx into spsr_el3. > > This change will make it easier to control whether drop to lower EL > before jumping to the kernel. Looks good, but this needs some adaption after fixing patch 2/8: > > Signed-off-by: Jaxson Han > --- > arch/aarch64/boot.S | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S > index b8f9e4e..5600859 100644 > --- a/arch/aarch64/boot.S > +++ b/arch/aarch64/boot.S > @@ -118,7 +118,16 @@ el3_init: > mov x0, #ZCR_EL3_LEN_MASK // SVE: Enable full vector len > msr ZCR_EL3, x0 // for EL2. > > -1: > + /* > + * Save SPSR_KERNEL into spsr_to_elx. > + * The jump_kernel will load spsr_to_elx into spsr_el3 > + */ > +1: mov w0, #SPSR_KERNEL > + ldr x1, =spsr_to_elx > + str w0, [x1] > + b el_max_init > + > +el_max_init: > ldr x0, =CNTFRQ > msr cntfrq_el0, x0 > > @@ -166,7 +175,7 @@ jump_kernel: > b.eq 1f > br x19 // Keep current EL > > -1: ldr w4, #SPSR_KERNEL > +1: ldr w4, spsr_to_elx This would be the place where you change the original "mov x4, #SPSR_KERNEL" line into this one here (and not in patch 2). With that fixed: Reviewed-by: Andre Przywara Cheers, Andre > > /* > * If bit 0 of the kernel address is set, we're entering in AArch32 > @@ -184,3 +193,5 @@ jump_kernel: > .align 3 > flag_keep_el: > .long 0 > +spsr_to_elx: > + .long 0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel