]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen/riscv: introduce reset_stack() function
authorOleksii Kurochko <oleksii.kurochko@gmail.com>
Mon, 19 Jun 2023 13:47:37 +0000 (15:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Jun 2023 13:47:37 +0000 (15:47 +0200)
The reason for reset_stack() introduction is that stack should be
reset twice:
1. Before jumping to C world at the start of _start() function.
2. After jumping from 1:1 mapping world.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
xen/arch/riscv/riscv64/head.S

index 8887f0cbd4452129717f0f219890562da0b1d740..2c0304646a1aa2baf1f64886785326e446919187 100644 (file)
@@ -27,8 +27,16 @@ ENTRY(start)
         add     t3, t3, __SIZEOF_POINTER__
         bltu    t3, t4, .L_clear_bss
 
+        jal     reset_stack
+
+        tail    start_xen
+
+        .section .text, "ax", %progbits
+
+ENTRY(reset_stack)
         la      sp, cpu0_boot_stack
         li      t0, STACK_SIZE
         add     sp, sp, t0
 
-        tail    start_xen
+        ret
+