Skip to contentSkip to conversation

hw/arm/boot: fix SVE for EL3 direct kernel boot

PATCH Applied [email protected] 3 participants 3 messages Oct 30, 2020 – Nov 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/boot: fix SVE for EL3 direct kernel boot

From: Rémi Denis-Courmont <[email protected]>

When booting a CPU with EL3 using the -kernel flag, set up CPTR_EL3 so that SVE will not trap to EL3.

---
 hw/arm/boot.c | 3 +++
 1 file changed, 3 insertions(+)
hw/arm/boot.c +3 -0
index 3e9816af80..cf97600a91 100644
@@ -742,6 +742,9 @@ static void do_cpu_reset(void *opaque)
                     if (cpu_isar_feature(aa64_mte, cpu)) {
                         env->cp15.scr_el3 |= SCR_ATA;
                     }
+                    if (cpu_isar_feature(aa64_sve, cpu)) {
+                        env->cp15.cptr_el[3] |= CPTR_EZ;
+                    }
                     /* AArch64 kernels never boot in secure mode */
                     assert(!info->secure_boot);
                     /* This hook is only supported for AArch32 currently:
Signature · 1 line
2.29.1
#2 lore raw
Quoted 7 lines · Richard Henderson
Quoted 5 lines · On 10/30/20 8:15 AM, [email protected] wrote:

From: Rémi Denis-Courmont <[email protected]>

When booting a CPU with EL3 using the -kernel flag, set up CPTR_EL3 so that SVE will not trap to EL3.

Quoted 6 lines
Quoted 4 lines
---
 hw/arm/boot.c | 3 +++
 1 file changed, 3 insertions(+)

Applied to target-arm.next, thanks.

-- PMM