Skip to contentSkip to conversation

arm: Setup EL1 and EL2 in AArch64 mode for 64bit Linux boots

RFC In review Edgar E. Iglesias 2 participants 3 messages Jan 27, 2016 – Jan 28, 2016

lore
Share & tools
lore
#0 lore raw

cover arm: Setup EL1 and EL2 in AArch64 mode for 64bit Linux boots

From: "Edgar E. Iglesias" <[email protected]>

Hi,

I've seen some regressions in my test runs lately when enabling EL2 and EL3. It turns out we are not setting RW when booting 64bit Linux kernels.

In the long run, I'm not sure if this does the right thing, for example we might need to revisit if we ever want to support direct loading of 32bit kernels on an AArch64 core.
Anyway, this fixes my testruns for now.

Cheers,
Edgar

Edgar E. Iglesias (1):
hw/arm: Setup EL1 and EL2 in AArch64 mode for 64bit Linux boots

 hw/arm/boot.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
1.9.1
#1 lore raw

RFC 1/1 hw/arm: Setup EL1 and EL2 in AArch64 mode for 64bit Linux boots

From: "Edgar E. Iglesias" <[email protected]>

When booting Linux on AArch64 enabled cores, setup EL1 and EL2 to use AArch64.

---
 hw/arm/boot.c | 2 ++
 1 file changed, 2 insertions(+)
hw/arm/boot.c +2 -0
index 7742dd3..d05a998 100644
@@ -488,7 +488,9 @@ static void do_cpu_reset(void *opaque)
                  * adjust.
                  */
                 if (env->aarch64) {
+                    env->cp15.scr_el3 |= SCR_RW;
                     if (arm_feature(env, ARM_FEATURE_EL2)) {
+                        env->cp15.hcr_el2 |= HCR_RW;
                         env->pstate = PSTATE_MODE_EL2h;
                     } else {
                         env->pstate = PSTATE_MODE_EL1h;
Signature · 1 line
1.9.1
#2 lore raw
In reply to Edgar E. Iglesias
Quoted 4 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Hi,

Quoted 8 lines

I've seen some regressions in my test runs lately when enabling EL2 and EL3. It turns out we are not setting RW when booting 64bit Linux kernels.

In the long run, I'm not sure if this does the right thing, for example we might need to revisit if we ever want to support direct loading of 32bit kernels on an AArch64 core.
Anyway, this fixes my testruns for now.

Looks like the right thing to me. Applied to target-arm.next, thanks.

-- PMM