[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/arm32: head: Add mising isb in switch_to_runtime_mapping()



commit f5a49eb7f8b31c930979f615ee66a994d9537aaa
Author:     Julien Grall <jgrall@xxxxxxxxxx>
AuthorDate: Tue Jul 4 19:58:14 2023 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Tue Jul 4 20:07:47 2023 +0100

    xen/arm32: head: Add mising isb in switch_to_runtime_mapping()
    
    Per the Arm Arm (ARM DDI 0406C.d A3.8.3):
    
    "The DMB and DSB memory barriers affect reads and writes to the memory
    system generated by load/store instructions and data or unified cache
    maintenance operations being executed by the processor. Instruction
    fetches or accesses caused by a hardware translation table access are
    not explicit accesses."
    
    The function switch_to_runtime_mapping() is responsible to map the
    Xen at its runtime address if we were using the temporary area before
    jumping returning using a runtime address. So we need to ensure the
    'dsb' has completed before continuing. Therefore add an 'isb'.
    
    Fixes: fbd9b5fb4c26 ("xen/arm32: head: Remove restriction where to load 
Xen")
    Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>
    Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
---
 xen/arch/arm/arm32/head.S | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 4cfda2cf70..26fc420b2e 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -696,6 +696,11 @@ switch_to_runtime_mapping:
 
         /* Ensure any page table updates are visible before continuing */
         dsb   nsh
+        /*
+         * The function will return on the runtime mapping. So we want
+         * to prevent instruction fetch before the dsb completes.
+         */
+        isb
 
 ready_to_switch:
         mov   pc, lr
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.