xen/arm: head: Add missing isb after writing to SCTLR_EL2/HSCTLR
authorJulien Grall <jgrall@amazon.com>
Sat, 16 Jul 2022 14:34:07 +0000 (15:34 +0100)
committerStefano Stabellini <stefano.stabellini@amd.com>
Wed, 3 Aug 2022 21:57:53 +0000 (14:57 -0700)
Write to SCTLR_EL2/HSCTLR may not be visible until the next context
synchronization. When initializing the CPU, we want the update to take
effect right now. So add an isb afterwards.

Spec references:
    - AArch64: D13.1.2 ARM DDI 0406C.d
    - AArch32 v8: G8.1.2 ARM DDI 0406C.d
    - AArch32 v7: B5.6.3 ARM DDI 0406C.d

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
(cherry picked from commit 25424d1a6b7b7e875230aba77c2f044a4883e49a)

xen/arch/arm/arm32/head.S
xen/arch/arm/arm64/head.S

index 7178865f48c363e0c8674f9affd53788bdef723a..854481f4f9cb9cfef7d08909938379e51b08d7e5 100644 (file)
@@ -353,6 +353,7 @@ cpu_init_done:
 
         ldr   r0, =HSCTLR_SET
         mcr   CP32(r0, HSCTLR)
+        isb
 
         mov   pc, r5                        /* Return address is in r5 */
 ENDPROC(cpu_init)
index 057dd5d9252e334e2a099a1c5889e8544436091a..42a2177c53253b84fd853d0708d39703a78b9a1c 100644 (file)
@@ -485,6 +485,7 @@ cpu_init:
 
         ldr   x0, =SCTLR_EL2_SET
         msr   SCTLR_EL2, x0
+        isb
 
         /*
          * Ensure that any exceptions encountered at EL2