All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaxson Han <jaxson.han@arm.com>
To: mark.rutland@arm.com, andre.przywara@arm.com
Cc: linux-arm-kernel@lists.infradead.org, wei.chen@arm.com,
	jaxson.han@arm.com
Subject: [boot-wrapper PATCH v3 4/8] aarch64: Prepare for EL1 booting
Date: Tue, 25 May 2021 14:25:05 +0800	[thread overview]
Message-ID: <20210525062509.201464-5-jaxson.han@arm.com> (raw)
In-Reply-To: <20210525062509.201464-1-jaxson.han@arm.com>

When booting from EL1, add a check and skip the init of
sctlr_el2 in jump_kernel

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/aarch64/boot.S            | 6 +++++-
 arch/aarch64/include/asm/cpu.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
index 1cdeb1b..8a0219b 100644
--- a/arch/aarch64/boot.S
+++ b/arch/aarch64/boot.S
@@ -144,10 +144,14 @@ jump_kernel:
 	ldr	x0, =SCTLR_EL1_RESET
 	msr	sctlr_el1, x0
 
+	mrs	x0, CurrentEL
+	cmp	x0, #CURRENTEL_EL2
+	b.lt	1f
+
 	ldr	x0, =SCTLR_EL2_RESET
 	msr	sctlr_el2, x0
 
-	cpuid	x0, x1
+1:	cpuid	x0, x1
 	bl	find_logical_id
 	bl	setup_stack		// Reset stack pointer
 
diff --git a/arch/aarch64/include/asm/cpu.h b/arch/aarch64/include/asm/cpu.h
index ccb5397..3c1ba4b 100644
--- a/arch/aarch64/include/asm/cpu.h
+++ b/arch/aarch64/include/asm/cpu.h
@@ -11,6 +11,7 @@
 
 #define MPIDR_ID_BITS		0xff00ffffff
 
+#define CURRENTEL_EL2		(2 << 2)
 #define CURRENTEL_EL3		(3 << 2)
 
 /*
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-25  6:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  6:25 [boot-wrapper PATCH v3 0/8] Add Armv8-R AArch64 support Jaxson Han
2021-05-25  6:25 ` [boot-wrapper PATCH v3 1/8] Decouple V2M_SYS config by auto-detect dtb node Jaxson Han
2021-07-22 10:42   ` Mark Rutland
2021-05-25  6:25 ` [boot-wrapper PATCH v3 2/8] aarch64: Rename labels and prepare for lower EL booting Jaxson Han
2021-05-25 10:34   ` Andre Przywara
2021-07-23 16:48   ` Mark Rutland
2021-07-26  5:33     ` Jaxson Han
2021-05-25  6:25 ` [boot-wrapper PATCH v3 3/8] aarch64: Remove the redundant setup_stack Jaxson Han
2021-07-22 10:41   ` Mark Rutland
2021-05-25  6:25 ` Jaxson Han [this message]
2021-05-25  6:25 ` [boot-wrapper PATCH v3 5/8] aarch64: Prepare for lower EL booting Jaxson Han
2021-05-25  6:25 ` [boot-wrapper PATCH v3 6/8] gic-v3: Prepare for gicv3 with EL2 Jaxson Han
2021-05-25  6:25 ` [boot-wrapper PATCH v3 7/8] aarch64: Prepare for booting " Jaxson Han
2021-05-25  6:25 ` [boot-wrapper PATCH v3 8/8] aarch64: Introduce EL2 boot code for Armv8-R AArch64 Jaxson Han
2021-05-25 10:38   ` Andre Przywara
2021-06-17 11:57 ` [boot-wrapper PATCH v3 0/8] Add Armv8-R AArch64 support Andre Przywara
2021-07-13  2:18   ` Jaxson Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210525062509.201464-5-jaxson.han@arm.com \
    --to=jaxson.han@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=wei.chen@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.